Trader safe zones from ai - need variable

Maybe that should work:
PHP:
if (!isNil {_unit getVariable "unithealth"}) then {
    ...
};

or you create your own:
edit the "fn_createGroup.sqf" in the compiles folder and at below this:
PHP:
_unit setVariable ["bodyName",(name _unit)];                                        // Set unit body name
    _unit setVariable ["unithealth",[12000,0,false]];                                    // Set unit health (blood, legs health, legs broken)
    _unit setVariable ["unconscious",false];
a line with something like that:
PHP:
_unit setVariable ["HSO_Identifier",true];
and then check these variable:
PHP:
if (!isNil {_unit getVariable "HSO_Identifier"}) then {
    ...
};
 
thanks for the response and effort , none of the above worked though

like i was asking in the thread i linked to in the first post would i need to change the delete line to the one matching the AI cleanup file or is the one in the file im using fine ?
deletevehicle _x; <- how it shows zeds deleting (working in the agn file im using)

or do i need to emulate the way the dzai delete in the cleanup file
Code:
//DZAI_numAIUnits = DZAI_numAIUnits - (_x getVariable ["groupSize",0]); //Update active AI count
    (DZAI_numAIUnits - (_x getVariable ["groupSize",0])) call DZAI_updateUnitCount;
    {deleteVehicle _x} forEach (units _x); //Delete live units
    if (DZAI_debugLevel > 1) then {diag_log format ["DZAI Extended Debug: Group %1 has group size %2.",_x,(_x getVariable ["groupSize",0])];};
    sleep 0.5;
    deleteGroup _x;                                    //Delete the group after its units are deleted.
} forEach _grpArray;

something from that ?
 
Try this:
http://pastebin.com/311axyk0

i changed:
PHP:
if ( AGN_safeZone_Players_RemoveZombies ) then
        {
                _anti_zombie = [] spawn {
                private ["_entity_array"];
                        while {!canBuild} do
                        {
                                _entity_array = (getPos player) nearEntities ["CAManBase",110];
                                {
                                        if (_x isKindof "zZombie_Base") then {
                                                deletevehicle _x;
                                        };
                                        if (!isNil {_x getVariable "unithealth"}) then {
                                            deletevehicle _x;
                                        };
                                } forEach _entity_array;
                                sleep 4;
                        };
                };
        };
 
You tryed the tip from my first post, to set your own variable in the "fn_createGroup.sqf" file from dzai?
And check this in your agn script?
 
yea i tried that way also .. it really seems like any of these options should have worked pretty easily maybe im just doing something wrong but i dont wanna start doubting lol
 
maybe something like this can help?
Code:
if ((_x isKindof "Man") && !(side _x == west) !(_x in serverTraders)) then {
deletevehicle _x;
};
Needs to be tested but maybe it will help ^^
 
Not sure if it will work at all, but following the code from spawnBandits through to BIN_taskPatrol, something like this placed before the very last closing bracket in BIN_taskPatrol should do it(Note, I did take some stuff from setup_trader_areas.sqf because I was too lazy to do something that was already done for me)
Code:
    _unit = _this select 0;
    _trader_markers = switch (toLower worldName) do {
        case "chernarus": {["Tradercitystary","wholesaleSouth","boatTraderEast","BoatDealerSouth","AirVehicles","BanditDen","Klen","BoatDealerEast","TradercityBash","HeroTrader"]};
        case default {[]};
    };
    if (_unit distance _trader_markers < 100) then {
        deleteVehicle _unit;
    };

It gets _unit from spawnBandits.sqf
Code:
0 = [_unitGroup,_triggerPos,_patrolDist] spawn DZAI_BIN_taskPatrol;
 
Back
Top