Change to ZCMD
#1

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?
Reply
#2

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

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.
Reply
#4

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
Reply
#5

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
Reply
#6

No problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)