Jump to content
Sign in to follow this  
jandrews

Ammo box scrolling ??

Recommended Posts

hey all, have a question, this ammo drop works fine except for when a player scrolls through the contents. While scrolling the items move very fast and am unable to take items out of crate AND it seems to reset every few seconds and restarts the player at beginning of crate items list. Its very annoying and wonder if I can add/change/ do something to fix this.

code below.

// Use game logic markers
// nul = [] execVM "AmmoDrop.sqf";

if (! isServer) exitWith {};

// random position for supply drop
_drop = getPos ([drop1, drop2, drop3, drop4, drop5, drop6, drop7, drop8, drop9, drop10] call BIS_fnc_selectRandom);

// add marker 
_marker = createMarker ["Supply", _drop];
_marker setMarkerType "hd_join";
_marker setMarkerColor "ColorWEST";
_marker setMarkerText "Nato Supply Drop";
_marker setMarkerSize [1,1];

_rndPos = [getMarkerPos _marker,5,10,15,0,0.5,0,[],[]] call BIS_fnc_findSafePos;

_rndPos set [2, 0];
_chute = createVehicle ["NonSteerable_Parachute_F",[(_rndPos select 0), (_rndPos select 1), ((_rndPos select 2) + 150)],[], 0, "CAN_COLLIDE"];

_crate = createVehicle ["B_supplyCrate_F",[(_rndPos select 0), (_rndPos select 1), ((_rndPos select 2) + 150)],[], 0, ""];
_crate attachTo [_chute,[0,0,1]];

_crate allowDamage false;

_chemlight = "chemlight_blue" createVehicle (position _crate);
_chemlight attachto [_crate, [0,0,0]];

_blueSmoke = "SmokeShellBlue" createVehicle (position _crate);
_blueSmoke attachto [_crate, [0,0,0]];  

while {true} do
{
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;

///NATO Weapons///
_crate addWeaponCargoGlobal ["arifle_MX_Black_F", 50];
_crate addWeaponCargoGlobal ["arifle_MX_GL_Black_F", 5];
_crate addWeaponCargoGlobal ["arifle_MX_SW_Black_F", 5];
_crate addWeaponCargoGlobal ["arifle_MXC_Black_F", 50];
_crate addWeaponCargoGlobal ["arifle_MXM_Black_F", 10];
_crate addWeaponCargoGlobal ["srifle_EBR_F", 5];

///NATO AMMO///
_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 200];
_crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag", 200];
_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag_Tracer", 200];
_crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag_Tracer", 200];
_crate addMagazineCargoGlobal ["20Rnd_762x51_Mag", 100];

////Launchers////
_crate addWeaponCargoGlobal ["launch_NLAW_F", 2];

////Launcher Ammo////
_crate addMagazineCargoGlobal ["NLAW_F", 15];

/////Explosives////
_crate addMagazineCargoGlobal ["SatchelCharge_Remote_Ammo", 15];
_crate addMagazineCargoGlobal ["DemoCharge_Remote_Ammo", 15];
_crate addWeaponCargoGlobal ["NVGoggles", 50];
_crate addWeaponCargoGlobal ["MineDetector", 2];

/////Grenades////
_crate addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell", 50];
_crate addMagazineCargoGlobal ["1Rnd_Smoke_Grenade_shell", 50];
_crate addMagazineCargoGlobal ["1Rnd_SmokeGreen_Grenade_shell", 50];
_crate addMagazineCargoGlobal ["1Rnd_SmokeBlue_Grenade_shell", 50];
_crate addMagazineCargoGlobal ["1Rnd_SmokeRed_Grenade_shell", 50];
_crate addMagazineCargoGlobal ["SmokeShellRed", 50];
_crate addMagazineCargoGlobal ["SmokeShell", 50];
_crate addMagazineCargoGlobal ["SmokeShellGreen", 50];
_crate addMagazineCargoGlobal ["SmokeShellBlue", 50];

///Attachments///
_crate addItemCargoGlobal ["muzzle_snds_H", 25]; 
_crate addItemCargoGlobal ["muzzle_snds_L", 25]; 
_crate addItemCargoGlobal ["muzzle_snds_B", 25]; 
_crate addItemCargoGlobal ["muzzle_snds_H_MG", 25]; 
_crate addItemCargoGlobal ["optic_Arco", 25]; 
_crate addItemCargoGlobal ["optic_Hamr", 25]; 
_crate addItemCargoGlobal ["optic_Aco", 25]; 
_crate addItemCargoGlobal ["optic_ACO_grn",25]; 
_crate addItemCargoGlobal ["optic_Holosight", 25]; 
_crate addItemCargoGlobal ["acc_flashlight", 25]; 
_crate addItemCargoGlobal ["acc_pointer_IR", 50];

