04.03.2013, 21:47
it don't show the player name olny the admin can warn look wat it say:
Test has been warned by admin Test (1/3) - Reason: test
it say it to 2 times. how to make like dis
Testing has been warned by admin Test50 (1/3) - Reason: test
Test has been warned by admin Test (1/3) - Reason: test
it say it to 2 times. how to make like dis
Testing has been warned by admin Test50 (1/3) - Reason: test
Код:
CMD:warn(playerid, params[]) { new PlayerToKick; new iPlayer, szReason[ 128 ] ; if (APlayerData[playerid][PlayerLevel] >= 1) if( sscanf( params, "iS(None specified)[128]", iPlayer, szReason )) return SendClientMessage( playerid, 0xFF0000AA, "[USAGE] /warn [playerid] [reason]" ); g_iWarnings[ iPlayer ] ++; if( g_iWarnings[ iPlayer ] > 2 ) // 3 warnings { // Kick player or whatever you want (and send messages) Kick(PlayerToKick); } else // 1 or 2 warnings { new iName[ MAX_PLAYER_NAME ] ; GetPlayerName( playerid, iName, MAX_PLAYER_NAME ); format( szReason, sizeof( szReason ), "%s has been warned by admin %s (%i/3)%s%s", iName,FormatName(playerid), g_iWarnings[ iPlayer ], ( isnull( szReason ) ? ("") : (" - Reason: ") ), szReason ); SendClientMessageToAll( 0xFFFF00FF, szReason ); } return true; }