Code:
//Refill.sqf
_weap = getWeaponCargo _this;
_ammo = getMagazineCargo _this;
_boxname = _this select 0;
_true = true;
while {_true} do {
clearWeaponCargoGlobal _boxname;
clearMagazineCargoGlobal _boxname;
{_boxname addWeaponCargoGlobal [_x, 1]} forEach _weap;
{_boxname addMagazineCargoGlobal [_x, 10]} forEach _ammo;
sleep 30;
_boxname setdammage 0;
if( !alive _boxname) then {
_newbox = (typeOf _boxname) createvehicle (getpos _boxname);
_newbox setpos (getpos _boxname);
deletevehicle _boxname;
_boxname = _newbox;
};
};
Das script nur vom server ausfuehren lassen
Code:
if (isServer) then {0 = execVM "Refill.sqf"}
gruß
hoschi