OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: M!StAkE id11479 on 22 Apr 2009, 14:04:12

Title: deletevehicle script problem
Post by: M!StAkE id11479 on 22 Apr 2009, 14:04:12
Hi guys,
im creating a new mp missions and i duplicated an eject script from another mp mission, all work fine apart the part where the choppers have to be deleteds, it work well in the original mission then i dont stand why it dont with mine...

--------------------------------------------------

;?!(local Server):exit

;initialisation
_units = (units grp3) + (units grp4)
_nbUnits = count _units

#eject
_soldier = (_units select _nbUnits)
unassignVehicle _soldier
_soldier action ["eject", vehicle _soldier]
_nbUnits = _nbUnits-1
~0.3
if (_nbUnits mod 2==0) then {goto "suite"}
~0.3
#suite
?_nbUnits>=0:goto "eject"

~60

?!(local driver ch2):deleteVehicle driver ch2
?!(local gunner ch2):deleteVehicle gunner ch2
?!(local ch2):deleteVehicle ch2

exit

---------------------------------------------------

Only the end of the script dont work  :dunno:
What's wrong?? (i try it in editor and i realize only now that maybe it work well only in mp?)
Title: Re: deletevehicle script problem
Post by: ProfTournesol on 22 Apr 2009, 17:06:02
True, in SP every objects are local, so
Code: [Select]
?!(local ch2):deleteVehicle ch2Cannot work cause ch2 is local.
Title: Re: deletevehicle script problem
Post by: M!StAkE id11479 on 22 Apr 2009, 20:07:27
I looked in the original version and finally the plane is not deleted after the 60 seconds!
Then this scripts had the bug originally, i have duplicated it...
How does for have the vehicle deleted then? what i have to write in place? (the eject script is perfect, i use it with chinooks and it work well, as the script is writted for multi i hope i can keep the part of the deleted vehicles)
Thanks for your time prof  :D

"True, in SP every objects are local, so" oops iv not read it! Ill try now.
ok, i tried and same in mp it dont work, do you mean that it work only if "local" is a server?