Jump to content

Problem Startresource


WASSIm.

Recommended Posts

Posted

hi guys i have problem to startResource. if stop this resource all resources in table stop.

local ZAResources = {   
    ["ZO-spawn"]=true, 
    ["ZA-gang"]=true, 
    ["ZA-level"]=true, 
    ["ZA-misc"]=true, 
    ["ZA-zombies"]=true, 
    ["ZA-dxhelp"]=true, 
    ["ZA-bosses"]=true, 
    ["ZA-headlook"]=true, 
    ["ZA-superman"]=true, 
    ["ZA-Anti"]=true, 
    ["ZA-damage"]=true, 
    ["ZA-texture"]=true, 
    ["ZA-blips"]=true, 
    ["ZA-radar"]=true, 
    ["ZA-staff"]=true, 
    ["ZA-hud"]=true, 
    ["ZA-vehicles"]=true, 
    ["ZA-zones"]=true, 
    ["ZA-interiors"]=true, 
    ["ZA-gates"]=true, 
    ["ZA-weapon-stid"]=true, 
    ["ZA-warroom"]=true, 
    ["ZA-Mods"]=true, 
    ["ZA-heligrab"]=true, 
    ["ZA-down"]=true, 
    ["ZA-login"]=true, 
    ["ZA-save"]=true, 
    ["ZA-respawn"]=true, 
    ["ZA-chat"]=true, 
    ["ZA-LaserPointer"]=true, 
    ["ZA-Glue"]=true, 
    ["ZA-maps"]=true, 
    ["ZA-tags"]=true, 
    ["ZA-setting"]=true, 
    ["ZA-info"]=true, 
    ["ZA-ban"]=true  
 } 
  
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
    function( ) 
        for i, resources in ipairs(getResources()) do 
            if ( ZAResources[getResourceName(resources)] ) then 
                local resourceName = getResourceName(resources) 
                local start = startResource ( resources ) 
                if ( start ) then 
                    outputDebugString ( resourceName.." was started successfully." ) 
                else 
                    outputDebugString ( resourceName.." Failed to Started.", 1 ) 
                end 
            end 
        end 
    end 
) 

Posted

I'm a noob but maybe @ this;

addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), 
    function( ) 
        for i, resources in ipairs(getResources()) do 
            if ( ZAResources[getResourceName(resources)] ) then 
                local resourceName = getResourceName(resources) 
                local start = startResource ( resources ) 
                if ( start ) then 
                    outputDebugString ( resourceName.." was started successfully." ) 
                else 
                    outputDebugString ( resourceName.." Failed to Started.", 1 ) 
                end 
            end 
        end 
    end 
) 

Normally if you stop the resource they should still run.

Posted

It's because that this resource is the thing 'element' that started these resources

and when it stops unfortunately all other resources(which got started by this resource) will stop since this resource started them from the beginning

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