Adolf_T Posted March 2, 2017 Share Posted March 2, 2017 Alright so I'm trying to make vehicles more deadly. When a player or bot get hit by a vehicle I don't want the vehicle to bounce away but the player to fall 100% of the times (just by a simple touch) and then in some realistic sense loose health depending on the collision force. What function would you recommend? Are any of these properties useful for my needs? I'm thinking of collisionDamageMultiplier and onVehicleCollission for instance, would those be a good approach? have anyone done anything like this before? Link to comment
Mr.Loki Posted March 2, 2017 Share Posted March 2, 2017 Yup i've done this already all you have to do is onClientPlayerDamage check if its a vehicle with the damage types then setPedAnimation and setElementHealth. You might want to multiply the damage based on the vehicle's speed so you can use getElementSpeed. 1 Link to comment
Adolf_T Posted March 4, 2017 Author Share Posted March 4, 2017 Tanks, it's almost perfect now, getElementSpeed helped a lot but I'm also using the mass. One last question tho, I'm using the event onClientVehicleCollision which sometimes triggers multiple times in a row, I can't block it's next execution with a simple timer or even by storing tick count in a variable, it still executes multiple times, any ideas how to solve that? Link to comment
Mr.Loki Posted March 4, 2017 Share Posted March 4, 2017 That's because its triggered by everyone who streamed in the vehicle. Only trigger the event from the driver or the collided element. It's best to choose the latter if the collided element is a player. 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