[Help] 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: [Help] ZCMD (
/showthread.php?tid=159988)
[Help] ZCMD -
Dudits - 15.07.2010
How to make a command in ZCMD new format to be like the following:
/eat 1
SendClientMessage: You have eaten sandwitch
/eat 2
SendClientMessage: You have eaten pizza
Re: [Help] ZCMD -
Kar - 15.07.2010
CMD:eat(playerid, params[])
{
SendClientMessage(playerid,[COLOR], You've Eaten A Sandwitch");
return 1;
}
??
Re: [Help] ZCMD -
Dudits - 15.07.2010
That's /eat, not /eat 1 nor /eat 2.
And I don't want /eat1 nor /eat2.
??
Re: [Help] ZCMD -
Kar - 15.07.2010
use strcmp
Re: [Help] ZCMD -
Dudits - 15.07.2010
Seriously, if you can't do it then just close the thread.
I've got my own reasons to ask for it in the ZCMD format...
Re: [Help] ZCMD -
armyoftwo - 15.07.2010
use sscanf
Re: [Help] ZCMD -
bigcomfycouch - 15.07.2010
pawn Код:
CMD:eat(playerid, params[])
{
new food;
if(sscanf(params, "i", food)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /eat [food ID]");
switch(food)
{
case 1:
case 2://etc
}
return 1;
}
Re: [Help] ZCMD -
Dudits - 15.07.2010
Quote:
Originally Posted by bigcomfycouch
pawn Код:
CMD:eat(playerid, params[]) { new food; if(sscanf(params, "i", food)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /eat [food ID]"); switch(food) { case 1: case 2://etc } return 1; }
|
I don't really know what to say, you're an OG'
Is there a way to use /eat pizza instead of /eat 1?
Re: [Help] ZCMD -
bigcomfycouch - 15.07.2010
pawn Код:
CMD:eat(playerid, params[])
{
new food[32];
if(sscanf(params, "s", food)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE: /eat [food ID]");
if(!strcmp(food, "pizza", true, 5))
{
}
else if(!strcmp(food, "burger", true, 6))
{
}
return 1;
}
Re: [Help] ZCMD -
Dudits - 15.07.2010
This works, thanks man