hello people.
i stumbled on a problem with ammoboxes and not sure how to solve this issue.
i have this script i call from support menu. "BIS_MENU_GroupCommunication"
and all seams fine. until i try to take ammo from it.
i can see in the ammobox the magazines. but i can not take any. its like the ammo box is locked.
here is my ammodrop script.
InitAmmoSupport =
{
if (isNil "WAsupport") then {WAsupport = true;publicVariable "WAsupport";};
if (isNil "EAsupport") then {EAsupport = true;publicVariable "EAsupport";};
if (isNil "GAsupport") then {GAsupport = true;publicVariable "GAsupport";};
};
AmmoSupport =
{
if ((!isServer) || (!isDedicaed)) exitwith {};
_caller = _this;
_pos = getpos _caller;
_x = _pos select 0;
_y = _pos select 1;
_z = 160;
_faction = faction _caller;
switch (_faction) do
{
case Wfaction :
{
if (WAsupport) then
{
[west,"HQ"] sideChat "Ammo drop on the way";
sleep 3;
private ["_ammobox","_para"];
WAsupport = false;
publicvariable "WAsupport";
_caller spawn AmmosupportTimer;
_para = "ParachuteMediumWest_EP1" createvehicle [0,0,0];
_para setpos [_x,_y,_z];
_ammobox = "USBasicAmmunitionBox" createvehicle [0,0,100];
_ammobox setpos [_x,_y,_z];
clearweaponcargo _ammobox;
clearmagazinecargo _ammobox;
for "_i" from 0 to (count westammo -1) do {_ammobox addmagazinecargo [westammo select _i,10];};
_ammobox attachTo [_para,[0,0,0]];
sleep 1;
waituntil {(getposatl _ammobox select 2) < 1.3};
detach _ammobox;
_ammobox setposatl [getposatl _ammobox select 0,getpos _ammobox select 1,0];
}else{
[west,"HQ"] sideChat "Ammo drop is not ready yet";
};
};
case Efaction :
{
if (EAsupport) then
{
[east,"HQ"] sideChat "Ammo drop on the way";
sleep 3;
private ["_ammobox","_para"];
EAsupport = false;
publicvariable "EAsupport";
_caller spawn AmmosupportTimer;
_para = "ParachuteMediumWest_EP1" createvehicle [0,0,0];
_para setpos [_x,_y,_z];
_ammobox = "RUBasicAmmunitionBox" createvehicle [0,0,100];
_ammobox setpos [_x,_y,_z];
clearweaponcargo _ammobox;
clearmagazinecargo _ammobox;
for "_i" from 0 to (count eastammo -1) do {_ammobox addmagazinecargo [eastammo select _i,10];};
_ammobox attachTo [_para,[0,0,0]];
sleep 1;
waituntil {(getposatl _ammobox select 2) < 1.3};
detach _ammobox;
_ammobox setposatl [getposatl _ammobox select 0,getpos _ammobox select 1,0];
}else{
[east,"HQ"] sideChat "Ammo drop is not ready yet";
};
};
case Gfaction :
{
if (GAsupport) then
{
[resistance,"HQ"] sideChat "Ammo drop on the way";
sleep 3;
private ["_ammobox","_para"];
GAsupport = false;
publicvariable "GAsupport";
_caller spawn AmmosupportTimer;
_para = "ParachuteMediumWest_EP1" createvehicle [0,0,0];
_para setpos [_x,_y,_z];
_ammobox = "USBasicAmmunitionBox" createvehicle [0,0,100];
_ammobox setpos [_x,_y,_z];
clearweaponcargo _ammobox;
clearmagazinecargo _ammobox;
for "_i" from 0 to (count eastammo -1) do {_ammobox addmagazinecargo [eastammo select _i,10];};
_ammobox attachTo [_para,[0,0,0]];
sleep 1;
waituntil {(getposatl _ammobox select 2) < 1.3};
detach _ammobox;
_ammobox setposatl [getposatl _ammobox select 0,getpos _ammobox select 1,0];
}else{
[resistance,"HQ"] sideChat "Ammo drop is not ready yet";
};
};
};
};
AmmoSupportTimer =
{
_caller = _this;
_faction = faction _caller;
switch (_faction) do
{
case Wfaction :
{
_tn = time;
_timer = paramsArray select 6; //
_tte = _tn + _timer;
_timerstate = true;
while {(_timerstate)} do
{
_timeRemein = (_tte - time);
if (_timeRemein < 0) then {_timerstate = false;};
sleep 1;
};
WAsupport = true;
publicvariable "WAsupport";
[WEST,"HQ"] sideChat "Ammo drop is now ready";
};
case Efaction :
{
_tn = time;
_timer = paramsArray select 6; //
_tte = _tn + _timer;
_timerstate = true;
while {(_timerstate)} do
{
_timeRemein = (_tte - time);
if (_timeRemein < 0) then {_timerstate = false;};
sleep 1;
};
EAsupport = true;
publicvariable "EAsupport";
[East,"HQ"] sideChat "Ammo drop is now ready";
};
case Gfaction :
{
_tn = time;
_timer = paramsArray select 6; //
_tte = _tn + _timer;
_timerstate = true;
while {(_timerstate)} do
{
_timeRemein = (_tte - time);
if (_timeRemein < 0) then {_timerstate = false;};
sleep 1;
};
GAsupport = true;
publicvariable "GAsupport";
[resistance,"HQ"] sideChat "Ammo drop is now ready";
};
};
};
as you can see it creates a parachute and ammobox. clears the ammonbox for wepons and magazines, then adds new "defined" magazines to it. attach the ammobox etc so on.
westammo and eastammo is just an array with magnames in it.
any ideas why and how to solve this issue since i need to have it running on the dedicated server
ps. i posted in the wrong section 1st.and i tried to report it. but it said i could not report my own post. you can delete that thread,