Advertisement
Guest User

GetPlayerSpeed and GetVehicleSpeed functions

a guest
Nov 10th, 2010
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.61 KB | None | 0 0
  1. stock GetVehicleSpeed(vehicleid)
  2. {
  3.     if(vehicleid != INVALID_VEHICLE_ID)
  4.     {
  5.         new Float:Pos[3],Float:VS ;
  6.         GetVehicleVelocity(vehicleid, Pos[0], Pos[1], Pos[2]);
  7.         VS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
  8.         return floatround(VS,floatround_round);
  9.     }
  10.     return INVALID_VEHICLE_ID;
  11. }
  12. stock GetPlayerSpeed(playerid)
  13. {
  14.     if(playerid != INVALID_PLAYER_ID)
  15.     {
  16.         new Float:Pos[3],Float:PS;
  17.         GetPlayerVelocity(playerid, Pos[0], Pos[1], Pos[2]);
  18.         PS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
  19.         return floatround(PS,floatround_round);
  20.     }
  21.     return INVALID_PLAYER_ID;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement