OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Iva on 08 Nov 2003, 09:33:04
-
I was wondering how could i make script so my plane vould show Altitude on hud like
DKM mi-28. I dont know how i could separate numbers so i could set textures e.g.
if altitude is 179
i would have 1
7
9
so i could easely make
_plane setobjecttexture [1, format ["\Bla\Bla\%1.paa" _num select 0]
-
Not sure if this is what you want, but to break the number 179 up into units. Then something like this would work, there will be better ways, but in the mean time:
_Tens=179 Mod 100
_Hundreds=(179-_Tens) / 100
_Ones=(_Tens Mod 1)
_Tens=(_Tens-_Ones) / 10
_Ones=(_Ones-(_Ones Mod 1)) / 1
If it's altitude, then you will want to include thousands e.t.c.
Anyway hope this helps.
-
Thanks but i have made it my self.