AI Guards that shoot all except certain UID ?

Chalk1990

Member
I have a base for my clan on my server, and I want static AI to guard this base when we're not on, I want them to shoot any intruders on sight who attempt to come in our base, but I do not want them to shoot my clan members when they're running around in the base, I want the AI to be friendly toward my clan no matter their humanity values, but the AI should be hostile to anyone not on the UID list.

Is this possible?
 
That is a neat idea though instead of the dome. Maybe switch your admins from east to west (or west to east) but that would mess up Zombie agro too I believe.
 
myscript.sqf:
PHP Code:
if (not isDedicated) exitwith {};
_obj = _this select 0;_rad = _this select 1;
_UIDarray = ["123456","654321","456789"];
_list = [];

while {
true} do {

_list = (position _obj) nearEntities [["Man"],_rad];

for
"_i" from 0 to (count _list)-1 do {

_dude = _list select _i;
_rating = rating _dude;
_UIDdude = getplayerUID _dude;

if (
not (_UIDdude in _UIDarray) and (_rating > -10000)) then {
_dude addrating -10000;
};

sleep 0.01;
};

sleep 1;
};


Execute it with an object and a radius as parameters.
nul = [someobject,radius] execVM "myscript.sqf";

I haven't tested this but it should work. See how you get on.
 
where to prescribe this line? please tell me. nul = [someobject,radius] execVM "myscript.sqf";
 
Back
Top