Jump to content

wildman

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Posts posted by wildman


  1. Ok update time,

     

    So the problem is simple, EventHandler Killed is local and i need it to be global

     

    Couldn't get the local dedicated server working w/ mods but i had some time on our server to figure out the issue

     

     

    EDIT - Well, it pays to read the event handler wiki a bit more lol

     

    New version of the eventhandler uses MPKilled so it should work on dedicated servers now :D

     

    EDIT - Working now

    _unit addMPEventHandler ["MPkilled", {[_this select 0] ExecVm "Scripts\EOSUnitDeath.sqf"}];
    

  2. Within my mission i'm using EOS and i added this line so a script would run everytime a unit died/

    _unit addEventHandler ["killed", {[_this select 0] ExecVm "Scripts\EOSUnitDeath.sqf"}];
    

    EOSUnitDeath.sqf

    _personOne = _this select 0;
    
    // EOS UNIT KILLED
    // copyToClipboard faction _personOne 
    
    if (faction _personOne == 'mas_med_opfi_hd') then 
    	{
    	// ENEMY EOS UNIT KILLED
    	_rng = random 100;
    	if (_rng < 5) then {
    		_veh = createVehicle ["suitcase", getpos _personOne, [], 0, "NONE"]  ;
    		[[_veh, ["Collect evidence","scripts\collect.sqf"]],"addAction",true,true] call BIS_fnc_MP;
    		}
    	}
    else 
    {
    	// NONE ENEMY EOS UNIT KILLED
    	CivKilltally = CivKillTally + 1;
    	if (CivkillTally == 5) then
    		{
    			"end1" call BIS_fnc_endMission;
    		}
    	else 
    	{
    		hint format ["Warning Civilians Killed = %1 of 5 %2", CivKillTally];
    	};
    };
    

    This seems to work on a locally hosted server and in the editor but I dont have regular access to the dedicated server our group uses so I'm not able to run any tests.

     

    Additionally this used to work on a previous version where EOS unit death was simply

    _rng = random 100;
    
    if (_rng < 5) then {
    
    _personOne = _this select 0;
    hint 'intel spawned';
    _veh = createVehicle ["suitcase", getpos _personOne, [], 0, "CAN_COLLIDE"]  ;
    [[_veh, ["Collect evidence","scripts\collect.sqf"]],"addAction",true,true] call BIS_fnc_MP;
    
    
    } else {};
    

    Also the global variable CivKillTally is definied in the init as

    CivkillTally = 0;
    

    any help would be appreciated and if need be i can provide more info 

×