reduce speed
#1

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?
Reply
#2

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);
Reply
#3

You can also just get his position and set it. That way it would be like he was stunned. Keep in mind that while these might seem like a good idea its also bad one since some weapons fire very quickly and player might not be able to move at all.
Reply
#4

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
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);
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)