LonelyRoad Posted August 8, 2010 Share Posted August 8, 2010 Hey guys, I was looking to get some help with something, I want to know if the race gamemode calls an event when map voting starts. Also, I would like to know if I how to check onPlayerChat for numbers 1-9 and if it contains that, to replace it with an X or something like that. Regards. Link to comment
SDK Posted August 8, 2010 Share Posted August 8, 2010 1) https://wiki.multitheftauto.com/wiki/Resource:Race -> Events You probably need onPollStarting or onRaceStateChanging 2) https://wiki.multitheftauto.com/wiki/OnPlayerChat Read Cancel effect Good luck Link to comment
dzek (varez) Posted August 8, 2010 Share Posted August 8, 2010 use this to cancel all messages starting with number and not having any a-z letters function trim (s) return (string.gsub(s, "^%s*(.+)%s*$", "%1")) end addEventHandler("onPlayerChat", getRootElement(), function(msg, type) if (string.find(trim(msg), "^[0-9]+[^a-z]*$")~=nil) then cancelEvent() end end) these will be cancelled: 1 1!!!!!! 111111111111!!!!!!!!! 1111111111111$%^%$& 1111111111 11111111111 11111111111 these will not be cancelled: 1 is very cool, vote! vote for 1 x 111111111111 i want 1!!!!!!!!!!!!!!!! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now