Jump to content
1para{god-father}

Random Ammo Crates Spawn

Recommended Posts

Does anyone have  a script that will spawn a Ammo crate at all military compounds around the map ?

 

*SOLVED*

 

just grabbed the heli pads for now as done the Job :)

if (!isServer) exitWith {};

private ["_marker","_boxes","_town","_newpos","_numb","_boxnum","_box","_townpos","_bases"];


 _heliPadClasses = ["Land_HelipadSquare_F","Land_HelipadRescue_F","Land_HelipadCivil_F"];
 _bases= nearestObjects[position server,_heliPadClasses,500000];


_boxes = ["Box_NATO_AmmoOrd_F","Box_NATO_AmmoOrd_F","Box_NATO_AmmoOrd_F"];  //random later
       boxescashe = 30;

        while {boxescashe > 0} do
        {
            _boxestype = _boxes call BIS_fnc_selectRandom;
            _town = _bases call BIS_fnc_selectRandom;
_bases = _bases - [_town];
            _townpos = (position _town);
_townnewpos = [_townpos, 1, 15, 1, 0, 60, 0] call BIS_fnc_findSafePos;
            _box = createVehicle [_boxestype,_townnewpos,[], 0, "NONE"];
            nul = [_box] execVM "crates\cratefiller.sqf";
            boxescashe = boxescashe - 1;
_cid = floor(random 100000);
_markera = createMarker[format["marker%1",_cid],getPos _box  ];
_markera setMarkerShape "ICON";
_markera setMarkerType "mil_dot";
            _markera setMarkercolor "ColorBlue";


    };

Share this post


Link to post
Share on other sites
_cid = floor(random 100000);

Rounding in this line actually increases the chance of duplication and is obsolete besides.

_cid = random 100000;
  • Like 1

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

×