Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
Hey! I was wondering how I'd go about checking for small errors in a GameText text, like for example, if you are typing something like "~rRandom Text" the game would crash cause it's missing the last "~", I was wondering how I could send the player a message telling them that they're missing the "~".
Thanks.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
I think that already happens automatically. The server sends an automated message about "unmatched tilde".
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
you can use strfind to see if an ~ exists, and then use an IsEven function to check if there is an even amount by extract all the ~s and storing the length of the resulting string.
Posts: 2,524
Threads: 109
Joined: Sep 2009
Reputation:
0
Good point, never thought of that :P
Posts: 519
Threads: 59
Joined: May 2014
Reputation:
0
you can use sscanf and set Colors. /Text (Colors) (Text) [ /Text Red Hi ]
and then using strcmp to get if Colors was Red use: ~r~Hi