Jump to content

MySQL and Restart.


#DaMiAnO

Recommended Posts

MySQL:

  
function connectToMySQL() 
    mysql = dbConnect("mysql", "dbname=test", "host=localhost", "root", "") 
    outputServerLog("[MySQL] Connected!\n") 
     
    if(mysql ~= nil) then 
        outputServerLog("[MySQL] Disconnected...\n") 
        destroyElement(mysql) 
    end 
end 
  

This not working. outputServerLog isnt showing.

Restart:

  
function restartServer() 
    local hour, mins = getTime() 
    local allResources = getResources() 
    if(hour == 12) and (mins == 00) then 
        for index, res in ipairs(allResources) do 
            if getResourceState(res) == "running" then 
            restartResource(res) 
            outputDebugString("GameMode restarted!", 3, 0, 224, 0) 
            end 
        end 
    end 
end 
setTimer(restartServer, 3600000, 1, source) 
  

This not working. Resources arent restatred.

Link to comment

MySQL:

  
mysql = dbConnect("mysql", "dbname=test", "host=localhost", "root", "") 
outputServerLog("[MySQL] Connected!\n") 
  
if(mysql ~= nil) then 
    outputServerLog("[MySQL] Disconnected...\n") 
    destroyElement(mysql) 
end 
  

Restart:

  
function restartServer() 
    local hour, mins = getTime() 
    local allResources = getResources() 
    if(hour == 12) and (mins == 00) then 
        for index, res in ipairs(allResources) do 
            if getResourceState(res) == "running" then 
            restartResource(res) 
            outputDebugString("GameMode restarted!", 3, 0, 224, 0) 
            end 
        end 
    end 
end 
setTimer(restartServer, 1000, 0) 
  

Link to comment

ex

  
<group name="mysql"> 
    <acl name="mysqlACL"></acl> 
    <object name="resource.yourresourcename"></object> 
</group> 
<acl name="mysqlACL"> 
    <right name="function.restartResource" access="true"></right> 
</acl> 
  

Updated.

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