VenomOG Posted February 9, 2018 Posted February 9, 2018 setTimer( function() --restarting this resource every hour restartResource(getThisResource(DrugDealer)) end, 3600000, 0) IT dosn't restarts and not in 24h, HELP
NeXuS™ Posted February 9, 2018 Posted February 9, 2018 (edited) Do you want to restart it after 24 hrs of startup or at 00:00? Edited February 9, 2018 by NeXuS™ Did I help you? NeXuS™#0001
ÆBKV Posted February 9, 2018 Posted February 9, 2018 function resRes() local resource = getResourceFromName("DrugDealer") if getResourceState(resource) == "running" then restartResource(resource) end end setTimer(resRes,86400000,0) 1
ÆBKV Posted February 9, 2018 Posted February 9, 2018 (edited) function resRes() local resource = getThisResource() if getResourceState(resource) == "running" then restartResource(resource) end end setTimer(resRes,86400000,0) Add this to the script on server-side. It‘s better because you don‘t have to edit it if you rename the resource. Edited February 9, 2018 by ÆBKV 1
Moderators IIYAMA Posted February 9, 2018 Moderators Posted February 9, 2018 Don't forget to give the resource admin rights. 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