Jump to content
Sign in to follow this  
-ami- mofo

MP Ammo box not working - can't find a solution yet

Recommended Posts

Hi guys I had this which worked fine for everyone a couple of months ago...

/AMMO CRATE WEST

//place in init line of object to contain ammo:- null0 = this execVM "Scripts\ammo_west.sqf";

waituntil {time>0};

ClearWeaponCargo _this; 
ClearMagazineCargo _this; 
ClearItemCargo _this;
ClearBackpackCargo _this;



// EQUIPMENT
//_this addItemCargo ["NVGoggles",6];
_this addItemCargo ["ItemGPS",6];
_this addItemcargo ["ToolKit",1];
_this addItemcargo ["MediKit",1];
_this addItemcargo ["B_UAVTerminal",1];
_this addItemcargo ["MineDetector",2];
_this addItemcargo ["FirstAidKit",18];





// ASSAULT RIFLES
_this addWeaponCargo ["arifle_TRG20_F",3];
_this addWeaponCargo ["arifle_TRG21_F",3];
_this addWeaponCargo ["arifle_TRG21_GL_F",3];
_this addWeaponCargo ["arifle_MX_F",3];
_this addWeaponCargo ["arifle_MX_GL_F",3];
_this addWeaponCargo ["arifle_MXC_F",3];
_this addWeaponCargo ["arifle_MXM_F",3];
_this addWeaponCargo ["srifle_EBR_F",3];




// SUBMACHINE GUNS
_this addWeaponCargo ["SMG_01_F",2];





// LIGHT MACHINE GUNS
_this addWeaponCargo ["arifle_MX_SW_F",1];
_this addWeaponCargo ["LMG_Mk200_F",1];



// SNIPER RIFLES
_this addWeaponCargo ["srifle_LRR_f",2];



// LAUNCHERS
_this addWeaponCargo ["launch_Titan_F",2];
_this addWeaponCargo ["launch_Titan_short_F",2];





// OPTICS - WEAPON ATTACHMENTS
_this addWeaponCargo ["Binocular",6];
_this addWeaponCargo ["Rangefinder",2];
_this addWeaponCargo ["LaserDesignator",2];
_this addItemCargo ["optic_LRPS",2];
_this addItemCargo ["optic_Nightstalker",2];
_this addItemCargo ["optic_tws",2];
_this addItemCargo ["optic_tws_mg",2];
_this addItemCargo ["optic_Arco",6];
_this addItemCargo ["optic_Hamr",6];
_this addItemCargo ["muzzle_snds_H",6];
_this addItemCargo ["muzzle_snds_H_MG",1];
_this addItemCargo ["muzzle_snds_M",6];
_this addItemCargo ["muzzle_snds_B",6];
_this addItemCargo ["muzzle_snds_ACP",6];
_this additemcargo ["acc_pointer_IR",6];
_this addItemCargo ["acc_flashlight",6];




// AMMO
_this addMagazineCargo ["7Rnd_408_Mag",20];
_this addMagazineCargo ["30Rnd_556x45_Stanag",50];
_this addMagazineCargo ["30Rnd_65x39_caseless_mag",50];
_this addMagazineCargo ["100Rnd_65x39_caseless_mag_Tracer",5];
_this addMagazineCargo ["200Rnd_65x39_cased_Box_Tracer",3];
_this addMagazineCargo ["30Rnd_45ACP_Mag_SMG_01",20];
_this addMagazineCargo ["20Rnd_762x51_Mag",20];
_this addMagazineCargo ["Titan_AT",6];
_this addMagazineCargo ["Titan_AA",6];





// ORDNANCE - SMOKE - FLARES
_this addMagazineCargo ["DemoCharge_Remote_Mag",6];
_this addMagazineCargo ["SatchelCharge_Remote_Mag",6];
_this addmagazineCargo ["ATMine_Range_Mag",6];
_this addmagazineCargo ["APERSBoundingMine_Range_Mag",6];
_this addMagazineCargo ["HandGrenade",12];
_this addMagazineCargo ["1Rnd_HE_Grenade_shell",6];
_this addmagazinecargo ["SmokeShellRed",6];
_this addMagazineCargo ["UGL_FlareWhite_F",6];



_this addBackpackCargo ["B_UAV_01_backpack_F",1];
_this addBackpackCargo ["B_Parachute",6];

It sort of still works for me who's hosting the co-op mission on my PC but doesn't work at all for other players. They just see the standard stuff that comes in the supply crate. I can see all the items but I had my GPS disappear the other night from a friend who JIP'd. So a bit of weirdness going on even for me as well.

I understand that BIS may have sneak'd in a change regarding the add-blah-cargo description? I tried adding 'global' to the descriptions as somebody suggested on some other site but that made no difference.

