03.01.2014, 21:15
Hello,
I've just created a fairly simple /getaltitude command just for testing the altitude stock before I develop it into a proper, updating altitude meter that works in helicopters and planes.
It works when I'm on an NRG for example, it works fine then, but when I get into a helicopter and fly up a bit, it definitely displays my Z position wrong.
Can anyone see any errors in the above code, or know why it's not working?
I've just created a fairly simple /getaltitude command just for testing the altitude stock before I develop it into a proper, updating altitude meter that works in helicopters and planes.
pawn Код:
CMD:altitude(playerid, params[])
{
new alt[2];
format(alt, sizeof(alt), "%d", GetAltitude(playerid));
SendClientMessage(playerid, Col_Blue, alt);
return 1;
}
stock GetAltitude(playerid)
{
new Float:x, Float:y, Float:z, currentvehicle;
currentvehicle = GetPlayerVehicleID(playerid);
GetVehiclePos(currentvehicle, x, y, z);
return floatround(z);
}
Can anyone see any errors in the above code, or know why it's not working?