AGENT_STEELMEAT Posted November 16, 2011 Share Posted November 16, 2011 Well, why are you restarting anything? Link to comment
^Dev-PoinT^ Posted November 16, 2011 Share Posted November 16, 2011 what abuout this ? function restartAllResources() -- we store a table of resources local allResources = getResources() -- for each one of them, for index, res in ipairs(allResources) do -- if it's running, if getResourceState(res) == "running" then -- then restart it restartResource(res) end end end Link to comment
TAPL Posted November 16, 2011 Share Posted November 16, 2011 hahaha Dev Point https://wiki.multitheftauto.com/wiki/RestartResource did you read this? viewtopic.php?f=91&t=37107#p382031 Link to comment
mrvicio Posted November 16, 2011 Author Share Posted November 16, 2011 Thanks! John_Michael I had not thought of only add the colum calling the scoreboard, is has improve efficiency, now only left the element that i must attach to the handler remeber, the element below dont work getResourceRootElement(getResourceFromName("scoreboard")-- <<<---Dont work it dont get launched Link to comment
Jaysds1 Posted November 16, 2011 Share Posted November 16, 2011 What's the scoreboard resource folder name??? Link to comment
AGENT_STEELMEAT Posted November 16, 2011 Share Posted November 16, 2011 mrvicio, there is a missing ')' in that piece of code. Also, you might not have the correct name of the resource down. Link to comment
mrvicio Posted November 17, 2011 Author Share Posted November 17, 2011 let me explain better Event handlers have 3 variables addEventHandler(var1,var2,var3) ok? var1 is the name of the event var3, YES VAR3! is the name of the function to execute when the event is triggered and var2, is the element that the eventHandler must be attached, and the event only will trigger the fuction when the event occurs on the element attached, in this case "var2", or childs of var2(attachedElement). im just looking the element that i must attach to my EventHandler in this case var3, but in My case, something related to the elementResourceScoreboard because lot of peoples recomend me to use the element "getResourceRootElement(getResourceFromName("scoreboard"))" i tried the line below addEventHandler("onResourceStart",getResourceRootElement(getResourceFromName("scoreboard")),nameOfMyFunction) but it dont work, because of that, i said that the element "getResourceRootElement(getResourceFromName("scoreboard"))" dont work in my EventHandler any doubt? Link to comment
AGENT_STEELMEAT Posted November 17, 2011 Share Posted November 17, 2011 Have you even tried debugging the script? I tested it myself and it works fine. Link to comment
mrvicio Posted November 18, 2011 Author Share Posted November 18, 2011 not for me friend well i will try a few more things and im done with this. Thanks to all who has helped me. Thanks!! 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