11.12.2010, 01:35
This is a usefull function, what Im gonna give.
It already exists of course, but I found the PERFECT way to have an rp speed, and keep it short+easy
Here it is:
It took me about 5 minutes. I'm not good in all the float stuff (the float functions) so I had to experiment xD.
- Kevin
It already exists of course, but I found the PERFECT way to have an rp speed, and keep it short+easy

Here it is:
pawn Код:
stock GetVehicleSpeed(vehicleid)
{
new Float:v_vX, Float:v_vY, Float:v_vZ, Float:retres;
GetVehicleVelocity(vehicleid, v_vX, v_vY, v_vZ);
retres = floatsqroot(floatabs(floatpower(v_vX + v_vY + v_vZ, 2)));
return floatround(retres * 100, floatround_ceil);
}
- Kevin