ZCMD & sscanf help
#2

You need to use strdel on the parameters.

pawn Код:
CMD:test( playerid, params[] )
{
    new
        user,
        action [ 24 ];
       
    if( sscanf( params, "s[24]", action ) )
        return SendClientMessage( playerid, -1, "Usage: /test [action]" );
       
    if( strcmp( action, "slap", true) == 0 )
    {
        strdel( params, 0, 4 );
       
        if( sscanf( params, "u", user ) )
            return SendClientMessage( playerid, -1, "Usage: /test slap [playerid]" );
           
        // They typed the params correct, /test slap 0 (for player ID zero)
    }
    return true;
}
Although I'm half asleep, this SHOULD work if I remember correctly.
Reply


Messages In This Thread
ZCMD & sscanf help - by k3nw00d_kri5ty - 07.05.2012, 15:38
Re: ZCMD & sscanf help - by 2KY - 07.05.2012, 15:49
Re: ZCMD & sscanf help - by k3nw00d_kri5ty - 13.05.2012, 19:30

Forum Jump:


Users browsing this thread: 3 Guest(s)