SA-MP Forums Archive
Change to 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Change to ZCMD (/showthread.php?tid=179600)



Change to ZCMD - FrankC - 27.09.2010

I got a few codes i wanna change to ZCMD because thats easyer for me..

i got this (example)
Код:
if(strcmp(cmd, "/example", true) == 0)
i wanna change it to this (example)
Код:
command(example, playerid, params[])
ive tryed a few things.. but cant do it
is it even possible? and if, is there a easy way to do it?


Re: Change to ZCMD - LarzI - 27.09.2010

https://sampforum.blast.hk/showthread.php?tid=176372


Re: Change to ZCMD - Faith - 27.09.2010

The way I worked is I replaced (ctrl+h, replace all) every
pawn Код:
if(strcmp(cmd, "/
to
pawn Код:
COMMAND:
and

pawn Код:
", true) == 0)
to
pawn Код:
(playerid, params[])
Then for the scripts, well you just have to use params[] instead of cmdtext[] when you want a parameter and I use sscanf for multiple parameters.


Re: Change to ZCMD - LarzI - 27.09.2010

Just read my tutorial, which I posted a link to in my above post. It should show you how to convert from strcmp to zcmd


Re: Change to ZCMD - FrankC - 27.09.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Quote:
Originally Posted by Faith
Посмотреть сообщение
The way I worked is I replaced (ctrl+h, replace all) every
pawn Код:
if(strcmp(cmd, "/
to
pawn Код:
COMMAND:
and

pawn Код:
", true) == 0)
to
pawn Код:
(playerid, params[])
Then for the scripts, well you just have to use params[] instead of cmdtext[] when you want a parameter and I use sscanf for multiple parameters.
Quote:
Originally Posted by LarzI
Посмотреть сообщение
Just read my tutorial, which I posted a link to in my above post. It should show you how to convert from strcmp to zcmd
Thanks guys, helped me allot


Re: Change to ZCMD - LarzI - 27.09.2010

No problem