diff --git a/Server_Install_Pack/@epochhive/epochconfig.hpp b/Server_Install_Pack/@epochhive/epochconfig.hpp index 3e0b9573..6af055c9 100644 --- a/Server_Install_Pack/@epochhive/epochconfig.hpp +++ b/Server_Install_Pack/@epochhive/epochconfig.hpp @@ -30,6 +30,15 @@ cloneCost = 100; // debt incurred on player death // vehicles - Max vehicle slots is calculated from per vehicle limits below. Warning! Higher the number lower the performance. simulationHandlerOld = false; // When enabled this feature disables simulation on vehicles that are not nea players. Can help improve client fps at the cost of server fps. vehicleLockTime = 1800; // Controls how many seconds it takes to allow another person/group to unlock vehicle. +removevehweapons[] = { // remove these Weapons from spawned Vehicles + "missiles_DAR","gatling_30mm","gatling_20mm","missiles_DAGR","cannon_30mm_Plane_CAS_02_F","Missile_AA_03_Plane_CAS_02_F","Missile_AGM_01_Plane_CAS_02_F","Rocket_03_HE_Plane_CAS_02_F", + "Rocket_03_AP_Plane_CAS_02_F","Bomb_03_Plane_CAS_02_F","Bomb_04_Plane_CAS_01_F","Rocket_04_AP_Plane_CAS_01_F","Rocket_04_HE_Plane_CAS_01_F","Missile_AGM_02_Plane_CAS_01_F","Missile_AA_04_Plane_CAS_01_F", + "Gatling_30mm_Plane_CAS_01_F","GBU12BombLauncher_Plane_Fighter_03_F","missiles_ASRAAM","missiles_SCALPEL","Twin_Cannon_20mm","missiles_Zephyr","rockets_skyfire","gatling_30mm_vtol_02" +}; +removevehmagazinesturret[] = { // Remove these Magazines from the given Turret from spawned Vehicles + {"24Rnd_missiles",{-1}}, + {"200Rnd_40mm_G_belt",{0}} +}; // Traders taxRate = 0.1; // controls the price increase for purchases diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf index d23544cd..046821de 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf @@ -12,7 +12,7 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf */ -private ["_availableColorsConfig","_location","_class","_dmg","_actualHitpoints","_hitpoints","_textures","_color","_colors","_textureSelectionIndex","_selections","_count","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_found","_vehicle","_allHitpoints","_cfgEpochVehicles","_worldspace","_damage","_arr","_arrNum","_vehicleSlotIndex","_vehHiveKey","_response","_diag","_dataFormat","_dataFormatCount","_allVehicles","_serverSettingsConfig"]; +private ["_removeweapons","_removemagazinesturret","_availableColorsConfig","_location","_class","_dmg","_actualHitpoints","_hitpoints","_textures","_color","_colors","_textureSelectionIndex","_selections","_count","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_found","_vehicle","_allHitpoints","_cfgEpochVehicles","_worldspace","_damage","_arr","_arrNum","_vehicleSlotIndex","_vehHiveKey","_response","_diag","_dataFormat","_dataFormatCount","_allVehicles","_serverSettingsConfig"]; params [["_maxVehicleLimit",0]]; _diag = diag_tickTime; @@ -24,6 +24,8 @@ _vehicleDamages = []; _serverSettingsConfig = configFile >> "CfgEpochServer"; _simulationHandler = [_serverSettingsConfig, "simulationHandlerOld", false] call EPOCH_fnc_returnConfigEntry; +_removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry; +_removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry; for "_i" from 1 to _maxVehicleLimit do { _vehicleSlotIndex = EPOCH_VehicleSlots pushBack str(_i); @@ -109,6 +111,18 @@ for "_i" from 1 to _maxVehicleLimit do { clearMagazineCargoGlobal _vehicle; clearBackpackCargoGlobal _vehicle; clearItemCargoGlobal _vehicle; + + if !(_removeweapons isequalto []) then { + { + _vehicle removeWeaponGlobal _x; + } foreach _removeweapons; + }; + if !(_removemagazinesturret isequalto []) then { + { + _vehicle removeMagazinesTurret _x; + } foreach _removemagazinesturret; + }; + { _objType = _forEachIndex; _objTypes = _x; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf index ff478b27..04f0f00b 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf @@ -12,7 +12,7 @@ Github: https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf */ -private ["_location","_class","_dmg","_actualHitpoints","_hitpoints","_textures","_color","_colors","_textureSelectionIndex","_selections","_count","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_found","_vehicle","_allHitpoints","_config","_worldspace","_damage","_arr","_arrNum","_vehicleSlotIndex","_vehHiveKey","_response","_immuneVehicleSpawnTime","_diag","_dataFormat","_dataFormatCount","_allVehicles","_serverSettingsConfig","_simulationHandler","_immuneVehicleSpawn"]; +private ["_removeweapons","_removemagazinesturret","_location","_class","_dmg","_actualHitpoints","_hitpoints","_textures","_color","_colors","_textureSelectionIndex","_selections","_count","_objTypes","_objQty","_wMags","_wMagsArray","_attachments","_magazineSizeMax","_magazineName","_magazineSize","_qty","_objType","_marker","_found","_vehicle","_allHitpoints","_config","_worldspace","_damage","_arr","_arrNum","_vehicleSlotIndex","_vehHiveKey","_response","_immuneVehicleSpawnTime","_diag","_dataFormat","_dataFormatCount","_allVehicles","_serverSettingsConfig","_simulationHandler","_immuneVehicleSpawn"]; params [["_maxVehicleLimit",0]]; _diag = diag_tickTime; @@ -24,6 +24,8 @@ _allVehicles = []; _serverSettingsConfig = configFile >> "CfgEpochServer"; _simulationHandler = [_serverSettingsConfig, "simulationHandlerOld", false] call EPOCH_fnc_returnConfigEntry; _immuneVehicleSpawn = [_serverSettingsConfig, "immuneVehicleSpawn", false] call EPOCH_fnc_returnConfigEntry; +_removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry; +_removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry; for "_i" from 1 to _maxVehicleLimit do { _vehicleSlotIndex = EPOCH_VehicleSlots pushBack str(_i); @@ -116,6 +118,17 @@ for "_i" from 1 to _maxVehicleLimit do { clearBackpackCargoGlobal _vehicle; clearItemCargoGlobal _vehicle; + if !(_removeweapons isequalto []) then { + { + _vehicle removeWeaponGlobal _x; + } foreach _removeweapons; + }; + if !(_removemagazinesturret isequalto []) then { + { + _vehicle removeMagazinesTurret _x; + } foreach _removemagazinesturret; + }; + _vehicle disableTIEquipment true; _vehicle lock true; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf index 2957198c..240cf899 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf @@ -12,9 +12,12 @@ Github: https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_vehicle/EPOCH_spawn_vehicle.sqf */ -private ["_maxDamage","_textures","_textureSelectionIndex","_selections","_colors","_color","_count","_vehLockHiveKey","_marker","_cfgEpochVehicles","_vehObj"]; +private ["_removeweapons","_removemagazinesturret","_maxDamage","_textures","_textureSelectionIndex","_selections","_colors","_color","_count","_vehLockHiveKey","_marker","_cfgEpochVehicles","_vehObj"]; params ["_vehClass","_position","_direction","_locked","_slot",["_lockOwner",""],["_can_collide","CAN_COLLIDE"],["_spawnLoot",false],["_spawnDamaged",true]]; if !(isClass (configFile >> "CfgVehicles" >> _vehClass)) exitWith {objNull}; +_serverSettingsConfig = configFile >> "CfgEpochServer"; +_removeweapons = [_serverSettingsConfig, "removevehweapons", []] call EPOCH_fnc_returnConfigEntry; +_removemagazinesturret = [_serverSettingsConfig, "removevehmagazinesturret", []] call EPOCH_fnc_returnConfigEntry; _vehObj = createVehicle[_vehClass, _position, [], 0, _can_collide]; if !(isNull _vehObj) then{ _vehObj call EPOCH_server_setVToken; @@ -32,6 +35,17 @@ if !(isNull _vehObj) then{ clearBackpackCargoGlobal _vehObj; clearItemCargoGlobal _vehObj; + if !(_removeweapons isequalto []) then { + { + _vehObj removeWeaponGlobal _x; + } foreach _removeweapons; + }; + if !(_removemagazinesturret isequalto []) then { + { + _vehObj removeMagazinesTurret _x; + } foreach _removemagazinesturret; + }; + // Disable Termal Equipment _vehObj disableTIEquipment true; diff --git a/Sources/epoch_server/init/server_securityfunctions.sqf b/Sources/epoch_server/init/server_securityfunctions.sqf index e070a7e6..6ff20ed8 100644 --- a/Sources/epoch_server/init/server_securityfunctions.sqf +++ b/Sources/epoch_server/init/server_securityfunctions.sqf @@ -1134,6 +1134,9 @@ call compile ("'"+_skn_doAdminRequest+"' addPublicVariableEventHandler { _return = false; if (_item isKindOf 'Air' || _item isKindOf 'Ship' || _item isKindOf 'LandVehicle') then { if !(EPOCH_VehicleSlots isEqualTo[]) then { + _serverSettingsConfig = configFile >> 'CfgEpochServer'; + _removeweapons = [_serverSettingsConfig, 'removevehweapons', []] call EPOCH_fnc_returnConfigEntry; + _removemagazinesturret = [_serverSettingsConfig, 'removevehmagazinesturret', []] call EPOCH_fnc_returnConfigEntry; _position = getPosATL _target; _slot = EPOCH_VehicleSlots select 0; @@ -1151,6 +1154,18 @@ call compile ("'"+_skn_doAdminRequest+"' addPublicVariableEventHandler { clearMagazineCargoGlobal _vehObj; clearBackpackCargoGlobal _vehObj; clearItemCargoGlobal _vehObj; + + if !(_removeweapons isequalto []) then { + { + _vehObj removeWeaponGlobal _x; + } foreach _removeweapons; + }; + if !(_removemagazinesturret isequalto []) then { + { + _vehObj removeMagazinesTurret _x; + } foreach _removemagazinesturret; + }; + _vehObj lock true; _playerUID = getPlayerUID _target;