SA-MP Forums Archive
strcmp cmd in zcmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: strcmp cmd in zcmd (/showthread.php?tid=364198)



strcmp cmd in zcmd - P<3TS - 29.07.2012

Hello, is it possible to make a strcmp cmd in zcmd.
I cannot make a cmd like this
pawn Код:
CMD:tele 1(playerid,params[]) {
Is it possible? if yes then how?


Re: strcmp cmd in zcmd - Kindred - 29.07.2012

(if correct) You cannot use spaces within commands, you can use things like isnull to check if the params is null or use sscanf.

This is an example:

pawn Код:
CMD:tele(playerid, params[])
{
    if(sscanf(params, "i", teleid)) return SendClientMessage(playerid, -1, "Usage: /tele [id]");
    if(teleid == 1)
    {
        //If they typed /tele 1, do something here
    }
    return 1;
}
Using ZCMD and sscanf.


Re: strcmp cmd in zcmd - SA-MPDrifter - 29.07.2012

The command for strcmp would be the exact same in ZCMD, the only difference is the parameters in which ZCMD uses.