Advertisement
ZumeZero

Float:GetPlayerSpeed

Dec 27th, 2014
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. stock Float:GetPlayerSpeed(playerid)
  2. {
  3.     new Float:velocity[3];
  4.  
  5.     if (IsPlayerInAnyVehicle(playerid))
  6.     GetVehicleVelocity(GetPlayerVehicleID(playerid), velocity[0], velocity[1], velocity[2]);
  7.     else
  8.     GetPlayerVelocity(GetPlayerVehicleID(playerid), velocity[0], velocity[1], velocity[2]);
  9.  
  10.     return floatsqroot((velocity[0] * velocity[0]) + (velocity[1] * velocity[1]) + (velocity[2] * velocity[2])) * 100.0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement