Command
#1

How could I make this: Server: /set [playerid/name] [section] [amount]

In zcmd with sscanf?

Thanks!
Reply
#2

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
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)