ZCMD question... [newbie] - 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: ZCMD question... [newbie] (
/showthread.php?tid=416726)
ZCMD question... [newbie] -
Squirrel - 18.02.2013
Hey guys, I just started working with ZCMD and SSCANF, I dont get one thing. How do I for example do this inside the ZCMD.
Код:
if(strcmp(cmd, "/door", true) == 0)
if(strcmp(x_nr,"open",true) == 0)
I want to learn how to do the x_nr part inside the ZCMD, or is it possible to use same method?
Re: ZCMD question... [newbie] -
ReneG - 18.02.2013
The params[] in zcmd isn't there for show, it's the value that represents the string a player typed in.
pawn Код:
CMD:door(playerid, params[])
{
if(!strcmp(params, "open", true)) {
// code if they typed open
return 1;
}
else if (!strcmp(params, "close", true)) {
// code if they typed close
return 1;
}
else {
SendClientMessage(playerid, -1, "USAGE: /door [open or close]");
}
return 1;
}
ofc, you can optimize it with isnull(), but I just wanted to get the point across
Re: ZCMD question... [newbie] -
Squirrel - 18.02.2013
Ah thanks mate

I'll test it out