23.02.2011, 10:29
First, if you are using plugin:
so, you need change z to s, like..
new id, string[ 128 ];
sscanf( params, "us[128]", id, string ) ) ...
[128] - lenght of ur string.
and your command can be MUCH longer:
Quote:
What happened to "z", the optional string? z has been removed (you can still use it but will get a server warning) to make way for the new optional parameter system described later on. |
new id, string[ 128 ];
sscanf( params, "us[128]", id, string ) ) ...
[128] - lenght of ur string.
and your command can be MUCH longer:
pawn Код:
COMMAND:kick( playerid, params[ ] )
{
if( PlayerInfo[ playerid ][ pAdminLevel ] == 0 ) return SendClientMessage( playerid, 0xAAAAAAAA, "You are not admin or the required level." );
new
ID,
Reason[ 101 ]
;
if( sscanf( params, "us[101]", ID, Reason ) ) return SendClientMessage( playerid, 0xFFFFFFFF, "/kick [playerid/name] [reason]" );
if( ID == INVALID_PLAYER_ID || ID == playerid ) return SendClientMessage( playerid, 0xFFFFFFFF, "This player is not connected" );
if( strlen( Reason ) > 100 ) return SendClientMessage( playerid, 0xFFFFFFFF, "Reason is too long.. [Max chars - 100]" );
new
String[ 188 ]
;
format( String, 188, "Admin %s kicked kicked %s. | Reason: %s", GetPlayerNameEx( playerid ), GetPlayerNameEx( ID ), Reason );
SendClientMessageToAll( 0xFFFFFFFF, String );
Kick( ID );
return true;
}