From e0ad65d4ed1c80414ced487d4ebe8e98208fa207 Mon Sep 17 00:00:00 2001 From: Barbolani77 Date: Sun, 29 Jul 2018 18:34:06 +0200 Subject: [PATCH] 1.2.3 --- A3-Antistasi/AI/attackDrillAI.sqf | 14 ++- A3-Antistasi/AI/autoRearm.sqf | 108 +++++------------- A3-Antistasi/CREATE/wavedCA.sqf | 4 +- A3-Antistasi/Missions/LOG_Suministros.sqf | 5 +- A3-Antistasi/REINF/NATOQuadbike.sqf | 20 +++- A3-Antistasi/REINF/NATObomb.sqf | 2 +- .../description.ext | 8 ++ .../A3-AATemplate.Altis/description.ext | 8 ++ .../A3-WotPTemplate.Tanoa/description.ext | 8 ++ A3-Antistasi/buildHQ.sqf | 14 +-- A3-Antistasi/changelog.txt | 16 ++- A3-Antistasi/description.ext | 8 ++ A3-Antistasi/garageVehicle.sqf | 6 +- A3-Antistasi/initPlayerLocal.sqf | 9 +- A3-Antistasi/initServer.sqf | 4 +- A3-Antistasi/initVar.sqf | 3 +- A3-Antistasi/initZones.sqf | 18 ++- A3-Antistasi/onPlayerDisconnect.sqf | 26 ++++- A3-Antistasi/orgPlayers/nonMemberDistance.sqf | 38 ++++++ A3-Antistasi/tempMoveMrk.sqf | 5 +- 20 files changed, 206 insertions(+), 118 deletions(-) create mode 100644 A3-Antistasi/orgPlayers/nonMemberDistance.sqf diff --git a/A3-Antistasi/AI/attackDrillAI.sqf b/A3-Antistasi/AI/attackDrillAI.sqf index eebe21487b..2dc1a9e7ab 100644 --- a/A3-Antistasi/AI/attackDrillAI.sqf +++ b/A3-Antistasi/AI/attackDrillAI.sqf @@ -71,10 +71,10 @@ if (count _mgs == 1) then _grupo setVariable ["movable",_movable]; _grupo setVariable ["baseOfFire",_baseOfFire]; _grupo setVariable ["flankers",_flankers]; - +if (side _grupo == buenos) then {_grupo setVariable ["autoRearmed",time + 300]}; while {true} do { - if (({alive _x} count (_grupo setVariable ["movable",[]]) == 0) or (isNull _grupo)) exitWith {}; + if (({alive _x} count (_grupo getVariable ["movable",[]]) == 0) or (isNull _grupo)) exitWith {}; _objetivos = _grupo call enemyList; _grupo setVariable ["objetivos",_objetivos]; @@ -286,7 +286,15 @@ while {true} do if (_grupo getVariable ["tarea","Patrol"] == "Hide") then {_grupo call recallGroup}; _grupo setVariable ["tarea","Patrol"]; }; + if (side _grupo == buenos) then + { + if (time >= _grupo getVariable ["autoRearm",time]) then + { + _grupo setVariable ["autoRearm",time + 120]; + {[_x] spawn autoRearm; sleep 1} forEach ((_grupo getVariable ["movable",[]]) select {[_x] call canFight and !(_x getVariable ["maniobrando",false])}); + }; + }; }; - + diag_log format ["Tarea:%1.Movable:%2.Base:%3.Flankers:%4",_grupo getVariable "tarea",_grupo getVariable "movable",_grupo getVariable "baseOfFire",_grupo getVariable "flankers"]; sleep 30; }; diff --git a/A3-Antistasi/AI/autoRearm.sqf b/A3-Antistasi/AI/autoRearm.sqf index c789ef80a7..9d58e6ab6c 100644 --- a/A3-Antistasi/AI/autoRearm.sqf +++ b/A3-Antistasi/AI/autoRearm.sqf @@ -2,13 +2,14 @@ private ["_unit","_Pweapon","_Sweapon","_cuenta","_magazines","_hayCaja","_dista _unit = _this select 0; -if ((isPlayer _unit) or (player != leader group player)) exitWith {}; +if (isPlayer _unit) exitWith {}; if !([_unit] call canFight) exitWith {}; +_inPlayerGroup = (isPlayer (leader _unit)); //_ayudando = _unit getVariable "ayudando"; -if (_unit getVariable ["ayudando",false]) exitWith {_unit groupChat "I cannot rearm right now. I'm healing a comrade"}; +if (_unit getVariable ["ayudando",false]) exitWith {if (_inPlayerGroup) then {_unit groupChat "I cannot rearm right now. I'm healing a comrade"}}; _rearming = _unit getVariable ["rearming",false]; -if (_rearming) exitWith {_unit groupChat "I am currently rearming. Cancelling."; _unit setVariable ["rearming",false]}; - +if (_rearming) exitWith {if (_inPlayerGroup) then {_unit groupChat "I am currently rearming. Cancelling."; _unit setVariable ["rearming",false]}}; +if (vehicle _unit != _unit) exitWith {}; _unit setVariable ["rearming",true]; _Pweapon = primaryWeapon _unit; @@ -57,7 +58,7 @@ if ((_Pweapon in initialRifles) or (_Pweapon == "")) then _unit stop false; if ((!alive _target) or (not(_target isKindOf "ReammoBox_F"))) then {_target setVariable ["busy",true]}; _unit doMove (getPosATL _target); - _unit groupChat "Picking a better weapon"; + if (_inPlayerGroup) then {_unit groupChat "Picking a better weapon"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if ((unitReady _unit) and ([_unit] call canFight) and (_unit distance _target > 3) and (_target isKindOf "ReammoBox_F") and (!isNull _target)) then {_unit setPos position _target}; @@ -67,20 +68,11 @@ if ((_Pweapon in initialRifles) or (_Pweapon == "")) then sleep 5; if (primaryWeapon _unit == _arma) then { - _unit groupChat "I have a better weapon now"; + if (_inPlayerGroup) then {_unit groupChat "I have a better weapon now"}; if (_target isKindOf "ReammoBox_F") then {_unit action ["rearm",_target]}; - } - else - { - _unit groupChat "Couldn't take this weapon"; }; - } - else - { - _unit groupChat "Cannot take a better weapon"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; _distancia = 51; _Pweapon = primaryWeapon _unit; @@ -125,7 +117,7 @@ if ((_hayCaja) and (_unit getVariable "rearming")) then _unit stop false; if ((!alive _target) or (not(_target isKindOf "ReammoBox_F"))) then {_target setVariable ["busy",true]}; _unit doMove (getPosATL _target); - _unit groupChat "Rearming"; + if (_inPlayerGroup) then {_unit groupChat "Rearming"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if ((unitReady _unit) and ([_unit] call canFight) and (_unit distance _target > 3) and (_target isKindOf "ReammoBox_F") and (!isNull _target)) then {_unit setPos position _target}; @@ -134,23 +126,18 @@ if ((_hayCaja) and (_unit getVariable "rearming")) then _unit action ["rearm",_target]; if ({_x in _magazines} count (magazines _unit) >= _cuenta) then { - _unit groupChat "Rearmed"; + if (_inPlayerGroup) then {_unit groupChat "Rearmed"}; } else { - _unit groupChat "Partially Rearmed"; + if (_inPlayerGroup) then {_unit groupChat "Partially Rearmed"}; }; - } - else - { - _unit groupChat "Cannot rearm"; }; _target setVariable ["busy",false]; - _unit doFollow player; } else { - _unit groupChat "No source to rearm my primary weapon"; + if (_inPlayerGroup) then {_unit groupChat "No source to rearm my primary weapon"}; }; _hayCaja = false; if ((_Sweapon == "") and (loadAbs _unit < 340)) then @@ -184,7 +171,7 @@ if ((_Sweapon == "") and (loadAbs _unit < 340)) then _unit stop false; if ((!alive _target) or (not(_target isKindOf "ReammoBox_F"))) then {_target setVariable ["busy",true]}; _unit doMove (getPosATL _target); - _unit groupChat "Picking a secondary weapon"; + if (_inPlayerGroup) then {_unit groupChat "Picking a secondary weapon"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if ((unitReady _unit) and ([_unit] call canFight) and (_unit distance _target > 3) and (_target isKindOf "ReammoBox_F") and (!isNull _target)) then {_unit setPos position _target}; @@ -194,20 +181,11 @@ if ((_Sweapon == "") and (loadAbs _unit < 340)) then sleep 3; if (secondaryWeapon _unit == _arma) then { - _unit groupChat "I have a secondary weapon now"; + if (_inPlayerGroup) then {_unit groupChat "I have a secondary weapon now"}; if (_target isKindOf "ReammoBox_F") then {sleep 3;_unit action ["rearm",_target]}; - } - else - { - _unit groupChat "Couldn't take this weapon"; }; - } - else - { - _unit groupChat "Cannot take a secondary weapon"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; _Sweapon = secondaryWeapon _unit; _distancia = 51; @@ -253,7 +231,7 @@ if (_Sweapon != "") then _unit stop false; if (!alive _target) then {_target setVariable ["busy",true]}; _unit doMove (position _target); - _unit groupChat "Rearming"; + if (_inPlayerGroup) then {_unit groupChat "Rearming"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if ((unitReady _unit) and ([_unit] call canFight) and (_unit distance _target > 3) and (_target isKindOf "ReammoBox_F") and (!isNull _target)) then {_unit setPos position _target}; @@ -274,22 +252,18 @@ if (_Sweapon != "") then if ({_x in _magazines} count (magazines _unit) >= 2) then { - _unit groupChat "Rearmed"; + if (_inPlayerGroup) then {_unit groupChat "Rearmed"}; } else { - _unit groupChat "Partially Rearmed"; + if (_inPlayerGroup) then {_unit groupChat "Partially Rearmed"}; }; - } - else - { - _unit groupChat "Cannot rearm"; }; _target setVariable ["busy",false]; } else { - _unit groupChat "No source to rearm my secondary weapon."; + if (_inPlayerGroup) then {_unit groupChat "No source to rearm my secondary weapon"}; }; sleep 3; }; @@ -314,7 +288,7 @@ if ((not("ItemRadio" in assignedItems _unit)) and !haveRadio) then _unit stop false; _target setVariable ["busy",true]; _unit doMove (getPosATL _target); - _unit groupChat "Picking a Radio"; + if (_inPlayerGroup) then {_unit groupChat "Picking a Radio"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if (_unit distance _target < 3) then @@ -322,13 +296,8 @@ if ((not("ItemRadio" in assignedItems _unit)) and !haveRadio) then _unit action ["rearm",_target]; _unit linkItem "ItemRadio"; _target unlinkItem "ItemRadio"; - } - else - { - _unit groupChat "Cannot pick the Radio"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; }; _hayCaja = false; @@ -354,7 +323,7 @@ if (hmd _unit == "") then _target setVariable ["busy",true]; _hmd = hmd _target; _unit doMove (getPosATL _target); - _unit groupChat "Picking NV Googles"; + if (_inPlayerGroup) then {_unit groupChat "Picking NV Googles"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if (_unit distance _target < 3) then @@ -362,13 +331,8 @@ if (hmd _unit == "") then _unit action ["rearm",_target]; _unit linkItem _hmd; _target unlinkItem _hmd; - } - else - { - _unit groupChat "Cannot pick those NV Googles"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; }; _hayCaja = false; @@ -393,7 +357,7 @@ if (not(headgear _unit in cascos)) then _target setVariable ["busy",true]; _casco = headgear _target; _unit doMove (getPosATL _target); - _unit groupChat "Picking a Helmet"; + if (_inPlayerGroup) then {_unit groupChat "Picking a Helmet"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if (_unit distance _target < 3) then @@ -401,13 +365,8 @@ if (not(headgear _unit in cascos)) then _unit action ["rearm",_target]; _unit addHeadgear _casco; removeHeadgear _target; - } - else - { - _unit groupChat "Cannot pick this Helmet"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; }; _hayCaja = false; @@ -433,7 +392,7 @@ if ({_x == "FirstAidKit"} count (items _unit) < _minFA) then _unit stop false; _target setVariable ["busy",true]; _unit doMove (getPosATL _target); - _unit groupChat "Picking a First Aid Kit"; + if (_inPlayerGroup) then {_unit groupChat "Picking a First Aid Kit"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if (_unit distance _target < 3) then @@ -444,14 +403,9 @@ if ({_x == "FirstAidKit"} count (items _unit) < _minFA) then _unit addItem "FirstAidKit"; _target removeItem "FirstAidKit"; if ("FirstAidKit" in items _muerto) then {sleep 3}; - } - } - else - { - _unit groupChat "Cannot pick this Kit"; + }; }; _target setVariable ["busy",false]; - _unit doFollow player; }; }; _hayCaja = false; @@ -472,7 +426,7 @@ if ((_hayCaja) and (_unit getVariable "rearming")) then _unit stop false; _target setVariable ["busy",true]; _unit doMove (getPosATL _target); - _unit groupChat "Picking a a better vest"; + if (_inPlayerGroup) then {_unit groupChat "Picking a a better vest"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if (_unit distance _target < 3) then @@ -489,13 +443,8 @@ if ((_hayCaja) and (_unit getVariable "rearming")) then {_cosa addItemCargoGlobal [_x,1]} forEach (vestItems _target); }; removeVest _target; - } - else - { - _unit groupChat "Cannot pick this vest"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; if (backpack _unit == "") then @@ -518,7 +467,7 @@ if (backpack _unit == "") then _unit stop false; _target setVariable ["busy",true]; _unit doMove (getPosATL _target); - _unit groupChat "Picking a Backpack"; + if (_inPlayerGroup) then {_unit groupChat "Picking a Backpack"}; _timeOut = time + 60; waitUntil {sleep 1; !([_unit] call canFight) or (isNull _target) or (_unit distance _target < 3) or (_timeOut < time) or (unitReady _unit)}; if (_unit distance _target < 3) then @@ -533,15 +482,10 @@ if (backpack _unit == "") then {_cosa addItemCargoGlobal [_x,1]} forEach (backpackItems _target); }; removeBackpackGlobal _target; - } - else - { - _unit groupChat "Cannot pick this Pack"; }; _target setVariable ["busy",false]; - _unit doFollow player; }; }; - -if (!_necesita) then {_unit groupChat "No need to rearm"} else {_unit groupChat "Rearming Done"}; +_unit doFollow (leader _unit); +if (!_necesita) then {if (_inPlayerGroup) then {_unit groupChat "No need to rearm"}} else {if (_inPlayerGroup) then {_unit groupChat "Rearming Done"}}; _unit setVariable ["rearming",false]; \ No newline at end of file diff --git a/A3-Antistasi/CREATE/wavedCA.sqf b/A3-Antistasi/CREATE/wavedCA.sqf index 7222a8623b..0dcc55c70c 100644 --- a/A3-Antistasi/CREATE/wavedCA.sqf +++ b/A3-Antistasi/CREATE/wavedCA.sqf @@ -28,11 +28,11 @@ _nombreorig = [_mrkOrigen] call localizar; _lado = lados getVariable [_mrkOrigen,sideUnknown]; _ladosTsk = [buenos,civilian,muyMalos]; _ladosTsk1 = [malos]; -_nombreEny = "NATO"; +_nombreEny = nameMalos; //_config = cfgNATOInf; if (_lado == muyMalos) then { - _nombreEny = "CSAT"; + _nombreEny = nameMuyMalos; //_config = cfgCSATInf; _ladosTsk = [buenos,civilian,malos]; _ladosTsk1 = [muyMalos]; diff --git a/A3-Antistasi/Missions/LOG_Suministros.sqf b/A3-Antistasi/Missions/LOG_Suministros.sqf index 7b803d904b..3b6cbc1dc5 100644 --- a/A3-Antistasi/Missions/LOG_Suministros.sqf +++ b/A3-Antistasi/Missions/LOG_Suministros.sqf @@ -75,7 +75,8 @@ _taskDescription = format ["%1 population is in need of supplies. We may improve [[buenos,civilian],"LOG",[_taskDescription,"City Supplies",_marcador],_posicion,false,0,true,"Heal",true] call BIS_fnc_taskCreate; misiones pushBack ["LOG","CREATED"]; publicVariable "misiones"; -_pos = []; +_pos = (getMarkerPos respawnBuenos) findEmptyPosition [1,50,"C_Van_01_box_F"]; +/*_pos = []; if (!_dificil) then { @@ -98,7 +99,7 @@ else }; _pos = [_posroad, 3, _dirveh + 90] call BIS_Fnc_relPos; }; - +*/ //Creating the box _camion = "Land_PaperBox_01_open_boxes_F" createVehicle _pos; _camion allowDamage false; diff --git a/A3-Antistasi/REINF/NATOQuadbike.sqf b/A3-Antistasi/REINF/NATOQuadbike.sqf index 3ab843d93e..e0df7342bc 100644 --- a/A3-Antistasi/REINF/NATOQuadbike.sqf +++ b/A3-Antistasi/REINF/NATOQuadbike.sqf @@ -1,19 +1,27 @@ _marcador = [marcadores,player] call BIS_fnc_nearestPosition; _lado = side player; +_nombre = if (_lado == malos) then {nameMalos} else {nameMuyMalos}; -if (((_lado == malos) and (not(lados getVariable [_marcador,sideUnknown] == malos))) or ((_lado == muyMalos) and (not(lados getVariable [_marcador,sideUnknown] == muyMalos)))) exitWith {hint "You need to be close to an Airbase, Seaport or Outpost of your side in order to request a bike"}; -if ((!(_marcador in aeropuertos)) and (!(_marcador in puertos)) and (!(_marcador in puestos))) exitWith {hint "You need to be close to an Airbase, Seaport or Outpost of your side in order to request a bike"}; -if (not(player inArea _marcador)) exitWith {hint "You need to be close to an Airbase, Seaport or Outpost in order to request a bike"}; +if (lados getVariable [_marcador,sideUnknown] != _lado) exitWith {hint format ["You need to be close to a zone belonging to %1 in order to request a vehicle",_nombre]}; +if ((!(_marcador in aeropuertos)) and (!(_marcador in puertos)) and (!(_marcador in puestos))) exitWith {hint "You need to be close to an Airbase, Seaport or Outpost of your side in order to request a vehicle"}; +if (not(player inArea _marcador)) exitWith {hint "You need to be close to an Airbase, Seaport or Outpost in order to request a vehicle"}; -_tipoBike = if (_lado == malos) then {vehNATOBike} else {vehCSATBike}; +_tipoBike = if (_lado == malos) then {selectRandom vehNATOLightUnarmed} else {selectRandom vehCSATLightUnarmed}; if (!isNull moto) then { if (moto distance player < 100) then {deleteVehicle moto}; }; -hint "Quadbike available"; -moto = createVehicle [_tipoBike, position player, [], 10, "NONE"]; +hint "Vehicle available"; +_pos = []; +_radius = 10; +while {_pos isEqualTo []} do + { + _pos = (position player) findEmptyPosition [5,_radius,"I_Truck_02_covered_F"]; + _radius = _radius + 10; + }; +moto = createVehicle [_tipoBike,_pos, [], 10, "NONE"]; [moto] call AIVEHinit; \ No newline at end of file diff --git a/A3-Antistasi/REINF/NATObomb.sqf b/A3-Antistasi/REINF/NATObomb.sqf index a6742cc086..727b586edb 100644 --- a/A3-Antistasi/REINF/NATObomb.sqf +++ b/A3-Antistasi/REINF/NATObomb.sqf @@ -56,7 +56,7 @@ _angorig = _ang - 180; _origpos = [_pos1, 2500, _angorig] call BIS_fnc_relPos; _finpos = [_pos2, 2500, _ang] call BIS_fnc_relPos; -_planefn = [_origpos, _ang, vehSDKPlane, WEST] call bis_fnc_spawnvehicle; +_planefn = [_origpos, _ang, vehSDKPlane, buenos] call bis_fnc_spawnvehicle; _plane = _planefn select 0; _plane setPosATL [getPosATL _plane select 0, getPosATL _plane select 1, 1000]; _plane disableAI "TARGET"; diff --git a/A3-Antistasi/Templates/A3-AA-BLUFORTemplate.Altis/description.ext b/A3-Antistasi/Templates/A3-AA-BLUFORTemplate.Altis/description.ext index de41117967..4569113f56 100644 --- a/A3-Antistasi/Templates/A3-AA-BLUFORTemplate.Altis/description.ext +++ b/A3-Antistasi/Templates/A3-AA-BLUFORTemplate.Altis/description.ext @@ -158,6 +158,14 @@ class Params default = 20; //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument }; + class memberDistance + { + title = "Max distance non members can be from the closest member or HQ (they will be teleported to HQ after some timeout)"; + values[] = {1000,2000,4000,8000,16000}; + texts[] = {"1 Kmt","2 Kmts","4 Kmts","8 Kmts","Unlimited"}; + default = 2000; + //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument + }; }; class CfgIdentities diff --git a/A3-Antistasi/Templates/A3-AATemplate.Altis/description.ext b/A3-Antistasi/Templates/A3-AATemplate.Altis/description.ext index c7916156c8..9a3a2bc509 100644 --- a/A3-Antistasi/Templates/A3-AATemplate.Altis/description.ext +++ b/A3-Antistasi/Templates/A3-AATemplate.Altis/description.ext @@ -158,6 +158,14 @@ class Params default = 20; //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument }; + class memberDistance + { + title = "Max distance non members can be from the closest member or HQ (they will be teleported to HQ after some timeout)"; + values[] = {1000,2000,4000,8000,16000}; + texts[] = {"1 Kmt","2 Kmts","4 Kmts","8 Kmts","Unlimited"}; + default = 2000; + //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument + }; }; class CfgIdentities diff --git a/A3-Antistasi/Templates/A3-WotPTemplate.Tanoa/description.ext b/A3-Antistasi/Templates/A3-WotPTemplate.Tanoa/description.ext index 143fd47d17..6eadd4e16f 100644 --- a/A3-Antistasi/Templates/A3-WotPTemplate.Tanoa/description.ext +++ b/A3-Antistasi/Templates/A3-WotPTemplate.Tanoa/description.ext @@ -157,6 +157,14 @@ class Params default = 20; //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument }; + class memberDistance + { + title = "Max distance non members can be from the closest member or HQ (they will be teleported to HQ after some timeout)"; + values[] = {1000,2000,4000,8000,16000}; + texts[] = {"1 Kmt","2 Kmts","4 Kmts","8 Kmts","Unlimited"}; + default = 2000; + //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument + }; }; class CfgIdentities diff --git a/A3-Antistasi/buildHQ.sqf b/A3-Antistasi/buildHQ.sqf index 40966b036b..f5d3a7cd2d 100644 --- a/A3-Antistasi/buildHQ.sqf +++ b/A3-Antistasi/buildHQ.sqf @@ -33,28 +33,28 @@ else //fuego inflame true; [respawnBuenos,1] remoteExec ["setMarkerAlphaLocal",buenos,true]; [respawnBuenos,1] remoteExec ["setMarkerAlphaLocal",civilian,true]; -_pos = [getPos petros, 3, getDir petros] call BIS_Fnc_relPos; +_posFuego = [getPos petros, 3, getDir petros] call BIS_Fnc_relPos; fuego setPos _pos; _rnd = getdir Petros; -//if (isMultiplayer) then {sleep 5}; -_pos = [getPos fuego, 3, _rnd] call BIS_Fnc_relPos; +if (isMultiplayer) then {sleep 5}; +_pos = [_posFuego, 3, _rnd] call BIS_Fnc_relPos; caja setPos _pos; _rnd = _rnd + 45; -_pos = [getPos fuego, 3, _rnd] call BIS_Fnc_relPos; +_pos = [_posFuego, 3, _rnd] call BIS_Fnc_relPos; mapa setPos _pos; mapa setDir ([fuego, mapa] call BIS_fnc_dirTo); _rnd = _rnd + 45; -_pos = [getPos fuego, 3, _rnd] call BIS_Fnc_relPos; +_pos = [_posFuego, 3, _rnd] call BIS_Fnc_relPos; _pos = _pos findEmptyPosition [0,100,(typeOf bandera)]; if (_pos isEqualTo []) then {_pos = getPos petros}; bandera setPos _pos; _rnd = _rnd + 45; -_pos = [getPos fuego, 3, _rnd] call BIS_Fnc_relPos; +_pos = [_posFuego, 3, _rnd] call BIS_Fnc_relPos; cajaVeh setPos _pos; //if (_movido) then {_nul = [] call vaciar}; petros setBehaviour "SAFE"; "Synd_HQ" setMarkerPos getPos petros; -placementDone = true; publicVariable "placementDone"; +if (isNil "placementDone") then {placementDone = true; publicVariable "placementDone"}; sleep 5; [Petros,"mission"] remoteExec ["flagaction",[buenos,civilian],petros]; diff --git a/A3-Antistasi/changelog.txt b/A3-Antistasi/changelog.txt index caee779917..e5329d6f63 100644 --- a/A3-Antistasi/changelog.txt +++ b/A3-Antistasi/changelog.txt @@ -1055,4 +1055,18 @@ cambiar a inArea el undercover y revisar a qu - Commander auto assign on JiP fixed when there are PvP players present. - Fixed "Move this Asset" and HQ garrisons on load. - Changed major attack AI decisions according to the new mechanic of auto conquer resources and factories when capturing an airbase. Also CSAT will prioritise more enemy outpost assault. -- Reduced spawning requisites for a wave to be counted in major attacks. \ No newline at end of file +- Reduced spawning requisites for a wave to be counted in major attacks. + +1.2.3 28/07/2018 + +- NEW FEATURE: MP param to monitor non member distance to the closest member or HQ. After some timeout they will be teleported. This can be customizable in the MP lobby but it is activated by default. The aim of this feature is to avoid randomers in open dedis make spawn senseless zones and not be collaborative with other players. +- Extended AutoRearm to HC squads. If they are "easy" and not fighting, they will search for better weapons, vests etc.. same as AI squadmates when ordered. +- Fixed the detection of players that have been recently rebels and they are joining a pvp faction. +- Players have to be in the HQ to garage vehicles (to store air vehicles, the HQ still has to be placed very close to an airbase flag). +- Major attack task names adapted to your mods. +- PvP player will have cars instead of quadbikes to request and spawning will be safer. +- Solved some localization issues with city setup parameters. +- Airstrike plane will be of proper side in Altis Greenfor version. +- Improved stability when players add garrisons on spawned zones. +- Small workaround for buliding HQ in MP issues. +- Re enabled supply box spawn in high war level. \ No newline at end of file diff --git a/A3-Antistasi/description.ext b/A3-Antistasi/description.ext index c7916156c8..9a3a2bc509 100644 --- a/A3-Antistasi/description.ext +++ b/A3-Antistasi/description.ext @@ -158,6 +158,14 @@ class Params default = 20; //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument }; + class memberDistance + { + title = "Max distance non members can be from the closest member or HQ (they will be teleported to HQ after some timeout)"; + values[] = {1000,2000,4000,8000,16000}; + texts[] = {"1 Kmt","2 Kmts","4 Kmts","8 Kmts","Unlimited"}; + default = 2000; + //file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument + }; }; class CfgIdentities diff --git a/A3-Antistasi/garageVehicle.sqf b/A3-Antistasi/garageVehicle.sqf index c5a8579e65..02951c68e0 100644 --- a/A3-Antistasi/garageVehicle.sqf +++ b/A3-Antistasi/garageVehicle.sqf @@ -7,7 +7,9 @@ if (isNull _veh) exitWith {hint "You are not looking at a vehicle"}; if (!alive _veh) exitWith {hint "You cannot add destroyed vehicles to your garage"}; -if (_veh distance getMarkerPos respawnBuenos > 50) exitWith {hint "Vehicle must be closer than 50 meters to HQ"}; +if (_veh distance2d getMarkerPos respawnBuenos > 50) exitWith {hint "Vehicle must be closer than 50 meters to HQ"}; + +if (player distance2d getMarkerPos respawnBuenos > 50) exitWith {hint "You must be closer than 50 meters to HQ"}; if ({alive _x} count (crew vehicle _veh) > 0) exitWith { hint "In order to store a vehicle, its crew must disembark."}; @@ -40,7 +42,7 @@ if (_tipoVeh isKindOf "Air") then if (count _aeropuertos == 0) then {_exit = true}; }; -if (_exit) exitWith {hint format ["You cannot garage an air vehicle while you are near an Aiport which belongs to %1",nameBuenos]}; +if (_exit) exitWith {hint format ["You cannot garage an air vehicle while you are not near an Aiport which belongs to %1",nameBuenos]}; if (_veh in staticsToSave) then {staticsToSave = staticsToSave - [_veh]; publicVariable "staticsToSave"}; diff --git a/A3-Antistasi/initPlayerLocal.sqf b/A3-Antistasi/initPlayerLocal.sqf index a42b7a85fe..b692397d69 100644 --- a/A3-Antistasi/initPlayerLocal.sqf +++ b/A3-Antistasi/initPlayerLocal.sqf @@ -116,7 +116,7 @@ if (player getVariable ["pvp",false]) exitWith if ((!_isJIP) or (paramsArray select 6 != 1)) then { ["noPvP",false,1,false,false] call BIS_fnc_endMission; - diag_log "Antistasi: PvP player kicked because he is not jipping"; + diag_log "Antistasi: PvP player kicked because he is not jipping or PvP slots are disabled"; } else { @@ -155,12 +155,12 @@ if (player getVariable ["pvp",false]) exitWith private ["_unit","_veh"]; _unit = _this select 0; _veh = _this select 2; - if (_veh != _moto) then + if (_veh != moto) then { - if !(typeOf _veh in vehNormal) then + if !((typeOf _veh) in (vehNATOLightUnarmed + vehCSATLightUnarmed)) then { moveOut player; - hint format ["You are only allowed to use your Quadbike or %1 non armed vehicles",nameMalos]; + hint "PvP player are only allowed to use their own or other PvP player vehicles"; }; }; }]; @@ -424,6 +424,7 @@ if (isMultiplayer) then }; _nonMembers = {(side group _x == buenos) and !([_x] call isMember)} count playableUnits; if (_nonMembers >= (playableSlotsNumber buenos) - bookedSlots) then {["memberSlots",false,1,false,false] call BIS_fnc_endMission}; + if (memberDistance != 16000) then {[] execVM "orgPlayers\nonMemberDistance.sqf"}; }; }; }; diff --git a/A3-Antistasi/initServer.sqf b/A3-Antistasi/initServer.sqf index 6918062311..57cf9a7c61 100644 --- a/A3-Antistasi/initServer.sqf +++ b/A3-Antistasi/initServer.sqf @@ -47,10 +47,12 @@ membershipEnabled = if (paramsArray select 2 == 1) then {true} else {false}; pub switchCom = if (paramsArray select 3 == 1) then {true} else {false}; tkPunish = if (paramsArray select 4 == 1) then {true} else {false}; publicVariable "tkPunish"; distanciaMiss = paramsArray select 5; publicVariable "distanciaMiss"; +pvpEnabled = if (paramsArray select 6 == 1) then {true} else {false}; skillMult = paramsArray select 8; publicVariable "skillMult"; minWeaps = paramsArray select 9; civTraffic = paramsArray select 10; publicVariable "civTraffic"; bookedSlots = floor (((paramsArray select 11)/100) * (playableSlotsNumber buenos)); publicVariable "bookedSlots"; +memberDistance = paramsArray select 12; publicVariable "memberDistance"; //waitUntil {!isNil "bis_fnc_preload_init"}; //waitUntil {!isNil "BIS_fnc_preload_server"}; if (loadLastSave) then @@ -133,7 +135,7 @@ private _index = _x call jn_fnc_arsenal_itemType; diag_log "Antistasi MP Server. Arsenal config finished"; [[petros,"hint","Server Init Completed"],"commsMP"] call BIS_fnc_MP; -addMissionEventHandler ["HandleDisconnect",{[_this select 0] call onPlayerDisconnect;false}]; +addMissionEventHandler ["HandleDisconnect",{_this call onPlayerDisconnect;false}]; addMissionEventHandler ["BuildingChanged", { _building = _this select 0; diff --git a/A3-Antistasi/initVar.sqf b/A3-Antistasi/initVar.sqf index 11d31738ed..cb0606cfec 100644 --- a/A3-Antistasi/initVar.sqf +++ b/A3-Antistasi/initVar.sqf @@ -5,7 +5,7 @@ //Not commented lines cannot be changed. //Don't touch them. -antistasiVersion = "v 1.2.2"; +antistasiVersion = "v 1.2.3"; servidoresOficiales = ["A3-Antistasi Official EU 1","A3-Antistasi Official EU 2"]; @@ -351,6 +351,7 @@ zoneCheckInProgress = false; garrisonIsChanging = false; playerHasBeenPvP = []; misiones = []; publicVariable "misiones"; +movingMarker = false; unlockedItems = ["ItemMap","ItemWatch","ItemCompass","FirstAidKit","Medikit","ToolKit","H_Booniehat_khk","H_Booniehat_oli","H_Booniehat_grn","H_Booniehat_dirty","H_Cap_oli","H_Cap_blk","H_MilCap_rucamo","H_MilCap_gry","H_BandMask_blk","H_Bandanna_khk","H_Bandanna_gry","H_Bandanna_camo","H_Shemag_khk","H_Shemag_tan","H_Shemag_olive","H_ShemagOpen_tan","H_Beret_grn","H_Beret_grn_SF","H_Watchcap_camo","H_TurbanO_blk","H_Hat_camo","H_Hat_tan","H_Beret_blk","H_Beret_red","H_Watchcap_khk","G_Balaclava_blk","G_Balaclava_combat","G_Balaclava_lowprofile","G_Balaclava_oli","G_Bandanna_beast","G_Tactical_Black","G_Aviator","G_Shades_Black","acc_flashlight"] + uniformsSDK + civUniforms;//Initial Arsenal available items if (side group petros == independent) then {unlockedItems pushBack "I_UavTerminal"} else {unlockedItems pushBack "B_UavTerminal"}; diff --git a/A3-Antistasi/initZones.sqf b/A3-Antistasi/initZones.sqf index 19b236dc1b..0647885863 100644 --- a/A3-Antistasi/initZones.sqf +++ b/A3-Antistasi/initZones.sqf @@ -113,7 +113,7 @@ if ((_nombre != "") and (_nombre != "Lakatoro01") and (_nombre != "Galili01") an _sizeY = getNumber (configFile >> "CfgWorlds" >> worldName >> "Names" >> (text _x) >> "radiusB"); if (_sizeX > _sizeY) then {_size = _sizeX} else {_size = _sizeY}; _pos = getPos _x; - if (_size < 200) then {_size = 400}; + if (_size < 400) then {_size = 400}; _roads = []; _numCiv = 0; if ((worldName != "Tanoa") and (worldName != "Altis")) then//If Tanoa, data is picked from a DB in initVar.sqf, if not, is built on the fly. @@ -134,7 +134,21 @@ if ((_nombre != "") and (_nombre != "Lakatoro01") and (_nombre != "Galili01") an { _roads = carreteras getVariable _nombre; _numCiv = server getVariable _nombre; - if (isNil "_numCiv") then {hint format ["A mi no me sale en %1",_nombre]}; + if (isNil "_numCiv") then + { + diag_log format ["Antistasi: Error in initZones.sqf. A mi no me sale en %1",_nombre]; + _numCiv = (count (nearestObjects [_pos, ["house"], _size])); + _roadsProv = _pos nearRoads _size; + //_roads = []; + { + _roadcon = roadsConnectedto _x; + if (count _roadcon == 2) then + { + _roads pushBack (getPosATL _x); + }; + } forEach _roadsProv; + carreteras setVariable [_nombre,_roads]; + }; if (typeName _numCiv != typeName 0) then {hint format ["Datos errĂ³neos en %1. Son del tipo %2",_nombre, typeName _numCiv]}; //if (isNil "_roads") then {hint format ["A mi no me sale en %1",_nombre]}; }; diff --git a/A3-Antistasi/onPlayerDisconnect.sqf b/A3-Antistasi/onPlayerDisconnect.sqf index c5b8d7eaf0..2e8b1516f5 100644 --- a/A3-Antistasi/onPlayerDisconnect.sqf +++ b/A3-Antistasi/onPlayerDisconnect.sqf @@ -1,7 +1,7 @@ private ["_unit","_recursos","_hr","_armas","_municion","_items","_pos"]; _unit = _this select 0; - +_uid = _this select 2; _recursos = 0; _hr = 0; @@ -61,11 +61,31 @@ if (_unit == theBoss) then if (side group _unit == buenos) then { if ((_hr > 0) or (_recursos > 0)) then {[_hr,_recursos] spawn resourcesFIA}; - if ([_unit] call isMember) then {playerHasBeenPvP pushBack [getPlayerUID _unit,time]}; + if (membershipEnabled and pvpEnabled) then + { + if (_uid in miembros) then {playerHasBeenPvP pushBack [getPlayerUID _unit,time]}; + }; + //if ([_unit] call isMember) then {playerHasBeenPvP pushBack [getPlayerUID _unit,time]}; }; if ((owner _unit) in hcArray) then { - ["hcDown",true,true,true,true] remoteExec ["BIS_fnc_endMission"] + //["hcDown",true,true,true,true] remoteExec ["BIS_fnc_endMission"] + _owner = owner _unit; + if ({owner _x == _owner} count allUnits > 0) then + { + [] spawn + { + while {true} do + { + [petros,"hint","A Headless Client has been disconnected. This will cause malfunctions. Head back to HQ for saving ASAP and ask and Admin for a restart"] remoteExec ["commsMP"]; + sleep 30; + }; + }; + } + else + { + hcArray = hcArray - [_owner]; + }; } else { diff --git a/A3-Antistasi/orgPlayers/nonMemberDistance.sqf b/A3-Antistasi/orgPlayers/nonMemberDistance.sqf new file mode 100644 index 0000000000..50cc6b730c --- /dev/null +++ b/A3-Antistasi/orgPlayers/nonMemberDistance.sqf @@ -0,0 +1,38 @@ +_cuenta = 61; +while {!([player] call isMember)} do + { + _playerMembers = playableUnits select {([_x] call isMember) and (side group _x == buenos)}; + if !(_playerMembers isEqualTo []) then + { + if (player distance2D (getMarkerPos respawnBuenos) > memberDistance) then + { + _closestMember = [_playerMembers,player] call BIS_fnc_nearestPosition; + if (player distance2d _closestMember > memberDistance) then + { + _cuenta = _cuenta - 1; + } + else + { + _cuenta = 61 + }; + } + else + { + _cuenta = 61; + }; + } + else + { + _cuenta = 61; + }; + if (_cuenta != 61) then + { + hint format ["You have to get closer to the HQ or the closest server member in %1 seconds. \n\n After this timeout you will be teleported to your HQ",_cuenta]; + sleep 1; + if (_cuenta == 0) then {player setPos (getMarkerPos respawnBuenos)}; + } + else + { + sleep 60; + }; + }; \ No newline at end of file diff --git a/A3-Antistasi/tempMoveMrk.sqf b/A3-Antistasi/tempMoveMrk.sqf index 07155f895b..b1a18573c8 100644 --- a/A3-Antistasi/tempMoveMrk.sqf +++ b/A3-Antistasi/tempMoveMrk.sqf @@ -1,4 +1,6 @@ private ["_marcador","_pos","_forzado"]; +waitUntil {!movingMarker}; +movingMarker = true; _marcador = _this select 0; _pos = getMarkerPos _marcador; _forzado = false; @@ -8,4 +10,5 @@ _marcador setMarkerPos [0,0,0]; waitUntil {(spawner getVariable _marcador == 2)}; waitUntil {{_x getVariable [_marcador,false]} count allUnits == 0}; _marcador setMarkerPos _pos; -if (_forzado) then {forcedSpawn pushBackUnique _marcador; publicVariable "forcedSpawn"}; \ No newline at end of file +if (_forzado) then {forcedSpawn pushBackUnique _marcador; publicVariable "forcedSpawn"}; +movingMarker = false; \ No newline at end of file