| 01-26-2008, 03:39 PM | #1 |
How would you split a chat string in GUI? For example, a player says in chat '-zoom {insertrandomnumberhere}', and I find what the number is and set the camera distance to that. Thank you in advance. |
| 01-26-2008, 03:55 PM | #2 |
Use substrings. Code:
Here's how it's numbered substring ||||||||| 123456789 It corresponds to the position of the number-letter (badly worded from me) Substring 4 to 7 in my example would give you "stri" GRUNT ||||| 12345 Substring 2 to 4 would be RUN |
| 01-26-2008, 08:59 PM | #3 |
Just as he said, all you need to do is find the first number's substring value which should be 7: Code:
-zoom 56 |||||||| 12345678 Then just take the length of the chat string and use it as the upper bound: Trigger: Notice it said "as A substring" in the event. Also notice you need to convert the string value you get to a real number to put it in the action for the camera distance. |
