25.09.2011, 10:47
I think they mean strfind
https://sampwiki.blast.hk/wiki/Strfind
edit: just read your post properly.
You can use a loop to count the ~ in the string, and check it is finding an even number of them.
A better way to solve the problem would be to change the color input, ie the text the player enters to something like
[b] ( blue ) [r] ( red ) etc, and use strfind to make sure there are no ~ in the text.
Then you process the string to replace these sets of symbols with the correctly formatted textdraw symbols , and then send them to the server.
https://sampwiki.blast.hk/wiki/Strfind
edit: just read your post properly.
You can use a loop to count the ~ in the string, and check it is finding an even number of them.
A better way to solve the problem would be to change the color input, ie the text the player enters to something like
[b] ( blue ) [r] ( red ) etc, and use strfind to make sure there are no ~ in the text.
Then you process the string to replace these sets of symbols with the correctly formatted textdraw symbols , and then send them to the server.