Jump to content
  • 0

how to disable weapon in armed vehicule


fr3d0

Question

bonjour,

hi, I would like to know if it's possible to disable weapon on armed vehicule

.I 'd like to keep those vehicule on my server but I don't want  players use those weapons.

 

maybe spawning and bying vehicule without ammo and disable ammo from loot table and trader.

But how ????

 

happy new year programmers....

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

So the link I posted works. I tested. Any vehicle in the hive on restart gets stripped of its weapons,ammo....ect. What I am wondering is there anyway to have this god execute when a vehicle spawns. For example can I get the code to apply to a vehicle as it is purchased at a trader?

Link to comment
Share on other sites

  • 0

my adventures into removing weapons from vehicles...

 

http://dayzepoch.com/forum/index.php?/topic/3224-help-removing-ammo-from-placed-vehicles/

 

the post that helped me fix it all

 

http://dayzepoch.com/forum/index.php?/topic/2519-vehicle-ammo/#entry19046

 

the last post explains how to setup a list of vehicles that you want to remove weapons from, then executing that list every time the vehicle is placed, when you buy it, when the server places it on the map at server start, and when the server places it on the map.

 

Its quite useful, I am currently using it to allow me to add a lot of fun vehicles with out giving my players super weapons. here is my vehicle list.

/*
Remove Ammo Script

ref: http://dayzepoch.com/forum/index.php?/topic/2519-vehicle-ammo/#entry19046
six: http://browser.six-projects.net/cfg_vehicles/classlist?utf8=%E2%9C%93&version=63&commit=Change&options[group_by]=faction&options[sort_by]=name&options[faction]=&options[vehicleclass]=Air

private ["_classname","_vehicle"];

_classname = _this select 0;
_vehicle = _this select 1;

if(_classname == "AAAA") then {
	_vehicle removeMagazinesTurret ["BBBB",[CCCC]];
};

*/

private ["_classname","_vehicle"];

_classname = _this select 0;
_vehicle = _this select 1;

if(_classname == "F35B") then {
	_vehicle removeMagazinesTurret ["2Rnd_GBU12",[-1]];
	_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_F35",[-1]];
};

if(_classname == "AH1Z") then {
	_vehicle removeMagazinesTurret ["38Rnd_FFAR", [-1]];
	_vehicle removeMagazinesTurret ["38Rnd_FFAR", [0]];
	_vehicle removeMagazinesTurret ["8Rnd_Hellfire", [0]]; 
	_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z", [0]]; 
};

if(_classname == "Ka52Black") then {
	_vehicle removeMagazinesTurret ["40Rnd_80mm", [-1]]; sleep 0.2; 
	_vehicle removeMagazinesTurret ["12Rnd_Vikhr_KA50", [0]]; 
	_vehicle removeMagazinesTurret ["230Rnd_30mmHE_2A42", [-1]];
};
	
if(_classname == "Ka52") then {
	_vehicle removeMagazinesTurret ["40Rnd_80mm", [-1]]; 
	_vehicle removeMagazinesTurret ["230Rnd_30mmHE_2A42", [0]]; 
	_vehicle removeMagazinesTurret ["230Rnd_30mmAP_2A42", [0]];
	_vehicle removeMagazinesTurret ["12Rnd_Vikhr_KA50", [0]];
};

if(_classname == "A10") then {
	_vehicle removeMagazinesTurret ["1350Rnd_30mmAP_A10", [-1]]; 
	_vehicle removeMagazinesTurret ["2Rnd_Maverick_A10", [-1]]; 
	_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z", [-1]]; 
	_vehicle removeMagazinesTurret ["4Rnd_GBU12", [-1]]; 
	_vehicle removeMagazinesTurret ["14Rnd_FFAR", [-1]];
};

if(_classname == "AW159_Lynx_BAF") then {
	_vehicle removeMagazinesTurret ["12Rnd_CRV7", [-1]];
};

if(_classname == "Ka60_GL_PMC") then {
	_vehicle removeMagazinesTurret ["14Rnd_57mm", [-1]];
	_vehicle removeMagazinesTurret ["6Rnd_HE_M203_heli", [0]];
};

if(_classname == "Ka60_PMC") then {
	_vehicle removeMagazinesTurret ["14Rnd_57mm", [-1]];
};

if(_classname == "AH6J_EP1") then {
	_vehicle removeMagazinesTurret ["14Rnd_FFAR", [-1]];
//	_vehicle removeMagazinesTurret ["4000Rnd_762x51_M134", [-1]];
};

if(_classname == "AV8B2") then {
	_vehicle removeMagazinesTurret ["14Rnd_FFAR", [-1]];
	_vehicle removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z", [-1]];
	_vehicle removeMagazinesTurret ["6Rnd_Mk82", [-1]];
};

if(_classname == "AV8B") then {
	_vehicle removeMagazinesTurret ["300Rnd_25mm_GAU12", [-1]];
	_vehicle removeMagazinesTurret ["6Rnd_GBU12_AV8B", [-1]];
};

if(_classname == "AH64D") then {
	_vehicle removeMagazinesTurret ["38Rnd_FFAR", [-1]];
	_vehicle removeMagazinesTurret ["38Rnd_FFAR", [0]];
	_vehicle removeMagazinesTurret ["8Rnd_Hellfire", [0]]; 
	_vehicle removeMagazinesTurret ["8Rnd_Hellfire", [-1]]; 
};

if(_classname == "Mi24_D") then {
	_vehicle removeMagazinesTurret ["4Rnd_AT2_Mi24D", [0]];
	_vehicle removeMagazinesTurret ["4Rnd_AT2_Mi24D", [-1]];
	_vehicle removeMagazinesTurret ["128Rnd_57mm", [-1]];
	_vehicle removeMagazinesTurret ["128Rnd_57mm", [0]];
};


you will see and explanation comment section at the top and some links to sites i use to run the code or fine the magazine name for the weapon. also you will see a lot of vehicles added into the list. with everything i either remove everything or everything except the machine gun/turret.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...