06.02.2012, 13:30
Hi, I've got this GetPlayerSpeed function from the forums.
I have a little problem, it always returns 0.
What is wrong with it?
Код:
stock GetPlayerSpeed(playerid) { new Float:ST[4]; if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]); else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]); ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625; return floatround(ST[3]); }
What is wrong with it?