How do i split a string and remove the spaces? RESOLVED :o)
Hi, i have a problem and it's really annoying me, i want to split a string into 4 pieces and remove the spaces from this:
"vote battlefield sq1 linebattle" into this: var1 = "vote" map1 = "battlefield" map2 = "sq1" map3 = "linebattle" i have searched and tried a lot of things like parse,copyc, read_args and i am about to give up so any help would be great ty. |
Haven't used this but it might be what your looking for -> http://www.amxmodx.org/funcwiki.php?go=func&id=59
|
I did try that, but i couldn't get it to work :(
the problem i am having is that the size of the stings that i am trying to split will be different everytime, thanks anyway. |
Where are you getting the string from? A console command or say or what?
|
Yep, i'm getting it from say, so i that can do a map vote with say instead of from the console, the only bit that i'm really stuck on is splitting the strings
i tried this but i can't get it to work either :( parse(CmdMsg,Cmd,32,Msg,32,Msg1,32,Msg2,32) |
Have you tried read_argv - ing a few times?
|
i tried read_args, i will try argv instead and see if that works lol
thanks :) |
It didn't work
Code:
Msg had nothing in it, Cmd had the whole line, so did CmdMsg :( |
Don't do read_args, just read_argv's.
|
Same thing, sigh...
Code:
Cmd has the whole line, Msg and Msg1 are empty. :roll: Thanks for you help tho. |
| All times are GMT -4. The time now is 19:29. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.