26.03.2012, 13:49
pawn Код:
CMD:setadmin ( playerid , params [] )
{
if ( PlayerInfo [ playerid ][ AdminLevel ] <= 5) return MESSAGE(cred, errorna);
new ID , LvL , pName [ MAX_PLAYER_NAME ] ;
GetPlayerName ( ID , pName , MAX_PLAYER_NAME ) ;
if ( !IsPlayerConnected ( ID ) ) return MESSAGE(cred, invalid);
if ( sscanf ( params "ud" , ID , LvL ) ) return MESSAGE ( cred , "USAGE:{FFFFFF} /setadmin [name/id] [level]" ) ;
else
{
PlayerInfo[id][AdminLevel] = 6;
new Str [ 128 ] ;
format ( Str , 128 , "Admin level set for %s" , ID ) ;
MESSAGE ( cyellow , Str ) ;
format ( Str , 128 , "Admin level (%d) set by admin" , LvL ) ;
SendClientMessage ( ID , cwhite , Str);
}
return 1;
}