Commented out the refill ammo code and i'm still getting it. Looks like it might be on my side. lolAny idea why i'm getting this Sarge?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Commented out the refill ammo code and i'm still getting it. Looks like it might be on my side. lolAny idea why i'm getting this Sarge?
lol ya.. it says that.. i dont have a customized server pbo currently though..looks like you messed up your
server_monitor.sqf
...
Not 100% sure, but that is the way you had to do it in ArmaII when creating a mission, if my memory serves me right.How do you add tools and food to your units inventory? i'm using addMagazine.. is that right/wrong?
private["_ai","_magazinetype","_entity_array","_humanity","_humanitylimit","_sleeptime","_detectrange"];
_ai = _this select 0;
//_weapons = weapons _ai;
//_weapon = _weapons select 0;
//_magazinetype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
_detectrange=300;
_humanitylimit=2499;
_humanity=0;
_sleeptime=0.5;
while {alive _ai} do {
//diag_log "heartbeat";
_entity_array = (position _ai) nearEntities [["zZombieBase","Bandit1_DZ","BanditW1_DZ"],_detectrange];
{
if(vehicle _ai != _ai) then { // NPC in a vehicle
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
If (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
};
} else { //NPC on foot
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
if (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
} else {
if (typeOf _x == "zZombieBase") then {
_x addRating -10000;
};
};
};
} forEach _entity_array;
// // refresh ammo
// if !(someAmmo _ai) then {
// {_ai removeMagazine _x} forEach magazines _ai;
// _ai addMagazine _magazinetype;
// };
sleep _sleeptime;
};
case 3 : {
_ailoadout=[_resistanceMilitiaRifle,_resistanceMilitiaAmmo];
_aiwep = _ailoadout select 0;
_aiammo = _ailoadout select 1;
_resistanceMilitiaSkin createUnit [_unitpos, _aiGroup,"_aiunit=this",1,"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";
_aiunit addMPEventHandler ["MPkilled", {Null = _this execVM "scripts\unit_killed.sqf";}];
_aiunit setVehicleInit "null = [this] execVM 'scripts\unit_init.sqf'";
//clear default weapons / ammo
removeAllWeapons _aiunit;
removeAllItems _aiunit;
//add weapon
_aiunit addMagazine _aiammo;
_aiunit addweapon _aiwep;
_gearCount = count _resistanceMilitiaGear;
for [{z = 0},{z < _gearCount},{z = z + 1}] do {
_currentItem = _resistanceMilitiaGear select z;
_aiunit addMagazine _currentItem;
};
//set skills
for [{_i=0},{_i<10},{_i=_i+1}] do {
_totalSkill = (floor(random _skillRemainder)+_baseSkill)/10;
_aiunit setSkill [_aiSkills select _i,_totalSkill];
};
};
private["_ai","_magazinetype","_entity_array","_humanity","_humanitylimit","_sleeptime","_detectrange"];
_ai = _this select 0;
_weapons = weapons _ai;
_weapon = _weapons select 0;
_magazinetype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
_detectrange=300;
_humanitylimit=2499;
_humanity=0;
_sleeptime=0.5;
while {alive _ai} do {
//diag_log "heartbeat";
_entity_array = (position _ai) nearEntities [["zZombieBase","Bandit1_DZ","BanditW1_DZ"],_detectrange];
{
if(vehicle _ai != _ai) then { // NPC in a vehicle
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
If (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
};
} else { //NPC on foot
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
if (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
} else {
if (typeOf _x == "zZombieBase") then {
_x addRating -10000;
};
};
};
} forEach _entity_array;
// refresh ammo
if !(someAmmo _ai) then {
{_ai removeMagazine _x} forEach magazines _ai;
_ai addMagazine _magazinetype;
};
sleep _sleeptime;
};
private["_ai","_magazinetype","_entity_array","_humanity","_humanitylimit","_sleeptime","_detectrange"];
_ai = _this select 0;
_weapons = weapons _ai;
_weapon = _weapons select 0;
_magazinetype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
_detectrange=300;
_humanitylimit=2499;
_humanity=0;
_sleeptime=0.5;
while {alive _ai} do {
_entity_array = (position _ai) nearEntities [["zZombieBase","Bandit1_DZ","BanditW1_DZ","Survivor1_DZ","SurvivorW1_DZ","Survivor2_DZ","SurvivorW2_DZ","Citizen1_DZ","Citizen2_DZ","Citizen3_DZ","Citizen4_DZ","police1_DZ","Camo1_DZ","Sniper1_DZ"],_detectrange];
{
if(vehicle _ai != _ai) then { // NPC in a vehicle
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
If (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
};
} else { //NPC on foot
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
if (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
};
};
if (typeOf _x == "zZombieBase") then {
_x addRating -10000;
};
} forEach _entity_array;
// refresh ammo
if !(someAmmo _ai) then {
{_ai removeMagazine _x} forEach magazines _ai;
_ai addMagazine _magazinetype;
};
sleep _sleeptime;
};
_magazinetype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
_magazintype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
The zZombieBase if at the end where I set the zombie rating. It's saying that none of the zombies are zZombieBasesorted the ammo bug ... damn typo ...
Code:_magazinetype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
make this
Code:_magazintype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
whic if statement ? theres a ton of em![]()
private["_ai","_magazinetype","_entity_array","_humanity","_humanitylimit","_sleeptime","_detectrange"];
_ai = _this select 0;
_weapons = weapons _ai;
_weapon = _weapons select 0;
_magazinetype = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
_detectrange=300;
_humanitylimit=2499;
_humanity=0;
_sleeptime=5;
while {alive _ai} do {
_entity_array = (position _ai) nearEntities [["zZombie_Base","Bandit1_DZ","BanditW1_DZ","Survivor1_DZ","SurvivorW1_DZ","Survivor2_DZ","SurvivorW2_DZ","Citizen1_DZ","Citizen2_DZ","Citizen3_DZ","Citizen4_DZ","police1_DZ","Camo1_DZ","Sniper1_DZ"],_detectrange];
{
diag_log format["player type: %1",typeOf _x];
if(vehicle _ai != _ai) then { // NPC in a vehicle
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
If (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
};
} else { //NPC on foot
if(isPlayer _x) then {
_humanity= _x getVariable ["humanity",0];
if (_humanity < _humanitylimit && rating _x > -10000) then {
diag_log format["reducing rating for player: %1",name _x];
_x addrating -10000;
} else {
if (_humanity > _humanitylimit && rating _x <= -10000) then {
_x addRating 10000;
};
};
} else {
if (typeOf _x == "zZombie_Base") then {
diag_log format["reducing rating for player: %1",name _x];
_x addRating -10000;
};
};
};
} forEach _entity_array;
// refresh ammo
if !(someAmmo _ai) then {
{_ai removeMagazine _x} forEach magazines _ai;
_ai addMagazine _magazinetype;
};
sleep _sleeptime;
};