Count parameters in 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Count parameters in command (
/showthread.php?tid=99095)
Count parameters in command -
godknightx - 25.09.2009
Hy
How can i count parameters (alias words) in a command?
E.g: /test 1 two 3
How can i count this 3 parameter?
Thanx for help... i searched, but i not found...
Re: Count parameters in command -
Sznupek - 25.09.2009
Read about
dcmd and
sscanf
If something will be vague, ask
Re: Count parameters in command -
godknightx - 25.09.2009
You dont understand me...
I can get value from parameter, but i want count the parameters...
Re: Count parameters in command -
matt2127 - 25.09.2009
why would you need to count them if you set the amount of parameters ?
Re: Count parameters in command -
godknightx - 25.09.2009
Because i dont like write 4-5 strtok instead of 1 line.
Re: Count parameters in command -
Donny_k - 25.09.2009
Check for a space (0x32) and make sure it isn't the end of the line, do this in a loop and increase a variable to give you your count.