Chat hex bug
#1

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.
Reply
#2

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

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)