OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started 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
-
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
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"
-
You should alter the code a little so that players have to listen to some Muzak while queued! :whistle:
-
Thanks fellas, knew I could always count on you for support.. just as generous as you used to be :good:
-
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?