Jump to content

automatically restart


Estevam2d

Recommended Posts

function restartAllResources() 
    local allResources = getResources() 
    for index, res in ipairs(allResources) do 
        if getResourceState(res) == "JOBpl" then 
            restartResource(res) 
        end 
    end 
end 
addCommandHandler( "pl", restartAllResources ) 

how can I put a time to start and stop automatically activated without charge?

I think this script is wrong.

Link to comment

Try this:

setTimer(function () 
    local allResources = getResources() 
    for index, res in ipairs(allResources) do 
        if getResourceState(res) == "JOBpl" then 
            restartResource(res) 
        end 
    end 
    end,60000,0) 

It will restart the resources after one minute.

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...