01.03.2012, 19:21
Paste it on top of the script:
pawn Код:
stock Float:GetPlayerSpeed(playerid, bool:KMH)
{
new Float:Speed, Float:vX, Float:vY, Float:vZ;
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerVelocity(playerid, vX, vY, vZ);
else GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
Speed = floatsqroot(((vX*vX)+(vY*vY))+(vZ*vZ));
return KMH ? (Speed*100.0) : (Speed*62.1371);
}