LonelyRoad Posted August 8, 2010 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.
SDK Posted August 8, 2010 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 Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
dzek (varez) Posted August 8, 2010 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!!!!!!!!!!!!!!!! Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
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