13.07.2011, 14:03
pawn Код:
CMD:class( playerid, params[ ] ) {
new
id
;
if ( AdminLevel[ playerid ] != 1337 )
return SendClientMessage( playerid, -1, "You are not l33t." );
if ( sscanf( params, "u", id ) )
return SendClientMessage( playerid, -1, "Usage: /class [ playerid / partOfName ]" );
if ( id = INVALID_PLAYER_ID )
return SendClientMessage( playerid, -1, "Invalid player." );
SendClientMessage( id, -1, "You have been forced to the class selection by a l33t admin." );
ForceClassSelection( id ):
SetPlayerHealth( id, 0.0 );
return 1;
}
Use "u" for players ( sscanf ),
it will detect if the player entered an ID,
or a partOfName ( e.G: Basicz ), can be used as "/class bas".