dylan4021

vehicle speed

Aug 30th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.66 KB | None | 0 0
  1. stock GetPlayerSpeed(playerid)
  2. {
  3.     if(IsPlayerInAnyVehicle(playerid)) break;
  4.     new Float:ST[4];
  5.     GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  6.     ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
  7.     return floatround(ST[3]);
  8. }
  9.  
  10. stock GetVehicleSpeed(playerid)
  11. {
  12.     if(IsPlayerInAnyVehicle(playerid)) continue;
  13.     new Float:ST[4];
  14.     GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  15.     ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
  16.     return floatround(ST[3]);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment