Quote:
Originally Posted by SickAttack
Your calculations is way off. Try this:
pawn Код:
new Float:pos[3], Float:speed, speed_int; GetVehicleVelocity(GetPlayerVehicleID(playerid), pos[0], pos[1], pos[2]); speed = floatsqroot(((pos[0] * pos[0]) + (pos[1] * pos[1])) + (pos[2] * pos[2])) * 181.1166672; speed_int = floatround(speed, floatround_round);
|
How would that affect my issue? Plus, 181.1166672 makes the speed look very unrealistic.
EDIT: I fixed it by changing the "if(final_speed_int > 0)" line to:
pawn Код:
if(final_speed_int == 0) return SendClientMessage(playerid, COLOR_YELLOW, "(RADAR) No vehicles in range.");