07.10.2012, 20:38
Hi dear,
i have tried a lot of methods but I cant find the right one.
How can I ask for more parameters? For example (the first parameter with strcmp works, but sscanf under the "car" or "buy" parameter want work correctly) :
I tried it with sscanf... But it will not work on this method. Whats wrong? :S
Thanks for help.
i have tried a lot of methods but I cant find the right one.
How can I ask for more parameters? For example (the first parameter with strcmp works, but sscanf under the "car" or "buy" parameter want work correctly) :
pawn Код:
CMD:command(playerid, params[])
{
if(isnull(params)) {
return SendClientMessage(playerid, -1, "USAGE: /command [name]");
}
else if(!strcmp(params, "car", true)) {
// here I want another thing like this:
new carid, reason[64]
if (!sscanf(params2, "ds[64]", carid,reason))
{
new string[64];
format(string,sizeof(string),"Carid %d spawned, reason: %s",carid,reason);
} else SendClientMessage(playerid,-1,"USAGE: /command car [carid] [reason for spawning]");
}
else if(!strcmp(params, "buy", true)) {
new buyid, reason[64]
if (!sscanf(params2, "ds[64]", carid,reason))
{
new string[64];
format(string,sizeof(string),"Bought %d fishes, reason: %s",carid,reason);
} else SendClientMessage(playerid,-1,"USAGE: /command buy [ammount] [reason for buying fishes]");
}
return 1;
}
Thanks for help.