toxicsmoke11 Posted July 15, 2014 Posted July 15, 2014 function securityCheck(thePlayer) setTimer(function() -- line 2 local sPlayer = getElementsByType("player") for i,v in ipairs(sPlayer) do if getPedOccupiedVehicle(thePlayer) == "425" then kickPlayer(thePlayer,"h4x0r hunter") else outputDebugString("nobody broke a vehicle rule") end end end end,10000,0) -- line 12 ) expected near line 12(at word 'end') to close line 2?what the fuck? its already closed why doesnt this work?help pls
Moderators IIYAMA Posted July 15, 2014 Moderators Posted July 15, 2014 function securityCheck() setTimer(function() -- line 2 local sPlayer = getElementsByType("player") local ruleCheck = false for i,thePlayer in ipairs(sPlayer) do if getPedOccupiedVehicle(thePlayer) == "425" then kickPlayer(thePlayer,"h4x0r hunter") ruleCheck = true end end if not ruleCheck then outputDebugString("nobody broke a vehicle rule") end end,10000,0) -- line 12 end securityCheck() you messed up with the ) and end. They are not the same. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
toxicsmoke11 Posted July 15, 2014 Author Posted July 15, 2014 i gave myself a hunter and it outputted nobody broke vehicle rule its not working
Et-win Posted July 15, 2014 Posted July 15, 2014 if getElementModel(getPedOccupiedVehicle(thePlayer)) == 425 then It supports an model ID by 'int', not by string, also check it's model, now you were only checking which vehicle 'data' it was. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Moderators IIYAMA Posted July 16, 2014 Moderators Posted July 16, 2014 np. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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