Jump to content
  • 0

Dead Bots running


lucho

Question

When i killed bots sometime they running on one place after death
here is script
add_unit_server.sqf

 private["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_numunits","_rndLOut","_ailoadout","_aiwep","_aiammo","_wp","_aispawnpos"];
    _aiunit = objNull;
    _aiGroup = createGroup resistance;
    _aispawnpos =_this select 0;
    _numunits = _this select 3;
 
    _xpos = _aispawnpos select 0;
    _ypos = _aispawnpos select 1;
 
    for [{ x=1 },{ x < _numunits+1 },{ x = x + 1; }] do {
    _unitpos = [_xpos+x,_ypos+x,0];
 
     _rndLOut=floor(random 3);
    _ailoadout=
    switch (_rndLOut) do
    {
      case 0: {["ItemCopperBar"]};
      case 1: {["ItemGoldBar"]};
      case 2: {["ItemTinBar"]};
    };
	
    "Sniper_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",0.6,"Private"];
 
    _aiunit enableAI "TARGET";
    _aiunit enableAI "AUTOTARGET";
    _aiunit enableAI "MOVE";
    _aiunit enableAI "ANIM";
    _aiunit enableAI "FSM";
    _aiunit allowDammage true;
 
    _aiunit setCombatMode "RED";
    _aiunit setBehaviour "COMBAT";
 
    //clear default weapons / ammo
    removeAllWeapons _aiunit;

	
	    //add random selection
    _aiammo = _ailoadout select 0;
    _aiunit addMagazine _aiammo;
 
    //set skills
    _aiunit setSkill ["aimingAccuracy",1];
    _aiunit setSkill ["aimingShake",1];
    _aiunit setSkill ["aimingSpeed",1];
    _aiunit setSkill ["endurance",1];
    _aiunit setSkill ["spotDistance",1];
    _aiunit setSkill ["spotTime",1];
    _aiunit setSkill ["courage",1];
    _aiunit setSkill ["reloadSpeed",1];
    _aiunit setSkill ["commanding",1];
    _aiunit setSkill ["general",1];
    } ;

DayzFaction.sqf

 

createCenter east;
createCenter resistance;
//Survivors
WEST setFriend [RESISTANCE,0];
WEST setFriend [EAST,0];
//Bandits
EAST setFriend [RESISTANCE,0];
EAST setFriend [WEST,0];
//AI Units
RESISTANCE setFriend [WEST,0];
RESISTANCE setFriend [EAST,0];
RESISTANCE setFriend [CIVILIAN,0];//AI Units attack zeds
 
//CIVILIAN setFriend [RESISTANCE,0];//Testing Zeds attack AI units, doesn't seem to help..

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...