Jump to content
Sign in to follow this  
khaosmatical

Weapon Crate Restrictions

Recommended Posts

Hi there, currently in our missions we normally have restricted weapons so like we all are using M16s, M249s ,etc. We don't role with pre-defined Fire Teams or anything either so doing a personalized loadout with an optic is impossible. I'm trying to find a way so people can choose what optic they have in our sessions and although we can rely on the trust of people sticking to the weapons they are giving but just changing the optics, it would be nice to actually have a thing on the box they get them from to stop it so that only a player of a certain class could get a list of weapons like a Grenadier being the only one able to get a weapon with a Grenade Launcher.

Not so much a complete restriction for the whole mission, just in that weapon box. Any help or ideas would be greatly appreciated. Thanks.

Share this post


Link to post
Share on other sites

Yes you can do that it will need to be a script. I personally have no clue how you could script that. Domination type missions with a rank system has a script for restriction weapons for rank. You may want to look into the rank system of domination to see how the script works to give you some direction.

Share this post


Link to post
Share on other sites

Different Ammobox v 1.0 by Demonized

/*
Different Ammobox v 1.0
by Demonized.

1: place a marker named DMZ_DA anywhere you want the players to see their ammobox, all will see their box in same position.
2: place this in init line of any unit.
	_null = this execVM "DMZ_DA.sqf";
3: save this script as DMZ_DA.sqf and place it in your mission folder.

For more classnames on ammoboxes or weapons and magazines go here:
	http://forums.bistudio.com/showthread.php?t=73241&page=2
*/
if (!isDedicated) then 
{
waitUntil {(player == player)&&(alive player)};
};

_marker = "DMZ_DA";  // marker used to spawn.
_boxType = "USSpecialWeaponsBox";  // the type of ammobox used.
_timer = 1500;  // time in seconds until box is refilled.

if (_this != player) exitWith {};  // exit all other clients.
_weapons = []; _magazines = [];

// load available to unitname1 only.
if (player isKindOf "USMC_SoldierS_Engineer") then {
_weapons = 
[
	["M4A1_AIM",1],
	["G36C",1],
	["m16a4",1],
	["M1014",1],
	["M9",1] // notice that there is no , at the end of the last weapon.
];

_magazines = 
[
	["30Rnd_556x45_Stanag",40],
	["30Rnd_556x45_G36",20],
	["8Rnd_B_Beneli_74Slug",20],
	["15Rnd_9x19_M9",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20],
	["Mine",20] // notice that there is no , at the end of the last magazine.

];
};

