Jump to content
Sign in to follow this  
profcupcake

Disable control of a vehicle?

Recommended Posts

I am writing a script (guess which) that requires a driver of a vehicle (or gunner or commander) to not be able to control their vehicle for a while. I have looked through what I know and the various places I can actually find info on this, and I could not find a proper method. So, anyone happen to know a way to temporarily disable vehicle controls?

Share this post


Link to post
Share on other sites

Never tried it, but I guess giving remoteControl to an AI would override your own controls.

someAIunit remoteControl driver somevehicle;

Worth a try. :)

Share this post


Link to post
Share on other sites

You could always use: _veh enableSimulation false/true to freeze and unfreeze the vehicle, but you wouldn't be able to exit the vehicle, access the inventory or use any of its functions. But if that's what you intend, it could work.

I also have a script that I call Vehicle Swatter that, when using a set of linear triggers to define a boundary, removes the fuel from a vehicle, sets velocity to 0,0,0, turns off the engine and then de-spawns the vehicle 5 seconds later once it has come to a complete stop to keep trolls from running over everyone in spawn/protected areas. I'm gonna add some code eventually that would instead get its current direction and make the vehicle do an about face, thereby bouncing it back the way it came, once I figure out how to get it to work properly.

Share this post


Link to post
Share on other sites

I think you already know that but you can also do a disableUserInputs if it is a quick lose of control

Share this post


Link to post
Share on other sites
You could always use: _veh enableSimulation false/true to freeze and unfreeze the vehicle, but you wouldn't be able to exit the vehicle, access the inventory or use any of its functions. But if that's what you intend, it could work.

I also have a script that I call Vehicle Swatter that, when using a set of linear triggers to define a boundary, removes the fuel from a vehicle, sets velocity to 0,0,0, turns off the engine and then de-spawns the vehicle 5 seconds later once it has come to a complete stop to keep trolls from running over everyone in spawn/protected areas. I'm gonna add some code eventually that would instead get its current direction and make the vehicle do an about face, thereby bouncing it back the way it came, once I figure out how to get it to work properly.

I don't want to stop the vehicle, just remove the driver/gunner/commander's control of it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×