Jump to content
Sign in to follow this  
john_arma

"class ItemActions" to add attachments

Recommended Posts

Hey guys,

I know for a fact that in this mod if you have a kobra scope and an ak you can get yourself a ak kobra (right click in inventory → "craft ak kobra").

I want to know how to do that in the config, so i opened the config.cpp and found out the code that made it work (class ItemActions ).

I tried doing this on a new mod and it did not work. The code works like this :

Is this a "server side code". How can make it work on the editor with the mod enabled ? Is there a code that remove the weapon in hand + remove the spare attachment in gear and add the new weapon with attachment ?

class M4A1_CCO_SD_FL_DZAM: M4A1_SD_DZAM {
	model = "DIRECTORY";
	displayName = "M4A1 CCO SD FL DZAM";
	picture = "DIECT";
	UiPicture = "DIRECTORY";
	magazines = {"StanagMagSD_DZAM"};
	reloadMagazineSound = {"DIRECTORY", 0.056234, 1, 10};

	class Single: Mode_SemiAuto {
		begin1 = {"DIRECTORY", 1.778279, 1, 1000};
		soundBegin = {"begin1", 1};
		reloadtime = 0.010000;
		recoil = "RH_AKS74URecoil";
		recoilProne = "RH_BizonRecoil";
	};

	class FullAuto: Mode_FullAuto {
		begin1 = {"DIRECTORY", 1.778279, 1, 1000};
		soundBegin = {"begin1", 1};
		recoil = "RH_AKS74URecoil";
		recoilProne = "RH_BizonRecoil";
	};

	class FlashLight {
		color = {0.900000, 0.900000, 0.700000, 0.900000};
		ambient = {0.100000, 0.100000, 0.100000, 1.000000};
		position = "fl_start";
		direction = "fl_dir";
		angle = 30;
		scale = {1, 1, 0.500000};
		brightness = 0.100000;
	};

	[color="#FF0000"]class ItemActions[/color] {

		[b]class CraftCCO[/b] {
			text = "Remove CCO Scope";
			script = "spawn player_weaponatt_cco;";
			woutput = "M4A1_SD_FL_DZAM";
			input = {{"IRONSIGHT_DZAM", 1}};
			ioutput = {{"CCOAIM_DZAM", 1}};
		};

		[b]class CraftACOG[/b] {
			text = "Add ACOG Scope";
			script = "spawn player_weaponatt_acog;";
			woutput = "M4A1_ACOG_SD_FL_DZAM";
			input = {{"ACOG_DZAM", 1}};
			ioutput = {{"CCOAIM_DZAM", 1}};
		};

		[b]class CraftSilencer[/b] {
			text = "Remove Silencer";
			script = "spawn player_weaponatt_silencer;";
			woutput = "M4A1_CCO_FL_DZAM";
			input = {};
			ioutput = {{"556mmSilencer_DZAM", 1}};
		};

		[b]class CraftFlashlight[/b] {
			text = "Remove Flashlight";
			script = "spawn player_weaponatt_flashlight;";
			woutput = "M4A1_CCO_SD_DZAM";
			input = {};
			ioutput = {{"GUNFLASHLIGHT_DZAM", 1}};
		};
	};
};

Thank you for reading,

john-arma

Share this post


Link to post
Share on other sites

EDIT :Hey guys, help me please, i really need to have this working !

I would like to be able to add a scope to the m16 by right-clicking the scope attachment. The scope and the gun will then be removed from the gear, the m16 scoped will then spawn in gear...

How do i do that , is that complex ?

Share this post


Link to post
Share on other sites

I think animalmother made a mission "Hind in sight" that featured silencers going on and off the gun, might be worth checking out! (Requires ACE/ACEX/CBA I belive)

Share this post


Link to post
Share on other sites

Well i just checked them, but found nothing out of the files. There must be someone who knows how it works. I figured some things out myself. I need your help !

class ItemActions {

class CraftCCO {

text = "Remove CCO Scope"; //What is showing up in the gear when right click on Weapon

script = "spawn player_weaponatt_cco;"; //Don't know, maybe it spawns the attachment

woutput = "M4A1_SD_FL_DZAM"; //What is spawning after the action is done

input = {{"IRONSIGHT_DZAM", 1}}; // ???

ioutput = {{"CCOAIM_DZAM", 1}}; // ???

};

};

Share this post


Link to post
Share on other sites

This might be a bit stupid but are you sure your a "Player"? and not "PlayAble"? Also are you just using the editior or actually testing it as a mission beacuse some stuff dont work in the editor...

Share this post


Link to post
Share on other sites

I tried playing it on the editor and on multiplayer but it doesn't work !

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×