Above sea level meter?
#1

Well I'm currently scripting some gauges for aircrafts and I wanted to know how could I make a above sea level gauge in metres, I can make the textdraw myself but I need some function to get it
Reply
#2

pawn Код:
new Float:x, Float:y, Float:z, height[20];
GetPlayerPos(playerid, x, y, z);
format(height, sizeof height, "Height: %i", z);
SendClientMessage(playerid, 0xFFFFFFFF, height);
Just an example
Reply
#3

It's the Z parameter of GetVehiclePos.
Reply
#4

plus, when you are in the sea, the z parameter is equal to zero, so you dont need math
Reply
#5

But If I were you I would make it a text draw instead of a client message...
Reply
#6


Seems like a quite weird number...no?
Heres my current code
pawn Код:
new Float:x, Float:y, Float:z;
GetVehiclePos(vid, x, y, z);
new string[128];format(string,sizeof string,"ASL: %d m",z);
TextDrawSetString(td_asl[i],string);
Reply
#7

its float not int
Reply
#8

pawn Код:
format(string,sizeof string,"ASL: %.2f m",z);
Reply
#9

Yeah nevermind used the wrong format string accidently, fixed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)