Hadif Posted July 24, 2015 Share Posted July 24, 2015 Script: function theLocator() local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} local theLocation = getElementZoneName(source, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == allLocation) then killPed(source) end end end function checkLocation() setTimer(theLocator(source), 0, 0) end addEventHandler("onPlayerSpawn", getRootElement(), checkLocation) Result: Bad argument @ 'setTimer' [Expected function at argument 1, got nil] Link to comment
LabiVila Posted July 24, 2015 Share Posted July 24, 2015 setTimer ( function () theLocator () end, 0, 0 ) Link to comment
Perfect Posted July 24, 2015 Share Posted July 24, 2015 setTimer ( function () theLocator () end, 0, 0 ) You don't need to add a function statement for function inside a timer and also you don't need to add even parenthesis of a function inside a timer. If the function has arguments then you can declare them later. @ You are assigning an argument to an argumentless function. function checkLocation() setTimer(theLocator(source), 0, 0) -- There are no arguments in theLocator end This should probably work: setTimer(theLocator, 0, 0) Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 setTimer ( function () theLocator () end, 0, 0 ) You don't need to add a function statement for function inside a timer and also you don't need to add even parenthesis of a function inside a timer. If the function has arguments then you can declare them later. @ You are assigning an argument to an argumentless function. function checkLocation() setTimer(theLocator(source), 0, 0) -- There are no arguments in theLocator end This should probably work: setTimer(theLocator, 0, 0) Thanks! Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 setTimer ( function () theLocator () end, 0, 0 ) You don't need to add a function statement for function inside a timer and also you don't need to add even parenthesis of a function inside a timer. If the function has arguments then you can declare them later. @ You are assigning an argument to an argumentless function. function checkLocation() setTimer(theLocator(source), 0, 0) -- There are no arguments in theLocator end This should probably work: setTimer(theLocator, 0, 0) ]STILL NOT WORKING![/color] Link to comment
LabiVila Posted July 24, 2015 Share Posted July 24, 2015 The problem isn't at timer then, can you post all the script you have and show us what debugscript says? Link to comment
GTX Posted July 24, 2015 Share Posted July 24, 2015 How much topics did you make? 5? God... viewtopic.php?f=91&t=90459#p813030 Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 How much topics did you make? 5? God...viewtopic.php?f=91&t=90459#p813030 LoL ... I really need this bro T_T Link to comment
Hadif Posted July 24, 2015 Author Share Posted July 24, 2015 The problem isn't at timer then, can you post all the script you have and show us what debugscript says? I think the problem is at the element(player) ...but I still didnt find the answer Link to comment
GTX Posted July 25, 2015 Share Posted July 25, 2015 Oh my god. Stop making new topics about the same problem! local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} function theLocator() for i, v in ipairs(getElementsByType"player") do local theLocation = getElementZoneName(v, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == theKey) then killPed(v) end end end end setTimer(theLocator, 50, 0) Link to comment
Hadif Posted July 26, 2015 Author Share Posted July 26, 2015 Oh my god. Stop making new topics about the same problem! local allLocation = {"Las Venturas", "San Fierro", "Whetstone", "Flint County", "Red County", "Los Santos"} function theLocator() for i, v in ipairs(getElementsByType"player") do local theLocation = getElementZoneName(v, true) for theKey, allLocation in pairs(allLocation) do if (theLocation == theKey) then killPed(v) end end end end setTimer(theLocator, 50, 0) Ok sir, no more! Coz I already hv the solution. 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