show altitude in feet instead of meters?
#1

topic^? (8Char)
Reply
#2

1 meter = 3.2808399 feet
Just multiply the altitude by 3.2808399 to get it in feet
Reply
#3

huh example please?
Reply
#4

llike this?
pawn Код:
if(floatround(Z)) > 0)
                {
                    Z2=Z*3.2808399;
                }
sorry for double post.. accidentally didnt edit
Reply
#5

Try...

pawn Код:
Z2=floatround(floatmul(Z, 3.2808399));
... maybe.
Reply
#6

pawn Код:
#define METRES_TO_FEET(%0) \
    ( ( %0 ) / 0.3047999995367040007042099189296 )
new
    altitude = floatround( METRES_TO_FEET( 500 ) );
Reply
#7

doesnt work

both shows 0 all the time
Reply
#8

It worked fine for me in this test, not to mention I use that in my script for altitude as well.

http://pastebin.com/D4RAJj6X
Reply
#9

did i use it wrong?

pawn Код:
new altitude = floatround( METRES_TO_FEET( Z) );
                format(String,sizeof(String)," ~r~Vehicle~g~:~w~%s ~r~Health~g~:~w~%d%% ~r~MPH~g~:~w~%i ~r~KMH~g~:~w~%i ~r~Altitude~g~:~w~%d ft",aVehicleNames[GetVehicleModel(vehicle)-400],floatround(health,floatround_round), floatround(floatdiv(Speed, 1.609344), floatround_floor), floatround(Speed, floatround_floor),altitude);
Reply
#10

I use it something like this

pawn Код:
new
    Float:vx,
    Float:vy,
    Float:vz;
GetVehiclePos( vehicle, vx, vy, vz );
format( String, sizeof ( String ), " ~r~Vehicle~g~:~w~%s ~r~Health~g~:~w~%i%% ~r~MPH~g~:~w~%i ~r~KMH~g~:~w~%i ~r~Altitude~g~:~w~%i ft", aVehicleNames[ GetVehicleModel( vehicle ) - 400 ], floatround( health, floatround_round ), floatround( floatdiv( Speed, 1.609344 ), floatround_floor ), floatround( Speed, floatround_floor ), floatround ( METRES_TO_FEET( vz ) ) );
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)