03.01.2014, 21:43
(
Последний раз редактировалось Patrick; 03.01.2014 в 22:28.
)
This should work, took me about 10 minutes to test and script the function. also based on my research they use GetPlayerPos not GetVehiclePos
Sample of Usage
Result
This
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;
}
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;
}
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.