Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[rezolvat]Modificare plugin
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
501
DaNy-
[Banned user]
Status: Offline
(since 15-03-2015 15:23)
Joined: 16 Nov 2014
Posts: 917
,
Topics: 124
Location:
Pãmânt
Reputation:
35.1
Votes
: 25
Posted: 08-03-2015, 19:49:34
| Translate post to:
... (
Click for more languages
)
Salut, daca se poate sa faceti sa aiba acces la /donate, /transfer doar cei cu flagu "b".
Mersi, am mare nevoie.
Spoiler:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
//#include <CC_ColorChat>
//#include <fcs>
#define PLUGIN "FCS Transfer System"
#define VERSION "1.0"
enum Color
{
NORMAL = 1, // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
GREEN, // Culoare Verde.
TEAM_COLOR, // Culoare Rosu, Albastru, Gri.
GREY, // Culoarea Gri.
RED, // Culoarea Rosu.
BLUE, // Culoarea Albastru.
}
new TeamName[ ][ ] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
//--| Furien Credits System .inc file
/*
* Returns a players credits
*
* @param client - The player index to get points of
*
* @return The credits client
*
*/
native fcs_get_user_credits(client);
/*
* Sets <credits> to client
*
* @param client - The player index to set points to
* @param credits - The amount of credits to set to client
*
* @return The credits of client
*
*/
native fcs_set_user_credits(client, credits);
/*
* Adds <credits> points to client
*
* @param client - The player index to add points to
* @param credits - The amount of credits to add to client
*
* @return The credits of client
*
*/
stock fcs_add_user_credits(client, credits)
{
return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}
/*
* Subtracts <credits> from client
*
* @param client - The player index to subtract points from
* @param credits - The amount of credits to substract from client
*
* @return The credits of client
*
*/
stock fcs_sub_user_credits(client, credits)
{
return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}
//--| End of Furien Credits System .inc file
new const g_szTag[ ] = "[Furien Credits]";
new g_iCvarEnable;
new g_iCvarMaxCredits;
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );
register_clcmd( "say", "HookClCmdSayOrSayTeam" );
register_clcmd( "say_team", "HookClCmdSayOrSayTeam" );
register_clcmd( "fcs_donate", "ClCmdFcsDonate" );
register_clcmd( "fcs_transfer", "ClCmdFcsDonate" );
g_iCvarEnable = register_cvar("fcs_transfer_enable", "1" );
g_iCvarMaxCredits = register_cvar("fcs_transfer_maxcredits", "50" );
}
public HookClCmdSayOrSayTeam( id )
{
static szArgs[ 192 ], szCommand[ 192 ];
read_args( szArgs, sizeof ( szArgs ) -1 );
if( !szArgs[ 0 ] )
return PLUGIN_CONTINUE;
remove_quotes( szArgs );
if( equal( szArgs, "/transfer", strlen( "/transfer" ) )
|| equal( szArgs, "/donate", strlen( "/donate" ) ) )
{
replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
formatex( szCommand, sizeof ( szCommand ) -1, "fcs_%s", szArgs );
client_cmd( id, szCommand );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public ClCmdFcsDonate( id )
{
if( get_pcvar_num( g_iCvarEnable ) != 1 )
{
ColorChat( id, RED, "^x04%s^x01 Comanda dezactivata de catre server!", g_szTag );
return PLUGIN_HANDLED;
}
new szFirstArg[ 32 ], szSecondArg[ 10 ];
read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
read_argv( 2, szSecondArg, sizeof ( szFirstArg ) -1 );
if( !szFirstArg[ 0 ] || !szSecondArg[ 0 ] )
{
ColorChat( id, RED, "^x04%s^x01 Folosire:^x03 /transfer^x01 sau^x03 /donate^x01 <^x03 nume^x01 > <^x03 xp^x01 >.", g_szTag );
return 1;
}
new iPlayer = cmd_target( id, szFirstArg, 8 );
if( !iPlayer )
{
ColorChat( id, RED, "^x04%s^x01 Acel jucator nu a fost gasit.", g_szTag );
return PLUGIN_HANDLED;
}
if( iPlayer == id )
{
ColorChat( id, RED, "^x04%s^x01 Nu-ti poti transfera credite.", g_szTag );
return PLUGIN_HANDLED;
}
new iCredits;
iCredits = str_to_num( szSecondArg );
if( iCredits <= 0 )
{
ColorChat( id, RED, "^x04%s^x01 Trebuie sa introduci o valoare mai mare de 0.", g_szTag );
return PLUGIN_HANDLED;
}
new iMaxCredits = get_pcvar_num( g_iCvarMaxCredits );
if( iCredits > iMaxCredits )
{
ColorChat( id, RED, "^x04%s^x01 Poti transfera maxim^x03 %i^x01 credit%s o data!", g_szTag, iMaxCredits, iMaxCredits == 1 ? "" : "e" );
return PLUGIN_HANDLED;
}
new iUserCredits = fcs_get_user_credits( id );
if( iUserCredits < iCredits )
{
ColorChat( id, RED, "^x04%s^x01 Nu ai destule credite, ai doar^x03 %i credit%s^x01.", g_szTag, iUserCredits, iUserCredits == 1 ? "" : "e" );
return 1;
}
fcs_sub_user_credits( id, iCredits );
fcs_add_user_credits( iPlayer, iCredits );
new szFirstName[ 32 ], szSecondName[ 32 ];
get_user_name( id, szFirstName, sizeof ( szFirstName ) -1 );
get_user_name( iPlayer, szSecondName, sizeof ( szSecondName ) -1 );
ColorChat( 0, RED, "^x04%s^x03 %s^x01 i-a transferat^03 %i credit%s^x01 lui^x03 %s^x01 .", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
return PLUGIN_HANDLED;
}
ColorChat( id, Color:iType, const msg[ ], { Float, Sql, Result, _}:... )
{
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
if( !get_playersnum( ) ) return;
new szMessage[ 256 ];
switch( iType )
{
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
case NORMAL: szMessage[ 0 ] = 0x01;
// Culoare Verde.
case GREEN: szMessage[ 0 ] = 0x04;
// Alb, Rosu, Albastru.
default: szMessage[ 0 ] = 0x03;
}
vformat( szMessage[ 1 ], 251, msg, 4 );
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
szMessage[ 192 ] = '^0';
new iTeam, iColorChange, iPlayerIndex, MSG_Type;
if( id )
{
MSG_Type = MSG_ONE_UNRELIABLE;
iPlayerIndex = id;
}
else
{
iPlayerIndex = CC_FindPlayer( );
MSG_Type = MSG_ALL;
}
iTeam = get_user_team( iPlayerIndex );
iColorChange = CC_ColorSelection( iPlayerIndex, MSG_Type, iType);
CC_ShowColorMessage( iPlayerIndex, MSG_Type, szMessage );
if( iColorChange ) CC_Team_Info( iPlayerIndex, MSG_Type, TeamName[ iTeam ] );
}
CC_ShowColorMessage( id, const iType, const szMessage[ ] )
{
static bool:bSayTextUsed;
static iMsgSayText;
if( !bSayTextUsed )
{
iMsgSayText = get_user_msgid( "SayText" );
bSayTextUsed = true;
}
message_begin( iType, iMsgSayText, _, id );
write_byte( id )
write_string( szMessage );
message_end( );
}
CC_Team_Info( id, const iType, const szTeam[ ] )
{
static bool:bTeamInfoUsed;
static iMsgTeamInfo;
if( !bTeamInfoUsed )
{
iMsgTeamInfo = get_user_msgid( "TeamInfo" );
bTeamInfoUsed = true;
}
message_begin( iType, iMsgTeamInfo, _, id );
write_byte( id );
write_string( szTeam );
message_end( );
return 1;
}
CC_ColorSelection( id, const iType, Color:iColorType)
{
switch( iColorType )
{
case RED: return CC_Team_Info( id, iType, TeamName[ 1 ] );
case BLUE: return CC_Team_Info( id, iType, TeamName[ 2 ] );
case GREY: return CC_Team_Info( id, iType, TeamName[ 0 ] );
}
return 0;
}
CC_FindPlayer( )
{
new iMaxPlayers = get_maxplayers( );
for( new i = 1; i <= iMaxPlayers; i++ )
if( is_user_connected( i ) )
return i;
return -1;
}
0
0
Back to top
destroi112
[DEV]
Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042
,
Topics: 119
Location:
---------
Reputation:
515.9
Votes
: 118
Posted: 08-03-2015, 19:59:04
| Translate post to:
... (
Click for more languages
)
poftim
Spoiler:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
//#include <CC_ColorChat>
//#include <fcs>
#define ADMIN_DONATE ADMIN_RESERVATION
#define PLUGIN "FCS Transfer System"
#define VERSION "1.0"
enum Color
{
NORMAL = 1, // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
GREEN, // Culoare Verde.
TEAM_COLOR, // Culoare Rosu, Albastru, Gri.
GREY, // Culoarea Gri.
RED, // Culoarea Rosu.
BLUE, // Culoarea Albastru.
}
new TeamName[ ][ ] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
//--| Furien Credits System .inc file
/*
* Returns a players credits
*
* @param client - The player index to get points of
*
* @return The credits client
*
*/
native fcs_get_user_credits(client);
/*
* Sets <credits> to client
*
* @param client - The player index to set points to
* @param credits - The amount of credits to set to client
*
* @return The credits of client
*
*/
native fcs_set_user_credits(client, credits);
/*
* Adds <credits> points to client
*
* @param client - The player index to add points to
* @param credits - The amount of credits to add to client
*
* @return The credits of client
*
*/
stock fcs_add_user_credits(client, credits)
{
return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}
/*
* Subtracts <credits> from client
*
* @param client - The player index to subtract points from
* @param credits - The amount of credits to substract from client
*
* @return The credits of client
*
*/
stock fcs_sub_user_credits(client, credits)
{
return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}
//--| End of Furien Credits System .inc file
new const g_szTag[ ] = "[Furien Credits]";
new g_iCvarEnable;
new g_iCvarMaxCredits;
public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );
register_clcmd( "say", "HookClCmdSayOrSayTeam" );
register_clcmd( "say_team", "HookClCmdSayOrSayTeam" );
register_clcmd( "fcs_donate", "ClCmdFcsDonate" );
register_clcmd( "fcs_transfer", "ClCmdFcsDonate" );
g_iCvarEnable = register_cvar("fcs_transfer_enable", "1" );
g_iCvarMaxCredits = register_cvar("fcs_transfer_maxcredits", "50" );
}
public HookClCmdSayOrSayTeam( id )
{
if(get_user_flags(id) & ADMIN_DONATE)
{
static szArgs[ 192 ], szCommand[ 192 ];
read_args( szArgs, sizeof ( szArgs ) -1 );
if( !szArgs[ 0 ] )
return PLUGIN_CONTINUE;
remove_quotes( szArgs );
if( equal( szArgs, "/transfer", strlen( "/transfer" ) )
|| equal( szArgs, "/donate", strlen( "/donate" ) ) )
{
replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
formatex( szCommand, sizeof ( szCommand ) -1, "fcs_%s", szArgs );
client_cmd( id, szCommand );
return PLUGIN_HANDLED;
}
}else
{
ColorChat( id, RED, "^x04%s^x01 Doar cei cu gradu mai mare ca slot pot dona credite. (inclusiv slot)!", g_szTag );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public ClCmdFcsDonate( id )
{
if( get_pcvar_num( g_iCvarEnable ) != 1 )
{
ColorChat( id, RED, "^x04%s^x01 Comanda dezactivata de catre server!", g_szTag );
return PLUGIN_HANDLED;
}
if(get_user_flags(id) & ADMIN_DONATE)
{
new szFirstArg[ 32 ], szSecondArg[ 10 ];
read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
read_argv( 2, szSecondArg, sizeof ( szFirstArg ) -1 );
if( !szFirstArg[ 0 ] || !szSecondArg[ 0 ] )
{
ColorChat( id, RED, "^x04%s^x01 Folosire:^x03 /transfer^x01 sau^x03 /donate^x01 <^x03 nume^x01 > <^x03 xp^x01 >.", g_szTag );
return 1;
}
new iPlayer = cmd_target( id, szFirstArg, 8 );
if( !iPlayer )
{
ColorChat( id, RED, "^x04%s^x01 Acel jucator nu a fost gasit.", g_szTag );
return PLUGIN_HANDLED;
}
if( iPlayer == id )
{
ColorChat( id, RED, "^x04%s^x01 Nu-ti poti transfera credite.", g_szTag );
return PLUGIN_HANDLED;
}
new iCredits;
iCredits = str_to_num( szSecondArg );
if( iCredits <= 0 )
{
ColorChat( id, RED, "^x04%s^x01 Trebuie sa introduci o valoare mai mare de 0.", g_szTag );
return PLUGIN_HANDLED;
}
new iMaxCredits = get_pcvar_num( g_iCvarMaxCredits );
if( iCredits > iMaxCredits )
{
ColorChat( id, RED, "^x04%s^x01 Poti transfera maxim^x03 %i^x01 credit%s o data!", g_szTag, iMaxCredits, iMaxCredits == 1 ? "" : "e" );
return PLUGIN_HANDLED;
}
new iUserCredits = fcs_get_user_credits( id );
if( iUserCredits < iCredits )
{
ColorChat( id, RED, "^x04%s^x01 Nu ai destule credite, ai doar^x03 %i credit%s^x01.", g_szTag, iUserCredits, iUserCredits == 1 ? "" : "e" );
return 1;
}
fcs_sub_user_credits( id, iCredits );
fcs_add_user_credits( iPlayer, iCredits );
new szFirstName[ 32 ], szSecondName[ 32 ];
get_user_name( id, szFirstName, sizeof ( szFirstName ) -1 );
get_user_name( iPlayer, szSecondName, sizeof ( szSecondName ) -1 );
ColorChat( 0, RED, "^x04%s^x03 %s^x01 i-a transferat^03 %i credit%s^x01 lui^x03 %s^x01 .", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
return PLUGIN_HANDLED;
}else{
ColorChat( id, RED, "^x04%s^x01 Doar cei cu gradu mai mare ca slot pot dona credite(inclusiv slot).", g_szTag );
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
ColorChat( id, Color:iType, const msg[ ], { Float, Sql, Result, _}:... )
{
// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
if( !get_playersnum( ) ) return;
new szMessage[ 256 ];
switch( iType )
{
// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
case NORMAL: szMessage[ 0 ] = 0x01;
// Culoare Verde.
case GREEN: szMessage[ 0 ] = 0x04;
// Alb, Rosu, Albastru.
default: szMessage[ 0 ] = 0x03;
}
vformat( szMessage[ 1 ], 251, msg, 4 );
// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
szMessage[ 192 ] = '^0';
new iTeam, iColorChange, iPlayerIndex, MSG_Type;
if( id )
{
MSG_Type = MSG_ONE_UNRELIABLE;
iPlayerIndex = id;
}
else
{
iPlayerIndex = CC_FindPlayer( );
MSG_Type = MSG_ALL;
}
iTeam = get_user_team( iPlayerIndex );
iColorChange = CC_ColorSelection( iPlayerIndex, MSG_Type, iType);
CC_ShowColorMessage( iPlayerIndex, MSG_Type, szMessage );
if( iColorChange ) CC_Team_Info( iPlayerIndex, MSG_Type, TeamName[ iTeam ] );
}
CC_ShowColorMessage( id, const iType, const szMessage[ ] )
{
static bool:bSayTextUsed;
static iMsgSayText;
if( !bSayTextUsed )
{
iMsgSayText = get_user_msgid( "SayText" );
bSayTextUsed = true;
}
message_begin( iType, iMsgSayText, _, id );
write_byte( id )
write_string( szMessage );
message_end( );
}
CC_Team_Info( id, const iType, const szTeam[ ] )
{
static bool:bTeamInfoUsed;
static iMsgTeamInfo;
if( !bTeamInfoUsed )
{
iMsgTeamInfo = get_user_msgid( "TeamInfo" );
bTeamInfoUsed = true;
}
message_begin( iType, iMsgTeamInfo, _, id );
write_byte( id );
write_string( szTeam );
message_end( );
return 1;
}
CC_ColorSelection( id, const iType, Color:iColorType)
{
switch( iColorType )
{
case RED: return CC_Team_Info( id, iType, TeamName[ 1 ] );
case BLUE: return CC_Team_Info( id, iType, TeamName[ 2 ] );
case GREY: return CC_Team_Info( id, iType, TeamName[ 0 ] );
}
return 0;
}
CC_FindPlayer( )
{
new iMaxPlayers = get_maxplayers( );
for( new i = 1; i <= iMaxPlayers; i++ )
if( is_user_connected( i ) )
return i;
return -1;
}
Retired from Amxmodx
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Locked by
EDUTz
, 10 March 2015 10:56
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 30-11-2024, 12:46:38
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details