Carepackage box drop

Inkko

Valued Member!
I've been working on something that is attached to an admin tools, where when activated the map opens and an admin can choose where to drop a carepackage. A parachute and box are spawned aswell as a red smoke while it falls (the smoke doesn't last long enough) where the admin chooses on the map. There is a global hint message and a marker is added for all. One issue is that the box seems to disappear after a while but most likely due to not assigning any variables to it. The other issue is that the marker is permanent unless you die, so I made another script to remove the marker.

currently this is the script I'm using:

Code:
admin_drop =
    {
    closeDialog 0;
    titleText ["Click On The Map", "PLAIN DOWN"]; titleFadeOut 4;
    carepackage=

    {
        //onMapSingleClick hint format ["CarePackage Called In @\n%1" ,_pos];
        for "_i" from 0 to 0 do
        {
            _pos1 =  [(_pos select 0), (_pos select 1), 100];
            _b0x = "USVehicleBox" createVehicle _pos1;
            clearWeaponCargoGlobal _b0x;
            clearMagazineCargoGlobal _b0x;
            parachute_box = createVehicle ["ParachuteMediumEast", [(_pos1) select 0,(_pos1) select 1], [], 0, "FLY"];
            smokeRedgear = createVehicle ["SmokeShellRed", [(_pos1) select 0,(_pos1) select 1], [], 0, "FLY"];
            smokeRedgear attachto [_b0x, [0,0,0]];
// used from chernarus mission system
            MCoords = _pos1;
            publicVariable "MCoords";
            [] execVM "debug\addmarkerscare.sqf";
            [nil,nil,rTitleText,"A Carepackage has been dropped! Check your map for the location!", "PLAIN",10] call RE;
   
            _b0x addWeaponCargoGlobal ["M4A1_AIM_SD_camo",2];
            _b0x addWeaponCargoGlobal ["M24",2];
            _b0x addWeaponCargoGlobal ["MP5A5",2];
            _b0x addWeaponCargoGlobal ["M40A3",2];
            _b0x addWeaponCargoGlobal ["MakarovSD",2];
            _b0x addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo",2];
            _b0x addWeaponCargoGlobal ["G36K",2];
            _b0x addWeaponCargoGlobal ["AK_74_GL",2];
            _b0x addWeaponCargoGlobal ["AK_107_pso",2];
            _b0x addWeaponCargoGlobal ["M4A3_RCO_GL_EP1",2];
            _b0x addWeaponCargoGlobal ["SVD_NSPU_EP1",2];
            _b0x addWeaponCargoGlobal ["AK_107_kobra",2];
            _b0x addWeaponCargoGlobal ["AK_107_GL_kobra",2];
            _b0x addWeaponCargoGlobal ["RPK_74",2];
            _b0x addMagazineCargoGlobal ["30Rnd_556x45_StanagSD",10];
            _b0x addMagazineCargoGlobal ["30Rnd_556x45_Stanag",10];
            _b0x addMagazineCargoGlobal ["30Rnd_556x45_G36",10];
            _b0x addMagazineCargoGlobal ["30Rnd_545x39_AK",10];
            _b0x addMagazineCargoGlobal ["75Rnd_545x39_RPK",10];
            _b0x addMagazineCargoGlobal ["5Rnd_762x51_M24",20];
            _b0x addMagazineCargoGlobal ["10Rnd_762x54_SVD",20];
            _b0x addMagazineCargoGlobal ["30Rnd_9x19_MP5",10];
            _b0x addMagazineCargoGlobal ["1Rnd_HE_GP25",10];

            _b0x = nearestObjects [_pos1, ["USVehicleBox"], 200];
            parachute_box = nearestObjects [_pos1, ["ParachuteMediumEast"], 350];
            _b0x = _b0x select 0;
            parachute_box = parachute_box select 0;
            _b0x attachTo [parachute_box, [0,0,3]];
        };
//used with the AH I use to track admin use
        _savelog = format["%1 Paradrop",name player];
        PVAH_WriteLogRequest = [_savelog];
        publicVariableServer "PVAH_WriteLogRequest";
        onMapSingleClick "";
        openMap [false, false];
    };

    openMap [true, false];
    onMapSingleClick "[_pos select 0, _pos select 1, _pos select 2] call carepackage";
    };

What I would like to do is add a way for markers to be removed on their own. I'm going to eventually just add this into the chernarus mission system and have them randomly drop as a new mission. But another issue I've run into is I wanted to make different arrays or one large array that would make the box contain more randomized loot.

So things to do would be:
adding a way for markers to be removed when a player gets close to the box.
randomized loot in the box
and better visibility (like how crash sites have smoke I'd like to add some kind of colored smoke)
 
To remove the marker as part of the mission set a sleep after the box has dropped and been created and have the mission delete the marker before it exits. To have the marker disappear when the payer gets close use a trigger that deletes the marker when a player gets within a certain distance of the marker.
 
To remove the marker as part of the mission set a sleep after the box has dropped and been created and have the mission delete the marker before it exits. To have the marker disappear when the payer gets close use a trigger that deletes the marker when a player gets within a certain distance of the marker.

For an idea on how to implement this, look at the mission addon files.
 
I think I have this implemented into the mission system, but I like the idea of having admins able to drop them where they want as well just due to being able to drop it near players who can see it drop. I plan on making my own missions for the mission system aswell once I get time.
Code:
//Supply drop by Inkko (Full credit for original code to TheSzerdi & TAW_Tonic & lazyink)

private ["_coords","_MainMarker","_wait"];
[] execVM "\z\addons\dayz_server\Missions\SMGoMajor.sqf";
WaitUntil {MissionGo == 1};

_coords = [getMarkerPos "center",0,5500,30,0,2000,0] call BIS_fnc_findSafePos;

[nil,nil,rTitleText,"A supply crate has been dropped!", "PLAIN",10] call RE;


Ccoords = _coords;
publicVariable "Ccoords";
[] execVM "debug\addmarkers.sqf";

_crate = createVehicle ["USVehicleBox",[(_coords select 0), (_coords select 1),100],[], 0, "CAN_COLLIDE"];
[_crate] execVM "\z\addons\dayz_server\missions\misc\fillBoxesH.sqf";
_crate setVariable ["Mission",1,true];
_para = createVehicle ["ParachuteMediumEast",[(_coords select 0), (_coords select 1),100],[], 0, "FLY"];
_para setVariable ["Mission",1,true];
_crate attachTo [_para, [0,0,3]];


_aispawn = [_coords,80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,80,6,6,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards
sleep 5;
_aispawn = [_coords,40,4,4,1] execVM "\z\addons\dayz_server\missions\add_unit_server.sqf";//AI Guards

waitUntil{{isPlayer _x && _x distance _crate < 10  } count playableunits > 0}; 

[nil,nil,rTitleText,"The supply crate is under survivor control!", "PLAIN",6] call RE;


[] execVM "debug\remmarkers.sqf";
MissionGo = 0;
Ccoords = 0;
publicVariable "Ccoords";



SM1 = 5;
[0] execVM "\z\addons\dayz_server\missions\major\SMfinder.sqf";
 
Back
Top