OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: royalman51 on 28 May 2006, 19:32:14

Title: Ending a chopper mission
Post by: royalman51 on 28 May 2006, 19:32:14
Ime making a chopper mission. I want the mission to end when I step out of the heli. How can i make it end ???
Title: Re: Ending a chopper mission
Post by: bedges on 28 May 2006, 19:48:26
create a global variable chopper_boarded in the init file, set to false. set up a trigger, condition player in chopper_name, on activation chopper_boarded = true. then set up your ending trigger, condition this and chopper_boarded and not (player in chopper_name).

so, the player gets into the chopper, the variable switches to say he's in. the end trigger should be covering the ending helipad and will fire only when the player is inside, when the chopper has been boarded and the player is not in the chopper.

that said, if the player boards the chopper, then immediately gets out and runs into the trigger on foot, it will still fire... you sort of have to assume the player will not misbehave. ;)
Title: Re: Ending a chopper mission
Post by: Flauta on 28 May 2006, 21:01:10
well thats the right way to do it.. but you can still doing it at the Fast way.. whit a script..
on any trigger you gant put this

Code: [Select]
[chopper,player] exec "getoutcheck.sqs"
And on teh script
Code: [Select]
#start
;getoutcheck.sqs
_player = _this select 1
_chopp = _this select 0

? ! _player in _chopp : endmissionvarialbe=true
~1
goto "start"

the difference is that you can get out/get in before the script is activated...

if I where U I'll chose the Bedges way =P