05.05.2017, 19:32
Hi, I want to make it like that when a player gets shot it reduces his speed a little, but I don't know how to do that because it needs some maths I haven't learned yet. How do I do that?
Hey. It's very simple.
When a player shoot, check if the player shot a vehicle. Take the velocity of the vehicle (https://sampwiki.blast.hk/wiki/GetVehicleVelocity) and reduce x & y velocity by the wanted slow. 20% of the vitesse will be 1-0.2 = 0.8 of the vehicle's velocity : SetPlayerVelocity(x * 0.8, y * 0.8, z); |