fastandbulbous Posted September 13, 2014 Share Posted September 13, 2014 Hello everyone. So I have a working script for race mode which I'll put below: function enableCameraThoughCars () setCameraClip (true,false) outputChatBox ("hueta enabled",255,0,0,false) end addEventHandler ("onClientResourceStart",getResourceRootElement(getThisResource()),enableCameraThoughCars) This script disables the camera collision function. But to make it work, I have to restart it through the admin panel every time new round starts. It doesn't really take that much effort, but out of curiosity, how can I make it restart automatically after I change a map or game mode? Please help. Link to comment
Anubhav Posted September 13, 2014 Share Posted September 13, 2014 function enableCameraThoughCars () setCameraClip (true,false) outputChatBox ("hueta enabled",255,0,0,false) end addEventHandler ("onClientResourceStart", root,enableCameraThoughCars) Link to comment
fastandbulbous Posted September 13, 2014 Author Share Posted September 13, 2014 Thanks so much for the prompt response! Working just fine now. Link to comment
'LinKin Posted September 13, 2014 Share Posted September 13, 2014 Well, I tried this: addEventHandler("onClientResourceStart", resourceRoot, function() setCameraClip(false,false) end) And it worked normally... I didn't have troubles when new maps were starting.. What could it be? resourceRoot is a variable representing the current resource ONLY. Right? I didn't have to attach the event to root Link to comment
Saml1er Posted September 13, 2014 Share Posted September 13, 2014 Well, I tried this: addEventHandler("onClientResourceStart", resourceRoot, function() setCameraClip(false,false) end) And it worked normally... I didn't have troubles when new maps were starting.. What could it be? resourceRoot is a variable representing the current resource ONLY. Right? I didn't have to attach the event to root They just don't know how it works. Whenever a resource starts the the event is triggered. I think they don't really care about script performance, they simply wanna make it work. 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