Jump to content

Can anyone create a resource?


Recommended Posts

sorry... i cant speak very well english... ;)

so... i want to make a script that stop a resource (or more than one) every "x" minutes (for example every 10 minutes)

and that start it after "x" minutes (for example 20 minutes)

so all the resources are not always running toghether and when a resource starts another resource stops...

to reduce the lag... :)

but the script must not stop a random resource, it must stop a resource from a list of names..

if you want to make it, you can also upload it in the community :)

Link to comment
myResources = {"admin", "scoreboard", "killmessages"} 
  
function stopResources() 
for i,v in pairs(myResources) do 
local resource = getResourceFromName(tostring(v)) 
if ( getResourceState(resource) == "running" ) and ( resource ~= getThisResource() ) then 
stopResource(resource) 
       end 
    end 
end 
addCommandHandler("stopresources",stopResources) 

Do you mean that?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...