22.12.2013, 13:21
pawn Код:
cmd(army, playerid, params[])
{
if( pInfo[ playerid ][ Adminlevel ] >= 5 )
return SendClientMessage( playerid, -1, "Not Authorized." );
new
giveplayerid;
if( sscanf( params, "u", giveplayerid ) || giveplayerid == INVALID_PLAYER_ID )
return SendClientMessage( playerid, COLOR_RED, "Usage: /army (player <id>)" );
if( GetPVarInt( giveplayerid, "ArmyPermission" ) == 1337 )
return SendClientMessage( playerid, COLOR_RED, "That player already have army stats!! ." );
new
PlayerName[ MAX_PLAYER_NAME char ],
giveplayer[ MAX_PLAYER_NAME char ];
GetPlayerName( playerid, PlayerName, sizeof PlayerName );
GetPlayerName( giveplayerid, giveplayer, sizeof giveplayer );
new string[ 128 char ];
format( string, sizeof string, "[ARMY NEWS] Server Admin %s has made %s a member of the Army!", PlayerName, giveplayer);
SendClientMessageToAll( COLOR_PURPLE, string );
SendAdminMessage( string );
CNR_PrintString( string );
SendClientMessage( giveplayerid, COLOR_PURPLE, "You are now able to play as Los Santos Army. Be sure to stick with rules or your army stats will be taken." );
return
SetPVarInt( giveplayerid, "ArmyPermission", 1337 );
}