repeat
#2

Here we have ZCMD:
pawn Код:
COMMAND:/vehname(playerid,params[])
{
            new Target; //defines the playerid we wanna freeze
            if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vehname [vehname]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
}
we have used sscanf to check what is after the cmd you typed. If you have nothing, it will return you an error.

Now using strcmp:
pawn Код:
if(strcmp("/vehname", cmd, true) == 0)
{
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp))
        {
            return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /kick [id] [reason]");
        }
}
Here we will have to use strtok to check what is after the cmd.

For better performance, use sscanf(plugin) with YCMD.
Reply


Messages In This Thread
repeat - by chickinfingers - 23.12.2012, 02:43
Re: repeat - by Faisal_khan - 23.12.2012, 04:26
Re: repeat - by chickinfingers - 25.12.2012, 02:28

Forum Jump:


Users browsing this thread: 1 Guest(s)