OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: HuNtA on 31 Aug 2006, 14:28:24

Title: Respawning in plane and then a HALO script from there
Post by: HuNtA on 31 Aug 2006, 14:28:24
Well, hello there. I've came here to ask a couple of questions, hopefully you'll be able to lend a hand (bit rusty at the ol' scripting after not playing OFP for a few years)

For my latest MP mission, i've got to make it so when the player dies, they firstly respawn, and are moveincargo'ed into a plane. I can easily see how that works, something like

@!alive _thebloke
@alive _thebloke
_thebloke moveInCargo haloplane


The problem I have from there, though, is twofold:
What do I do if the planes cargo spots are full at the time? I need something like a 'que' system, and
For the HALO part, I can't work out how to make it so the player leaves the plane without 'ejecting'. I remember how to do it in the past, but its slipped my mind since then.


Also, for quick clarity, the HALO script itself would be something like (don't bother correcting me on classnames)

*the bit where they leave the plane*
~5
_parachute = "parachute" createvehicle getpos _thebloke
_thebloke moveInDriver _parachute
exit
Title: Re: Respawning in plane and then a HALO script from there
Post by: Terox on 31 Aug 2006, 22:19:06
dont have time to write the script for ya going off for the weekend in a few hours
but

1) use a killed event handler attached to the player and then in the script that it runs
_veh is the plane you want them moved into

do something like the following


Quote
player removeall eventhandlers "killed"
@ alive player
player addeventhandler ["killed", blah blah blah]
?(alive _veh):player moveincargo _veh
@ (_time > 5) or (Player in crew _veh)
?! (alive _veh):exit
? (_time >=5): goto "QUEUE"
_para = "parachuteW" createvehicle (getpos player)
@ ! isnull _para
player moveindriver _para
exit


#QUEUE
_now = _time
player moveincargo _veh
@ (_time > (_now + 3)) or (Player in crew _veh)
?! (alive _veh) or (Player in crew _veh):exit
goto "QUEUE"






Title: Re: Respawning in plane and then a HALO script from there
Post by: Mr.Peanut on 01 Sep 2006, 15:33:50
You should alter the code a little so that players have to listen to some Muzak while queued!  :whistle:
Title: Re: Respawning in plane and then a HALO script from there
Post by: DaveP on 02 Sep 2006, 20:39:27
Thanks fellas, knew I could always count on you for support.. just as generous as you used to be  :good:
Title: Re: Respawning in plane and then a HALO script from there
Post by: rhysduk on 04 Sep 2006, 21:06:18
I had this idea before but for a singleplayer. Anway, are you going to have the plane continually circle overhead? Or makeit Land, Takeoff, Land Takeoff etc?