03.01.2010, 13:32
Hey,
First of all, I'd like to separate entered text in a command, but all the data wouldn't be separated by spaces, but by '/' (birthdate) so I would type /birthdate dd/mm/yyyy (replace d, m and y by numbers) and I'd like to separate dd from mm and yyyy, etc. I've heard sscanf could do this, but only one problem, I don't know how!
How to use this format?
First of all, I'd like to separate entered text in a command, but all the data wouldn't be separated by spaces, but by '/' (birthdate) so I would type /birthdate dd/mm/yyyy (replace d, m and y by numbers) and I'd like to separate dd from mm and yyyy, etc. I've heard sscanf could do this, but only one problem, I don't know how!
Quote:
Originally Posted by https://sampwiki.blast.hk/wiki/Sscanf
pX - An additional delimiter where X is another character.
|
Quote:
Originally Posted by https://sampwiki.blast.hk/wiki/Fast_Commands
p<delimiter> Splitter The next character is used as a string delimiter, example:
"p|iii" Will split this string into three integers: 1|2|3 Note that on things other than strings space is still used as well. |