Altitude command not working correctly
#3

This should work, took me about 10 minutes to test and script the function. also based on my research they use GetPlayerPos not GetVehiclePos

pawn Код:
stock GetAltitude(playerid)
{
    new Float:Pos[3], _ReturnAltitude[ 12 ] ;
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    format(_ReturnAltitude, sizeof(_ReturnAltitude), "%.3f", Pos[2]);
    return _ReturnAltitude;
}
Sample of Usage
pawn Код:
CMD:altitude(playerid, params[])
{
    new alt[ 12 ];
    format( alt, sizeof( alt ), "%s", GetAltitude( playerid ) ); //use placeholder %s because we formatted it in GetAltitude
    SendClientMessage( playerid, -1, alt );
    return 1;
}
Result
pawn Код:
[22:49:13] 31.170766 //Helicopter in the roof
[22:49:20] 41.092250 //Increasing Height
[22:49:24] 63.062202 //Increasing Height
[22:49:33] 112.650802 //Increasing Height
[22:49:41] 150.716812 //Height the I've reached, then I descended
[22:49:51] 138.731140 //Descending heigh.
This

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
You need to use something like map andreas otherwise your altitude will never be accurate.
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)