zcmd kick command
#4

First, if you are using plugin:

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.

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:

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;
}
Reply


Messages In This Thread
zcmd kick command - by Omecken - 23.02.2011, 10:16
Re: zcmd kick command - by XFlawless - 23.02.2011, 10:20
Re: zcmd kick command - by Omecken - 23.02.2011, 10:23
Re: zcmd kick command - by Gh0sT_ - 23.02.2011, 10:29
Re: zcmd kick command - by Omecken - 23.02.2011, 10:38
Re: zcmd kick command - by DevilG - 23.02.2011, 10:53
Re: zcmd kick command - by Omecken - 23.02.2011, 10:55
Re: zcmd kick command - by xir - 23.02.2011, 11:01
Re: zcmd kick command - by HyperZ - 23.02.2011, 12:47

Forum Jump:


Users browsing this thread: 3 Guest(s)