// load available to unitname2 only.
if (player isKindOf "FR_Marksman") then {
_weapons = 
[
	["M24",1],
	["M40A3",1],
	["DMR",1],
	["M107",1],
	["M4SPR",1],
	["M9SD",1],
	["M8_sharpshooter",1]

];

_magazines = 
[
	["20Rnd_762x51_DMR",20],
	["10Rnd_127x99_m107",20],
	["5Rnd_762x51_M24",40],
	["20Rnd_556x45_Stanag",20],
	["30Rnd_556x45_G36",20],
	["15Rnd_9x19_M9SD",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};

// load available to unitname3 only.
if (player isKindOf "FR_R") then {
_weapons = 
[
	["M4A1_AIM_SD_camo",1],
	["Laserdesignator",1],
	["MP5SD",1],
	["G36_C_SD_eotech",1]

];

_magazines = 
[
	["30Rnd_556x45_StanagSD",20],
	["PipeBomb",10],
	["30Rnd_556x45_G36SD",20],
	["15Rnd_9x19_M9SD",20],
	["30Rnd_9x19_MP5SD",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
	["Laserbatteries",1],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};

// load available to unitname4 only.
if (player isKindOf "USMC_Soldier_AT") then {
_weapons = 
[
	["m16a4",1],
	["M4A1",1],
	["G36C",1],
	["Colt1911",1],
	["M136",1],
	["SMAW",1],
	["Stinger",1],
	["M1014",1]

];

_magazines = 
[
	["8Rnd_B_Beneli_74Slug",20],
	["30Rnd_556x45_Stanag",40],
	["30Rnd_556x45_G36",20],
	["7Rnd_45ACP_1911",20],
	["M136",10],
	["SMAW_HEAA",10],
	["SMAW_HEDP",10],
	["Stinger",10],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};

// load available to unitname5 only.
if (player isKindOf "USMC_Soldier_Pilot") then {
_weapons = 
[
	["MP5A5",1],
	["G36C",1],
	["Colt1911",1]

];

_magazines = 
[
	["30Rnd_9x19_MP5",20],
	["30Rnd_556x45_G36",20],
	["7Rnd_45ACP_1911",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};

// load available to unitname6 only.
if (player isKindOf "FR_Assault_GL") then {
_weapons = 
[
	["M16A2GL",1],
	["M16A4_GL",1],
	["M16A4_ACG_GL",1],
	["M4A1_HWS_GL",1],
	["M4A1_HWS_GL_camo",1],
	["M4A1_RCO_GL",1],
	["M8_carbineGL",1],
	["Colt1911",1]

];

_magazines = 
[
	["30Rnd_556x45_Stanag",80],
	["30Rnd_556x45_G36",20],
	["7Rnd_45ACP_1911",20],
	["1Rnd_HE_M203",50],
	["FlareWhite_M203",20],
	["FlareGreen_M203",20],
	["FlareRed_M203",20],
	["FlareYellow_M203",20],
	["1Rnd_Smoke_M203",20],
	["1Rnd_SmokeRed_M203",20],
	["1Rnd_SmokeGreen_M203",20],
	["1Rnd_SmokeYellow_M203",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};

// load available to unitname6 only.
if (player isKindOf "FR_AR") then {
_weapons = 
[
	["MG36",1],
	["Mk_48",1],
	["M240",1],
	["M249",1],
	["M8_SAW",1],
	["M9SD",1]

];

_magazines = 
[
	["100Rnd_556x45_BetaCMag",40],
	["100Rnd_762x51_M240",40],
	["15Rnd_9x19_M9SD",20],
	["200Rnd_556x45_M249",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};

// load available to unitname7 only.
if (player isKindOf "FR_Corpsman") then {
_weapons = 
[
	["M4A1_Aim_camo",1],
	["M4A1_Aim",1],
	["M4A1",1],
	["M8_compact",1],
	["M9SD",1]

];

_magazines = 
[
	["30Rnd_556x45_Stanag",60],
	["30Rnd_556x45_G36",40],
	["15Rnd_9x19_M9SD",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];
};
if (player isKindOf "FR_Commander") then {
_weapons = 
[
	["M4A1_Aim_camo",1],
	["M4A1_Aim",1],
	["M4A1",1],
	["MP5A5",1],
	["M9",1]

];

_magazines = 
[
	["30Rnd_556x45_Stanag",20],
	["PipeBomb",10],
	["30Rnd_9x19_MP5",20],
	["15Rnd_9x19_M9",20],
	["HandGrenade_West",20],
	["SmokeShell",20],
       ["SmokeShellRed",20],
       ["SmokeShellGreen",20],
       ["SmokeShellYellow",20] // notice that there is no , at the end of the last magazine.
];


};

// create and fill the box.
_box = _boxType createVehicleLocal (getMarkerPos _marker);
_box allowDamage false;_box setVariable ["R3F_LOG_disabled", true];

while {true} do {
// empty it.
clearWeaponCargo _box;
clearMagazineCargo _box;

// add in all weapons.
{_box addWeaponCargo [(_x select 0),(_x select 1)]} foreach _weapons;

// add in all magazines.
{_box addMagazineCargo [(_x select 0),(_x select 1)]} foreach _magazines;

// wait x amount of seconds then refill box.
sleep _timer;
};

http://forums.bistudio.com/showthread.php?123831-Weapon-and-Magazine-Limit-Script&highlight=Ammobox+1.0+Demonized

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  

×