"takeoff.sqs"
? p1 distance baselz > 1000 : goto "exit1"
goto "go1"
#go1
lz setpos [getpos p1 select 0, getpos p1 select 1, (getpos p1 select 2) + 0]
helo1 sidechat "Roger, UH60 evac on the way, hang in there."
helo1 setfuel 1
helo1 flyinheight 100
helo1 domove getpos lz
helo1 setspeedmode "FULL"
goto "smokedtct"
#smokedtct
? helo1 distance lz < 600 : goto "smoke1"
~0.5
goto "smokedtct"
#smoke1
Smoker1 = "SmokeShell" camcreate [getpos lz select 0, getpos lz select 1, (getpos lz select 2) + 4]
goto "loop"
#loop
? helo1 distance lz < 300 : goto "land"
~0.5
goto "loop"
#land
helo1 setspeedmode "LIMITED"
helo1 land "land"
_height = getpos helo1 select 2
? _height < 1 : goto "end"
~0.5
goto "land"
#end
helo1 flyinheight 0
helo1 sidechat "UH60 ready for evac, jump in!"
exit
#exit1
helo1 sidechat "Negative, you are 1km close to the base, you can walk.."
exit
This is a dynamic helo extraction script witch I modified for my needs.
"P1" is the player.
"lz" is an invisible H.
"baselz" is an H located at the base.
"UH60" is the chopper.
Now, what happens (or atlast is supposed to)??
1- "P1" calls "takeoff.sqs" via radio.
2- "takeoff.sqs" checks if "P1" is nearer than 1km to baselz,
if he is to near the negative message appears and the script exits.
3- If "P1" is farther away than 1km the script proceeds and the invisible H called "lz" moves to "P1"s position,
serving as landing objective for "UH60".
4- Once "UH60" is 600 meters away from "P1",
a smoke pops up on the landing spot ("lz").
5- "UH60" lands and "P1" boards the chopper,
once "P1" is ready for evacuation he can call in the "returntobase.sqs".
All this just to make you understand what my script should do.
Now what's the problem?
Problem is that the chopper ("UH60") takes off also if "P1" is lesser than 1km away from the base ("baselz")..
distance check doesnt work, dont know why... I'm no scripting ace.. thats why I ask here, plz help :-\