Despo_Rutti Posted October 5, 2008 Posted October 5, 2008 Hi all the world, I'm trying to create a system to inflict damage to the driver and passengers in a collision against a wall. The problem is that I try lots of different techniques but not conclusive. . . If anyone could guide me it would be nice:) I would also ask another question. How could I do to reduce the speed of the car during a clash and the engine stops when major damage. Thank you in advance (Sorry for my English: s)
50p Posted October 5, 2008 Posted October 5, 2008 Take a look here: https://community.multitheftauto.com/index.html?p ... ils&id=113 And to the 2nd question, you'd have to use setElementVelocity to change vehicle's speed and setVehicleEngineState to turn off the engine.
Despo_Rutti Posted October 5, 2008 Author Posted October 5, 2008 Hi, thank you for links. But, when I use setElementVelocity nothing happens. I will try again thank you.
50p Posted October 5, 2008 Posted October 5, 2008 Try to make a simple command that will set vehicle's speed which you are seating in. I'm sure this function works. Also make sure your script has not got any errors, nor warnings.
Despo_Rutti Posted October 5, 2008 Author Posted October 5, 2008 I make this command but she doesn't work function ralentissement(vehicle) local theVehicle = getPlayerOccupiedVehicle ( source ) speedx, speedy, speedz = getElementVelocity ( theVehicle ) if isPlayerInVehicle ( source ) then setElementVelocity ( theVehicle, speedx-10, speedy-10, speedz ) end end addCommandHandler ( "test", ralentissement )
Gamesnert Posted October 5, 2008 Posted October 5, 2008 I make this command but she doesn't work function ralentissement(vehicle) local theVehicle = getPlayerOccupiedVehicle ( source ) speedx, speedy, speedz = getElementVelocity ( theVehicle ) if isPlayerInVehicle ( source ) then setElementVelocity ( theVehicle, speedx-10, speedy-10, speedz ) end end addCommandHandler ( "test", ralentissement ) Does it give errors/warnings, or doesn't it do anything at all?
Winky Posted October 5, 2008 Posted October 5, 2008 You got the wrong parameters for command handlers Server: player playerSource, string commandName, [string arg1, string arg2, ...] Client: string commandName, [string arg1, string arg2, ...]
Gamesnert Posted October 5, 2008 Posted October 5, 2008 You got the wrong parameters for command handlersServer: player playerSource, string commandName, [string arg1, string arg2, ...] Client: string commandName, [string arg1, string arg2, ...] Lol that I didn't see that... And guess what? Using source in command handlers... Remembers me of myself when I started! function ralentissement(player) if isPlayerInVehicle ( player ) then local theVehicle = getPlayerOccupiedVehicle ( player ) local speedx, speedy, speedz = getElementVelocity ( theVehicle ) setElementVelocity ( theVehicle, speedx-10, speedy-10, speedz ) end end addCommandHandler ( "test", ralentissement ) (( Improved version ^^ ))
Despo_Rutti Posted October 5, 2008 Author Posted October 5, 2008 Hi thank you When I try the command, it works but the problem is that it does not change the speed indefinitely (he take position and takes it back in place) I didn't see how to resolve the problem so I still need your help ^ ^ Thank you again ^^
Ace_Gambit Posted October 5, 2008 Posted October 5, 2008 I am not sure what you are trying to say. But setting the velocity is like a pulse. You will have to repeat it if you want continuous velocity changes in a certain direction.
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