hi lads ..
i have a beta mission in the beta forums in which im trying to add an event handler to detect unsupressed gunfire . can get it to work by itself but if i add another event handler based script .. im buggered
had no problem with each EH in seperate trials but as soon as i mixed them only one or the other would work ..
anyone tell me what im doing wrong ..
first EH thanks to (spooner)
gamelogic to count number of cranes destroyed at port
{ _x addEventHandler ["KILLED", { _this execVM "cranes.sqf" }] } forEach nearestObjects [this, ["Land_A_Crane_02b"], 500]
cranes.sqf (thanks spooner) works a treat alone
if (isNil "ecraneCounter") then { ecraneCounter = 0 };
ecraneCounter = ecraneCounter + 1;
// <-- Do stuff every time.
if (ecraneCounter == 5) then
{
seven=true;
publicvariable "seven";
};
ecranecounter=false in init sqf
#2
trigger to detect unsilenced gunfire ( from arma) but works when tested alone
{_x addEventHandler ["fired",{if (!((_this select 2) in ["bizon_silenced","M4A1_HWS_GL_SD_Camo","M4A1_AIM_SD_camo","M9SD","G36_C_SD_eotech","PipeBombMuzzle"]) && !gunfire) then {gunfire=true; _this execVM "elekalert.sqf";}}];} forEach thislist;
elekalert.sqf
{_x setUnitPos "MIDDLE"} forEach list westport;{_x setBehaviour "AWARE"} forEach list westport;
sleep 3;
hint "Contact ... Enemy alerted to gunfire around the port of Elektrozavodsk ";
gunfire =false in init sqf ..
hope you can make some sort of sense from my questions ..
as always any help would be real nice