Hello
Hoping you can help we with my little error.
I was tried of all the bike's on my server, we use deploy bike and after a heavy PVP base fight there is always a butt load of bike laying around,
This is what I got now and it's almost works, the problem is that if a player is on his bike it gets deletede, but if he stands next to it, It will stay.
bike's a only meant to be deletede if no players is around 150m of them
its this line that finds all players, but it ignores players in vehicle's...
(isPlayer _x) && (alive _x) || (vehicle _x == _bike)
full script
private ["_pos","_delQtyBicycle","_qty","_allbicycle","_nearby","_bike"];
diag_log (format["CLEANUP: Finding unused bikes"]);
_allBicycle = entities "Bicycle";
_delQtyBicycle = 0;
{
if (_x getVariable "TempDeployed") then {
_pos = getPosATL _x;
_bike = _x;
if ((count _pos > 0)) then {
_nearby = {
(isPlayer _x) && (alive _x) || (vehicle _x == _bike)
} count (_pos nearEntities [["CAManBase"], 150]);
if (_nearby==0) then {
_x call dayz_perform_purge;
sleep 0.05;
_delQtyBicycle = _delQtyBicycle + 1;
};
};
};
sleep 0.001;
} count _allbicycle;
if (_delQtyBicycle > 0) then {
_qty = count _allbicycle;
diag_log (format["CLEANUP: Deleted %1 Bicycles out of %2",_delQtyBicycle,_qty]);
};
diag_log (format["CLEANUP: Finding unused bikes Done"]);
Help me, Obi-Wan Kenobi. You're my only hope

