Hey guy's,

i'm trying to make an Event handler "Killed" Global, so everyone on a Dedicated server will see whats happend, if a object was killed and the Event handler was triggered.

So far i made a hundreds of tests using the ECP way:

Create a file "Load.sqs" which is executed in the init.sqs of the mission

Load.sqs
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

? &#40;isServer&#41; &#58; exit

_explosions = &#91;1,2,3,5&#93;
_fire = &#91;1,2,3,5&#93;

#Start

; Create Global variable
GL2Plus_Spawn_Script = -1

; Wait till GL2Plus_Spawn_Script is not -1
@GL2Plus_Spawn_Script &#33;= -1

; ########### DEBUG =&#92;SNKMAN/= ###########
;hint format&#91;&#34;DEBUG&#58; Spawn # &#58; %1&#92;nDEBUG&#58; Spawn Object&#58; %2&#34;,GL2Plus_Spawn_Script,GL2Plus_Spawn_Script_ Object&#93;
; ########################################

; Check if GL2Plus_SmokeEffect are enabled, if yes run script with GL2Plus_Spawn_Script_Object
? &#40;GL2Plus_SmokeEffect && GL2Plus_Spawn_Script in _explosions&#41; &#58; &#91;GL2Plus_Spawn_Script_Object&#93; exec &#34;GL2Plus&#92;GL2Plus_Effects&#92;Explosion&#92 ;Init.sqs&#34;

; Check if GL2Plus_SmokeEffect are enabled, if yes run script with GL2Plus_Spawn_Script_Object
? &#40;GL2Plus_FireEffect && GL2Plus_Spawn_Script in _fire&#41; &#58; &#91;GL2Plus_Spawn_Script_Object&#93; exec &#34;GL2Plus&#92;GL2Plus_Effects&#92;Fire&#92;Fire .sqs&#34;

; Check if GL2Plus_SmokeEffect are enabled, if yes run script with GL2Plus_Spawn_Script_Object
? &#40;GL2Plus_FireEffect && GL2Plus_Spawn_Script in _fire&#41; &#58; &#91;GL2Plus_Spawn_Script_Object&#93; exec &#34;GL2Plus&#92;GL2Plus_Effects&#92;Fire&#92;Fire _Damage.sqs&#34;

; Do it all over
goto &#34;Start&#34;[/QUOTE]

Then in a script i add the Event handler "Killed" to each vehicle:

EventHandler.sqs
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
// Check if FX should be used, if yes add EventHandler &#34;Killed&#34;
if &#40;GL2Plus_SpecialFX&#41; then {{_x AddEventHandler &#91;&#34;Killed&#34;, {

if &#40;GL2Plus_SmokeEffect && &#40;_this select 0&#41; isKindOf &#34;LandVehicle&#34;&#41; then {_this exec &#34;GL2Plus&#92;GL2Plus_Effects&#92;Explosion&#92 ;Init.sqs&#34;; GL2Plus_Spawn_Script_Object = &#40;_this select 0&#41;; publicvariable &#34;GL2Plus_Spawn_Script_Object&#34;; GL2Plus_Spawn_Script = 1; publicvariable &#34;GL2Plus_Spawn_Script&#34;};

if &#40;GL2Plus_FireEffect && &#40;_this select 0&#41; isKindOf &#34;LandVehicle&#34;&#41; then {_this exec &#34;GL2Plus&#92;GL2Plus_Effects&#92;Fire&#92;Fire .sqs&#34;; GL2Plus_Spawn_Script_Object = &#40;_this select 0&#41;; publicvariable &#34;GL2Plus_Spawn_Script_Object&#34;; GL2Plus_Spawn_Script + 2; publicvariable &#34;GL2Plus_Spawn_Script&#34;};

if &#40;GL2Plus_FireEffect && &#40;_this select 0&#41; isKindOf &#34;Man&#34;&#41; then {_this exec &#34;GL2Plus&#92;GL2Plus_Effects&#92;Fire&#92;Fire _Damage.sqs&#34;; GL2Plus_Spawn_Script_Object = &#40;_this select 0&#41;; publicvariable &#34;GL2Plus_Spawn_Script_Object&#34;; GL2Plus_Spawn_Script + 3; publicvariable &#34;GL2Plus_Spawn_Script&#34;}}&#93;}

} forEach vehicles;
[/QUOTE]

Now after an Event handler was triggered ( A vehicle was destroyed ) the Event handler will public the object (_this select 0), which was destroyed and the lock (GL2Plus_Spawn_Script) to run the "Load.sqs"

Then in "Load.sqs" the brodcasted object will run the script.

Well basically this should work, it do on a local hosted server, where i&#39;m the server but i doesn&#39;t work on a Dedicated server.

May someone of you know why or has a other way how to do this.