Altitude command not working correctly
#1

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.

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);
}
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?
Reply


Messages In This Thread
Altitude command not working correctly - by Finn707 - 03.01.2014, 21:15
Re: Altitude command not working correctly - by Brentbad04 - 03.01.2014, 21:36
Re: Altitude command not working correctly - by Patrick - 03.01.2014, 21:43
Re: Altitude command not working correctly - by Pottus - 03.01.2014, 22:05
Re: Altitude command not working correctly - by Finn707 - 03.01.2014, 22:31

Forum Jump:


Users browsing this thread: 2 Guest(s)