How to get a realistic speed?
#1

Is there a function that will return to me a realistic speed? I have the following one, but it seems like 50mph is reached too fast.

pawn Код:
stock GetPlayerSpeed(playerid, bool:kmh)
{
  new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
  if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
  rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
  return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)