Jump to content
riouken

[Working] MP ammo box script

Recommended Posts

Im trying to figure out how to add the Titan At Launcher to the script, i added the line ''_crate addWeaponCargoGlobal ["launch_Titan_AT_F", 50];'' but it doesnt add it to the crate, i am pretty clueless with scripting, but just trying, hope to get response soon

---------- Post added at 08:43 ---------- Previous post was at 08:31 ----------

And i need way more weapons, its for an all out weapon`s range, so i need weapons like the m320, the titan, all that sort of stuff

---------- Post added at 08:46 ---------- Previous post was at 08:43 ----------

plus some mags for the ABR would be nice

Share this post


Link to post
Share on other sites

there is only so mutc room in a box....

why dont use VA???

this addAction ["Open Virtual Arsenal", {["Open",true] spawn BIS_fnc_arsenal}];

just put in INIT for a box

Share this post


Link to post
Share on other sites

This code works great on 2D Editor Preview & self host however I'm having trouble getting this script to work on my dedicated server. I adjusted the codes to only empty out all content of the box 100 time intervals. The purpose for this was to simply promote cleanliness when playing multiplayer. Can anyone take a look and tell me what's wrong? Here's the adjusted code:

/////////   MP Ammo Box script
/////////   By: Riouken
/////////   For Arma 3
/////////
//Put this in the ammo box in game // nul =[this] execVM "ammo_box.sqf"; //
/////////

if (! isServer) exitWith {};


_crate = _this select 0;




while {alive _crate} do
{


clearMagazineCargo _crate;
clearWeaponCargo _crate;
clearItemCargoGlobal _crate;
clearBackpackCargo _crate;

sleep 100;
};

Share this post


Link to post
Share on other sites
/////////   MP Ammo Box script
/////////   By: Riouken
/////////   For Arma 3
/////////
//Put this in the ammo box in game // nul =[this] execVM "ammo_box.sqf"; //
/////////
if (!isServer) exitWith {};
private "_crate";

_crate = _this select 0;


while {alive _crate} do
{


clearMagazineCargoGlobal _crate;
clearWeaponCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

sleep 100;
};

For what you need always empty box?

Share this post


Link to post
Share on other sites

For what you need always empty box?

 

 

Well, we would like to use the template for our members to hop on and play throughout the day. We opted not to use a cleaning script for reasons that do not really matter. What we want is a box that empties out it's content every few minutes. 

 

On that note I believe I found a solution, since it's running on a dedicated server, the line:

if (!isServer) exitWith {};

Must be replaced with:

if (isDedicated) exitWith {};

Share this post


Link to post
Share on other sites
if (!isServer) exitWith {};

Must be replaced with:

if (isDedicated) exitWith {};

 

That is incorrect.

 

The script needs to run on the server, so:

if (!isServer) exitWith {}; 

is correct

 

You'll need to use the Global commands to clear/add items to the crate. The global commands are MP synched.

clearWeaponCargoGlobal _crate; 
clearMagazineCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

Share this post


Link to post
Share on other sites

 

That is incorrect.

 

The script needs to run on the server, so:

if (!isServer) exitWith {}; 

is correct

 

You'll need to use the Global commands to clear/add items to the crate. The global commands are MP synched.

clearWeaponCargoGlobal _crate; 
clearMagazineCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

 

Worked like a charm! Thank you whiztler!

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

×