optional parameters with sscanf
#4

does this work?
Код:
CMD:kick(playerid, params[]) {
     new targetid, reason[128];
     if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_HERE, "Usage: /kick [id] [reason]");
     else if(!sscanf(params, "u", targetid)) {
          //rest of code here
          SendClientMessageToAll(COLOR_HERE, "BLABLABLA has been kicked <> Reason: No reason specified");
     } else if(!sscanf(params, "us[128]", targetid, reason)) {
          //rest of code here
          SendClientMessageToAll(COLOR_HERE, "BLABLABLA has been kicked <> Reason: the reason here");
     }
     return 1;
Reply


Messages In This Thread
optional parameters with sscanf - by jamjamnewbie - 22.05.2014, 13:12
Re: optional parameters with sscanf - by rappy93 - 22.05.2014, 13:14
Re: optional parameters with sscanf - by AndySedeyn - 22.05.2014, 13:21
Re: optional parameters with sscanf - by jamjamnewbie - 22.05.2014, 13:32
Re: optional parameters with sscanf - by AndySedeyn - 22.05.2014, 13:36
Re: optional parameters with sscanf - by jamjamnewbie - 22.05.2014, 13:39
Re: optional parameters with sscanf - by Konstantinos - 22.05.2014, 13:42
Re: optional parameters with sscanf - by AndySedeyn - 22.05.2014, 13:43

Forum Jump:


Users browsing this thread: 1 Guest(s)