Nerses Posted July 17, 2014 Author Share Posted July 17, 2014 here is my Lua local ads = { 'AD1', 'AD2', 'AD3', 'AD4', 'AD5', } addEventHandler("onPlayerChat", root, function(msg) for _,v in ipairs(ads) do if string.find(msg,v) then banPlayer( source ) end end end ) here is my meta <meta> <info author='ners' version='1.1' name='Anti-Flood' type='script' /> <script src="anti_flood.lua" type="server" /> </meta> Link to comment
Memory Posted July 17, 2014 Share Posted July 17, 2014 Oh *facepalm* ... Your code incorrect, Onix+ already wrote correct variant: local ads = { 'AD1', 'AD2', 'AD3', 'AD4', 'AD5' -- Don't forget to keep the last one without comma. } addEventHandler("onPlayerChat", root, function(msg) for index, v in ipairs(ads) do if string.find(msg,v) then cancelEvent() banPlayer ( source, false, false, true ) end end end ) Link to comment
Nerses Posted July 17, 2014 Author Share Posted July 17, 2014 Oh *facepalm* ...Your code incorrect, Onix+ already wrote correct variant: local ads = { 'AD1', 'AD2', 'AD3', 'AD4', 'AD5' -- Don't forget to keep the last one without comma. } addEventHandler("onPlayerChat", root, function(msg) for index, v in ipairs(ads) do if string.find(msg,v) then cancelEvent() banPlayer ( source, false, false, true ) end end end ) Still doesn't work. Not responding Link to comment
Et-win Posted July 17, 2014 Share Posted July 17, 2014 Do you actually typ AD1, AD2, etc. ? Case sensitive Link to comment
Nerses Posted July 17, 2014 Author Share Posted July 17, 2014 Do you actually typ AD1, AD2, etc. ? Case sensitive Cheers, happened. Now how to make that ip address was banning? numbers or what I need to register? Link to comment
Nerses Posted July 17, 2014 Author Share Posted July 17, 2014 the topic is closed, thank you all. Figured out 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