itHyperoX Posted September 30, 2017 Share Posted September 30, 2017 Hello, how can i make that, the script is showing me only that resource which is loaded as last? I tried addCommandHandler("refreshres",function(source) if tonumber(getElementData(source, "player.getAdminLevel")) >= 5 then local resources = getResources() for i,v in ipairs(resources) do if getResourceState(v) == "loaded" then outputChatBox("#D32F2F"..tostring(getResourceName(v)), source, 0, 255, 0, true) end end refreshResources(true) outputChatBox("Successfully refreshed.", source, 255, 255,255,true) end end) But its keep showing me the old resoruces. Link to comment
Moderators IIYAMA Posted September 30, 2017 Moderators Share Posted September 30, 2017 Refresh the resources before you show the state of the resources. You might want to consider add a timer between the two actions. (refresh and show states) Try to give the resources the right to use the function refreshResources. (not sure if that is required for this function, but I think it is) 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