[pawn] /// == RESET , == INCREASE, == DECREASE == OR == TRANSFER == STATS == CMDS ===
else if ( strcmp( cmd, "resetstats", true ) == 0 )
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c resetstats [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if ( !IsPlayerRegistered(gPlayers[ plr ] ) )
{
format( szMsg, sizeof( szMsg ), "Error: %s is not a registered nick.", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
else
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ plr ] );
dini_IntSet( file, "Deaths", 0 );
dini_IntSet( file, "Kills", 0 );
format( szMsg, sizeof( szMsg ), "%s's stats reseted.", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
}
else if ( strcmp( cmd, "inckills", true ) == 0 )
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c inckills [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if ( !IsPlayerRegistered(gPlayers[ plr ] ) )
{
format( szMsg, sizeof( szMsg ), "Error: %s is not a registered nick.", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
else
{
IncPlayerDeaths( plr, 0 );
IncPlayerKills( plr, 1000 );
format( szMsg, sizeof( szMsg ), "%s's stats Setted", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
}
else if ( strcmp( cmd, "deckills", true ) == 0 )
{
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c deckills [Nick/ID]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if ( !IsPlayerRegistered(gPlayers[ plr ] ) )
{
format( szMsg, sizeof( szMsg ), "Error: %s is not a registered nick.", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
else
{
IncPlayerDeaths( plr, 1000 );
IncPlayerKills( plr, 0 );
format( szMsg, sizeof( szMsg ), "%s's stats Setted", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
}
else if ( strcmp( cmd, "transferstats", true ) == 0 )
{
new plr2;
tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
plr2 = FindPlayerIDFromString( tmp );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "You don't have access to use this command!" );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_RED, "USAGE: /c transferstats [Nick/ID] [PLAYERID2]" );
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else if ( !IsPlayerRegistered(gPlayers[ plr ] )) SendClientMessage(playerid, COLOR_RED, " DOES NOT REGISTERED ");
else if ( !IsPlayerRegistered(gPlayers[ plr2 ] )) SendClientMessage(playerid, COLOR_RED, " DOES NOT REGISTERED ");
else
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ plr ] );
dini_IntSet( file, "Deaths", 0 );
dini_IntSet( file, "Kills", 0 );
format( szMsg, sizeof( szMsg ), "%s's stats reseted.", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
format( file, sizeof( file ), USERS_FILE, gPlayers[ plr ] );
Kill = dini_Get( file, "Kills");
Death = dini_Get( file, "Deaths");
format( file, sizeof( file ), USERS_FILE, gPlayers[ plr2 ] );
dini_IntSet( file, "Kills", Kill[plr] );
dini_IntSet( file, "Deaths", Death[plr] );
format( szMsg, sizeof( szMsg ), "%s's stats transfered", gPlayers[ plr ] );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
}[/pawn]