So does anyone know how I get this to work again please? It's bork'd my missions big time :(

Thanks.

Share this post


Link to post
Share on other sites
Hi guys I had this which worked fine for everyone a couple of months ago...
/AMMO CRATE WEST

//place in init line of object to contain ammo:- null0 = this execVM "Scripts\ammo_west.sqf";

Thanks.

Don't put the this execVM "Scripts/...." etc in the init line of the ammo box. Just copy and paste the bulk of code where you clear the items and add items directly into the ammo boxs init line. And make sure you add global to the end of each scripts. It will make a difference.

When I made custom ammo boxes for multiplayer that is how I did it. Do everything in the init line of the box itself. Hope that helps.

Share this post


Link to post
Share on other sites

add 'Global' to all of your Cargo entries... 'addWeaponCargoGlobal'

https://community.bistudio.com/wiki/addWeaponCargoGlobal

Description: [i]Add weapons to the cargo space of vehicles, which can be taken out by infantry units. MP Synchronized[/i]

edit: Just saw that you tried it. Must be something else, but you do need global in there for it to work. Did you add global to your remove commands? Not sure if that would work or not. I'd try it both ways.

https://community.bistudio.com/wiki/clearWeaponCargoGlobal

Description: [i]Removes all weapons from the vehicle cargo space. MP synchronized[/i]

Edited by BadHabitz

Share this post


Link to post
Share on other sites

Thanks guys the I tried the "Global" again and it worked. I must've done something stupid before like spelling it wrong in the 1st place and copying it >.<

The only problem I had after that was the number of items was acting strange like doubling for me but not for the other client but I fixed that by replacing

waituntil {time>0};

with

if (!isServer) exitWith {};

Now everyone see's the same number of items to start with and when something is removed from the box everyone else see's it removed as well so it all adds up perfectly ;)

Looks like this now....

//AMMO CRATE WEST

//place in init line of object to contain ammo:- null0 = this execVM "Scripts\ammo_west.sqf";

if (!isServer) exitWith {};

ClearWeaponCargoGlobal _this; 
ClearMagazineCargoGlobal _this; 
ClearItemCargoGlobal _this;
ClearBackpackCargoGlobal _this;



// EQUIPMENT
//_this addItemCargoGlobal ["NVGoggles",6];
_this addItemCargoGlobal ["ItemGPS",6];
_this addItemcargoGlobal ["ToolKit",1];
_this addItemcargoGlobal ["MediKit",1];
_this addItemcargoGlobal ["B_UAVTerminal",1];
_this addItemcargoGlobal ["MineDetector",2];
_this addItemcargoGlobal ["FirstAidKit",18];





// ASSAULT RIFLES
_this addWeaponCargoGlobal ["arifle_TRG20_F",3];
_this addWeaponCargoGlobal ["arifle_TRG21_F",3];
_this addWeaponCargoGlobal ["arifle_TRG21_GL_F",3];
_this addWeaponCargoGlobal ["arifle_MX_F",3];
_this addWeaponCargoGlobal ["arifle_MX_GL_F",3];
_this addWeaponCargoGlobal ["arifle_MXC_F",3];
_this addWeaponCargoGlobal ["arifle_MXM_F",3];
_this addWeaponCargoGlobal ["srifle_EBR_F",3];




// SUBMACHINE GUNS
_this addWeaponCargoGlobal ["SMG_01_F",2];





// LIGHT MACHINE GUNS
_this addWeaponCargoGlobal ["arifle_MX_SW_F",1];
_this addWeaponCargoGlobal ["LMG_Mk200_F",1];



// SNIPER RIFLES
_this addWeaponCargoGlobal ["srifle_LRR_f",2];



// LAUNCHERS
_this addWeaponCargoGlobal ["launch_Titan_F",2];
_this addWeaponCargoGlobal ["launch_Titan_short_F",2];





// OPTICS - WEAPON ATTACHMENTS
_this addWeaponCargoGlobal ["Binocular",6];
_this addWeaponCargoGlobal ["Rangefinder",2];
_this addWeaponCargoGlobal ["LaserDesignator",2];
_this addItemCargoGlobal ["optic_LRPS",2];
_this addItemCargoGlobal ["optic_Nightstalker",2];
_this addItemCargoGlobal ["optic_tws",2];
_this addItemCargoGlobal ["optic_tws_mg",2];
_this addItemCargoGlobal ["optic_Arco",6];
_this addItemCargoGlobal ["optic_Hamr",6];
_this addItemCargoGlobal ["muzzle_snds_H",6];
_this addItemCargoGlobal ["muzzle_snds_H_MG",1];
_this addItemCargoGlobal ["muzzle_snds_M",6];
_this addItemCargoGlobal ["muzzle_snds_B",6];
_this addItemCargoGlobal ["muzzle_snds_ACP",6];
_this additemcargoGlobal ["acc_pointer_IR",6];
_this addItemCargoGlobal ["acc_flashlight",6];




// AMMO
_this addMagazineCargoGlobal ["7Rnd_408_Mag",20];
_this addMagazineCargoGlobal ["30Rnd_556x45_Stanag",50];
_this addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag",50];
_this addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag_Tracer",5];
_this addMagazineCargoGlobal ["200Rnd_65x39_cased_Box_Tracer",3];
_this addMagazineCargoGlobal ["30Rnd_45ACP_Mag_SMG_01",20];
_this addMagazineCargoGlobal ["20Rnd_762x51_Mag",20];
_this addMagazineCargoGlobal ["Titan_AT",6];
_this addMagazineCargoGlobal ["Titan_AA",6];





// ORDNANCE - SMOKE - FLARES
_this addMagazineCargoGlobal ["DemoCharge_Remote_Mag",6];
_this addMagazineCargoGlobal ["SatchelCharge_Remote_Mag",6];
_this addmagazineCargoGlobal ["ATMine_Range_Mag",6];
_this addmagazineCargoGlobal ["APERSBoundingMine_Range_Mag",6];
_this addMagazineCargoGlobal ["HandGrenade",12];
_this addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell",6];
_this addmagazinecargoGlobal ["SmokeShellRed",6];
_this addMagazineCargoGlobal ["UGL_FlareWhite_F",6];



_this addBackpackCargoGlobal ["B_UAV_01_backpack_F",1];
_this addBackpackCargoGlobal ["B_Parachute",6];

Only thing I have a little problem with is that the ammo box is 1/3 buried under ground for other players but not for me the host. Why is that? Not that important but while I'm here does anyone know a fix for that?

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  

×