SA-MP Forums Archive
sscanf help - 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: sscanf help (/showthread.php?tid=626122)



sscanf help - pelican1 - 10.01.2017

i would like to make a cmd like this:

USAGE: /cmd <ID(Optional)> <Action>

I tested it with:
Код HTML:
if(sscanf(params, "U(-1)s[21]", player1, action)) return .....
if(player1 == -1) player1 = playerid
However, when i try with this, it only returns the usage message. Any ideas ?


Re: sscanf help - darkdrago - 10.01.2017

Код:
if(sscanf(params, "us[21]", player1, action))
{
//With ID
}
else if(sscanf(params, "s[21]", action))
{
//Without ID
}
else SendClientMessage(playerid,-1,"[Usage:] /cmd <ID(Optional)> <Action>");
Didn't tried it but let me know if that will work