Jump to content

[help] start/stopresource


boro

Recommended Posts

please help i made resource for start and stop resource but log write this

[2013-04-26 11:27:27] WARNING: newskin\server.lua:12: Bad argument @ 'startResource'

[2013-04-26 11:27:27] WARNING: newskin\server.lua:13: Bad argument @ 'stopResource'

Chatbox work fine

server side

function startingHandler (  ) 
outputChatBox ( "Test Start", getRootElement(), 255, 255, 255, true ) 
            startResource(skin2) 
            stopResource(skin1) 
end 
addEvent( "onStarting", true ) 
addEventHandler( "onStarting", getRootElement(), startingHandler ) 
  
  
function stopingHandler (  ) 
outputChatBox ( "Test Stop", getRootElement(), 255, 255, 255, true ) 
            startResource(skin1) 
            stopResource(skin2) 
end 
addEvent( "onStoping", true ) 
addEventHandler( "onStoping", getRootElement(), stopingHandler ) 

Link to comment

If I understodd correctly, try to add below code to the top of your script:

local skin1 = getResourceFromName( "skin1" ) 
local skin2 = getResourceFromName( "skin2" ) 

Also keep in mind, that start(stop)Resource function(s) require ACL rights.

Link to comment
  
function startingHandler (  ) 
    outputChatBox ( "Test Start", getRootElement(), 255, 255, 255, true ) 
                startResource(getResourceFromName( "skin2" )) 
                stopResource(getResourceFromName( "skin1" )) 
    end 
    addEvent( "onStarting", true ) 
    addEventHandler( "onStarting", getRootElement(), startingHandler ) 
      
      
    function stopingHandler (  ) 
    outputChatBox ( "Test Stop", getRootElement(), 255, 255, 255, true ) 
                startResource(getResourceFromName( "skin1" )) 
                stopResource(getResourceFromName( "skin2" )) 
    end 
    addEvent( "onStoping", true ) 
    addEventHandler( "onStoping", getRootElement(), stopingHandler ) 
  

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