Command - 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: Command (
/showthread.php?tid=343123)
Command -
iGetty - 16.05.2012
How could I make this: Server: /set [playerid/name] [section] [amount]
In zcmd with sscanf?
Thanks!
Re: Command -
[ABK]Antonio - 16.05.2012
pawn Код:
new target, option[24], amount;
if(sscanf(params, "rs[24]i", target, option, amount))
If there's going to be say an amount that's a string you can do...
pawn Код:
new target, option[24], amount[24];
if(sscanf(params, "rs[24]s[24]", target, option, amount)) //whatever here
if(!strcmp(option, "MyOption", true))
{
new amountt = strval(amount); //if it's a number you want
}
//if not
if(!strcmp(option, "MyOtherOption", true))
{
if(!strcmp(amount, "Thing I want to check the amount with", true)) //we do stuff
}