SA-MP Forums Archive
Chat hex bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: Chat hex bug (/showthread.php?tid=588022)



Chat hex bug - Syzygy1 - 04.09.2015

I have a reaction test system in my server, but if you enter a hex colour code in the chat, like "{FF0000}" for example, it's an instant win; the server seems to think the colour code is the reaction test string.

I know it's nothing to do with the way I coded my reaction test system, as another server I used to play on had this bug too.

I fixed this in the past by blocking colour codes from being entered in the chat, but it was another version of my code that I've since lost, and my friend reminded me of the bug just now, so I thought I might as well report it.


Re: Chat hex bug - Crayder - 05.09.2015

This has nothing to do with SA-MP. It's definitely your script... Take it to the Scripting help section.


Re: Chat hex bug - Vince - 05.09.2015

Color codes are filtered by the client. They're never even sent to the server. So, if my assumptions are correct: if the player only enters a color code then the server will receive an empty string. I suppose comparison of the input is done with strcmp. And as is noted on the wiki page for strcmp, it returns 0 (i.e. they are "the same") when either string is empty.


Re: Chat hex bug - Syzygy1 - 05.09.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
Color codes are filtered by the client. They're never even sent to the server. So, if my assumptions are correct: if the player only enters a color code then the server will receive an empty string. I suppose comparison of the input is done with strcmp. And as is noted on the wiki page for strcmp, it returns 0 (i.e. they are "the same") when either string is empty.
Thanks for your help.