/////Items////
_crate addItemCargoGlobal ["Binocular", 5];
_crate addItemCargoGlobal ["Rangefinder", 5];
_crate addItemCargoGlobal ["Medikit", 5];
_crate addItemCargoGlobal ["FirstAidKit", 50];
_crate addItemCargoGlobal ["Toolkit", 5];
_crate addItemCargoGlobal ["g_diving", 15];

////Uniforms(working)////
_crate addItemCargoGlobal ["U_B_Survival_Uniform", 50];
_crate addItemCargoGlobal ["U_B_CombatUniform_mcam", 50];
_crate addItemCargoGlobal ["U_B_CombatUniform_mcam_tshirt", 50];
_crate addItemCargoGlobal ["U_B_CombatUniform_mcam_vest", 50];
_crate addItemCargoGlobal ["U_B_Wetsuit", 50];

////Vests(working)////
_crate addItemCargoGlobal ["V_PlateCarrier1_rgr", 50];
_crate addItemCargoGlobal ["V_PlateCarrier1_cbr", 50];
_crate addItemCargoGlobal ["V_PlateCarrier2_rgr", 50];
_crate addItemCargoGlobal ["V_PlateCarrierGL_rgr", 50];
_crate addItemCargoGlobal ["V_Chestrig_khk", 50];
_crate addItemCargoGlobal ["V_ChestrigB_rgr", 50];
_crate addItemCargoGlobal ["V_TacVest_khk", 50];
_crate addItemCargoGlobal ["V_TacVest_brn", 50];
_crate addItemCargoGlobal ["V_TacVest_oli", 50];
_crate addItemCargoGlobal ["V_HarnessO_brn", 50];
_crate addItemCargoGlobal ["V_HarnessOGL_brn", 50];
_crate addItemCargoGlobal ["V_RebreatherB", 50];

////Backpacks ////
_crate addBackpackCargoGlobal ["B_AssaultPack_dgtl", 25];
_crate addBackpackCargoGlobal ["B_AssaultPack_blk", 25];
_crate addBackpackCargoGlobal ["B_AssaultPack_mcamo", 25];
_crate addBackpackCargoGlobal ["B_Carryall_mcamo", 10];
_crate addBackpackCargoGlobal ["B_Carryall_khk", 10];
_crate addBackpackCargoGlobal ["B_AssaultPack_blk_DiverExp", 10];
_crate addBackpackCargoGlobal ["B_Kitbag_rgr_Exp", 10];
_crate addBackpackCargoGlobal ["B_AssaultPack_rgr_Medic", 10];

////Helmets(working)////
_crate addItemCargoGlobal ["H_HelmetB", 50];
_crate addItemCargoGlobal ["H_Booniehat_khk", 50];
_crate addItemCargoGlobal ["H_Booniehat_mcamo", 50];
_crate addItemCargoGlobal ["H_Booniehat_ocamo", 50];
_crate addItemCargoGlobal ["H_HelmetB_paint", 50];
_crate addItemCargoGlobal ["H_HelmetB_light", 50];
_crate addItemCargoGlobal ["H_Watchcap_blk", 50];
_crate addItemCargoGlobal ["H_Watchcap_camo", 50];
_crate addItemCargoGlobal ["H_Cap_headphones", 50];
_crate addItemCargoGlobal ["H_MilCap_mcamo", 50];
};

[{systemChat "Nato Supply drop near map marker, blue smoke and chemlight, 30 minutes to locate"},"BIS_fnc_call",true,false] spawn BIS_fnc_MP;

hint "Nato Supply drop near map marker, blue smoke and chemlight, 30 minutes to locate"; 

sleep 35;
detach _crate;

sleep 1800;

// delete marker and vehicles
deleteMarker "Supply";
deleteVehicle _chute;
deleteVehicle _crate;

Share this post


Link to post
Share on other sites

Why is the add crate stuff in a continous while loop ?

Share this post


Link to post
Share on other sites
Why is the add crate stuff in a continous while loop ?

Hmm, I didn't see that before. That will be your issue....

Share this post


Link to post
Share on other sites
Why is the add crate stuff in a continous while loop ?

I have combined a few scripts together and well..... a 2nd pair of eyes always helps... thanks larrow

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  

×