sscanf strings with spaces - 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: sscanf strings with spaces (
/showthread.php?tid=267383)
sscanf strings with spaces -
JackYack13 - 08.07.2011
I wanted to make a /voting command that would go like /voting <title> <option1> <option2> but I don't know how to make it so that there can be spaces in title and the options, like for example: /voting "Do you like me?" "Yes I do" "No I don't". Is it possible using sscanf?
Re: sscanf strings with spaces -
Jeffry - 08.07.2011
Use Dialogs with the input style. My suggestion.
Jeffry
Re: sscanf strings with spaces -
Jefff - 08.07.2011
I think only with delimiters
pawn Код:
new title[24],option1[64],option2[64]
sscanf(cmdtext,"p<->s[24]s[64]s[64]",title,option1,option2)
/voting Do you like me?-Yes I do-No I don't
Re: sscanf strings with spaces -
Jeffry - 08.07.2011
Quote:
Originally Posted by Jefff
I think only with delimiters
pawn Код:
new title[24],option1[64],option2[64] sscanf(cmdtext,"p<->s[24]s[64]s[64]",title,option1,option2)
/voting Do you like me?-Yes I do-No I don't
|
Would be an option as well. Didn't know that sscanf has such a function, never been using it. ^^