Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: removing dead bodies works ONCE  (Read 2686 times)

0 Members and 1 Guest are viewing this topic.

Offline singhman

  • Members
  • *
removing dead bodies works ONCE
« on: 06 Nov 2007, 19:04:14 »
Hi guys
I've read several posts regarding the killed eventhandler and have incorporated it into my multiplayer mission

it only seems to work ONCE?!

the body gets deleted on all computers as required but then after the unit dies again, the bodies refuse to disappear
I have no idea how to fix this
I'm currently using this in my unit init lines:

this addeventhandler ["killed", {_this exec "deadbody.sqs"}]

and then deadbody.sqs:

; Select the Unit
_unit = _this select 0
;-Delay the delete after death
~6
; finally delete the vehicle
deletevehicle _unit
~1
exit

Is there any way to get this working again and again? I haven't seen anyone with my problem on the forum.
Oh and btw, the dead body does not disappear even on the computer controlling the unit that started the deadbody.sqs.

Sorry if I've made a mistake posting - this is my first post...

Offline Denz

  • Former Staff
  • ****
Re: removing dead bodies works ONCE
« Reply #1 on: 06 Nov 2007, 19:43:50 »
I don't know much about MP scripting but wouldn't it be better to run it from a trigger?
Code: [Select]
this addeventhandler ["killed", {_this exec "deadbody.sqs"}] foreach thislist
You need to have it in the init.sqs to have it execute on all computers.
Something like
Code: [Select]
?(local server): [] exec "deadbody.sqs"

I've got 'em right where I want 'em - surrounded from the inside!
Jerry "Mad Dog" Shriver, SOG Recon One-Zero
24/09/41 - 24/04/69