boro Posted May 22, 2013 Share Posted May 22, 2013 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
DakiLLa Posted May 22, 2013 Share Posted May 22, 2013 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
Schlammy Posted May 22, 2013 Share Posted May 22, 2013 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
Schlammy Posted May 22, 2013 Share Posted May 22, 2013 Don`t forget @DakiLLa: he also had the same answer just with variables Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now