Home   Help Search Login Register  

Author Topic: deletevehicle script problem  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline M!StAkE id11479

  • Members
  • *
deletevehicle script problem
« 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?)
« Last Edit: 22 Apr 2009, 14:07:13 by M!StAkE id11479 »

Offline ProfTournesol

  • Members
  • *
  • OFP Addict
Re: deletevehicle script problem
« Reply #1 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.
OFP Napoleonic Mod leader - OFP WW1 Mod leader

Offline M!StAkE id11479

  • Members
  • *
Re: deletevehicle script problem
« Reply #2 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?
« Last Edit: 25 Apr 2009, 15:19:07 by M!StAkE id11479 »