Jump to content
  • 0

Starter box (Action menu)


Andrej

Question

9 answers to this question

Recommended Posts

  • 0

you can use the time to prevent a second use. but cuz is a client side script, if player disconect and relog again they can use the started box one more time.

any way:

starterbox.sqf (mpmissions\your instance\custom\ )

Spoiler

private ["_LastUsedTime","_Time","_distance","];

_LastUsedTime = 3600;
_Time = time - lastuse;


if(_Time < _LastUsedTime) exitWith { 
    cutText [format["wait %1 seconds !",(round(_Time - _LastUsedTime))], "PLAIN DOWN"]; 
}else{

//CREATE THE BOX
box =
	{
		
_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
_crate setpos  (player modelToWorld [0,6,0]);
_crate setDir ([_crate, player] call BIS_fnc_dirTo);
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;

// add weapons
		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
		_crate addWeaponCargoGlobal ["ItemEtool", 2];
		_crate addWeaponCargoGlobal ["ItemCompass", 2];
		_crate addWeaponCargoGlobal ["Binocular", 2];
		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
		_crate addWeaponCargoGlobal ["ItemGPS", 2];
		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
		_crate addWeaponCargoGlobal ["ItemKnife", 2];
		_crate addWeaponCargoGlobal ["ItemMap", 2];
		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
		_crate addWeaponCargoGlobal ["ItemWatch", 2];
		_crate addWeaponCargoGlobal ["NVGoggles", 2];
		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
		_crate addWeaponCargoGlobal ["ItemMachete", 2];
		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
		_crate addWeaponCargoGlobal ["ItemShovel", 2];
		_crate addWeaponCargoGlobal ["ItemSledge", 2];
		_crate addWeaponCargoGlobal ["ChainSaw", 1];
		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
	
	// add items
	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
		_crate addMagazineCargoGlobal ["MortarBucket", 26];
		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
		_crate addMagazineCargoGlobal ["ItemPole", 16];
		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
		_crate addMagazineCargoGlobal ["ItemVault", 2];
		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
		_crate addMagazineCargoGlobal ["ItemBandage", 10];
		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
	_crate addMagazineCargoGlobal ["PartEngine", 5];
	_crate addMagazineCargoGlobal ["PartVRotor", 5];
	_crate addMagazineCargoGlobal ["PartWheel", 24];
	_crate addMagazineCargoGlobal ["PartGlass", 24];
	_crate addMagazineCargoGlobal ["PartFueltank", 4];
	_crate addMagazineCargoGlobal ["PartGeneric", 100];
	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
	
	

};
call box;
	
_distance = 100;

waitUntil {(player distance _crate) > _distance};
deleteVehicle _crate;
titleText ["started box was deleted","PLAIN DOWN"]; titleFadeOut 4;

};

 

init_starterbox.sqf

Spoiler

waituntil {!isnull (finddisplay 46)};
sleep 15;
startedbox = player addaction [("<t color=""#6599FF"">" + ("StarterBox") +"</t>"),"custom\starterbox.sqf","",5,false,true,"",""]; 

 

At bottom of init.sqf

[] ExecVM "custom\init_starterbox.sqf";

but remember the better way is try to do it throug server side...i guess

Link to comment
Share on other sites

  • 0

@Andrej

using a server side script you can try a quick adaptation of admin events to see if works.

1-open your server_functions.sqf

Spoiler

find:

server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf";

add below:

//stbox
server_stbox = compile preprocessFileLineNumbers "\z\addons\dayz_server\stbox\server_stbox.sqf";

 

2-open your init.sqf

  Hide contents

A_change the path for publicEH.sqf  by this


call compile preprocessFileLineNumbers "custom\publicEH.sqf";

b- at very bottom add:


[] execVM "clientstbox\init_stbox.sqf"; 

 

4-Drop your publicEH.sqf   ( Located in: \@DayZ_Epoch\addons\dayz_code\init\ ) 

into mpmissions\your instance\custom\

5. open the custom publicEH.sqf

Spoiler

find:
"PVDZE_maintainArea" 	addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea};

below  paste:
"PVDZE_stbox"      addPublicVariableEventHandler {(_this select 1) spawn server_stbox};

 

6-Create sqfs

Spoiler

server_stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

Spoiler


private ["_date","_key","_result","_outcome","_datestr","_stbox"];
diag_log("STARTERBOX INIT");
_stbox = _this select 0;
_key = "CHILD:307:";
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
    _date = _result select 1;
    _datestr  = str(_date);
    diag_log ("STARTER BOX EXECUTED: " + (_stbox) + " on " + _datestr);
    [] execVM "\z\addons\dayz_server\stbox\" + (_stbox) + ".sqf";
};

 

init_stbox.sqf (mpmissions\your instance\clientstbox\)

Spoiler


waituntil {!isnull (finddisplay 46)};
sleep 15;
executeevents = player addaction [("<t color=""#F7D708"">" + ("StarterBox") +"</t>"),"clientstbox\execute_stbox.sqf","",5,false,true,"",""]; 

 

execute_stbox.sqf (mpmissions\your instance\clientstbox\)

Spoiler


stbox =
    [
        ["",true],
            ["Starter_Box", [2], "", -5, [["expression", '["stbox"] call STARTERBOX']], "1", "1"],
            ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]        
    ];

showCommandingMenu "#USER:stbox";

STARTERBOX =
{    
    fn_doit = {
        PVDZE_stbox = [_this select 0];
        publicVariableServer "PVDZE_stbox";    
    };
    call fn_doit;
};

 

stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

Spoiler

private ["_crate"];

if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};
 


box =
	{
	    script_in_progress = true;

		_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
                _crate setpos  (player modelToWorld [0,6,0]);
                _crate setDir ([_crate, player] call BIS_fnc_dirTo);

	clearWeaponCargoGlobal _crate;
	clearMagazineCargoGlobal _crate;

	// add weapons
		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
		_crate addWeaponCargoGlobal ["ItemEtool", 2];
		_crate addWeaponCargoGlobal ["ItemCompass", 2];
		_crate addWeaponCargoGlobal ["Binocular", 2];
		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
		_crate addWeaponCargoGlobal ["ItemGPS", 2];
		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
		_crate addWeaponCargoGlobal ["ItemKnife", 2];
		_crate addWeaponCargoGlobal ["ItemMap", 2];
		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
		_crate addWeaponCargoGlobal ["ItemWatch", 2];
		_crate addWeaponCargoGlobal ["NVGoggles", 2];
		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
		_crate addWeaponCargoGlobal ["ItemMachete", 2];
		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
		_crate addWeaponCargoGlobal ["ItemShovel", 2];
		_crate addWeaponCargoGlobal ["ItemSledge", 2];
		_crate addWeaponCargoGlobal ["ChainSaw", 1];
		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
	
	// add items
	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
		_crate addMagazineCargoGlobal ["MortarBucket", 26];
		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
		_crate addMagazineCargoGlobal ["ItemPole", 16];
		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
		_crate addMagazineCargoGlobal ["ItemVault", 2];
		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
		_crate addMagazineCargoGlobal ["ItemBandage", 10];
		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
	_crate addMagazineCargoGlobal ["PartEngine", 5];
	_crate addMagazineCargoGlobal ["PartVRotor", 5];
	_crate addMagazineCargoGlobal ["PartWheel", 24];
	_crate addMagazineCargoGlobal ["PartGlass", 24];
	_crate addMagazineCargoGlobal ["PartFueltank", 4];
	_crate addMagazineCargoGlobal ["PartGeneric", 100];
	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
	
	

};
call box;
	


sleep 90;
deleteVehicle _crate;
titleText ["crate was deleted","PLAIN DOWN"]; titleFadeOut 4;

 

 

Link to comment
Share on other sites

  • 0
5 hours ago, juandayz said:

@Andrej

using a server side script you can try a quick adaptation of admin events to see if works.

1-open your server_functions.sqf

  Hide contents


find:

server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf";

add below:

//stbox
server_stbox = compile preprocessFileLineNumbers "\z\addons\dayz_server\stbox\server_stbox.sqf";

 

2-open your init.sqf

  Reveal hidden contents

A_change the path for publicEH.sqf  by this



call compile preprocessFileLineNumbers "custom\publicEH.sqf";

b- at very bottom add:



[] execVM "clientstbox\init_stbox.sqf"; 

 

4-Drop your publicEH.sqf   ( Located in: \@DayZ_Epoch\addons\dayz_code\init\ ) 

into mpmissions\your instance\custom\

5. open the custom publicEH.sqf

  Reveal hidden contents


find:
"PVDZE_maintainArea" 	addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea};

below  paste:
"PVDZE_stbox"      addPublicVariableEventHandler {(_this select 1) spawn server_stbox};

 

6-Create sqfs

  Reveal hidden contents

server_stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

  Reveal hidden contents



private ["_date","_key","_result","_outcome","_datestr","_stbox"];
diag_log("STARTERBOX INIT");
_stbox = _this select 0;
_key = "CHILD:307:";
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
    _date = _result select 1;
    _datestr  = str(_date);
    diag_log ("STARTER BOX EXECUTED: " + (_stbox) + " on " + _datestr);
    [] execVM "\z\addons\dayz_server\stbox\" + (_stbox) + ".sqf";
};

 

init_stbox.sqf (mpmissions\your instance\clientstbox\)

  Reveal hidden contents



waituntil {!isnull (finddisplay 46)};
sleep 15;
executeevents = player addaction [("<t color=""#F7D708"">" + ("StarterBox") +"</t>"),"clientstbox\execute_stbox.sqf","",5,false,true,"",""]; 

 

execute_stbox.sqf (mpmissions\your instance\clientstbox\)

  Reveal hidden contents



stbox =
    [
        ["",true],
            ["Starter_Box", [2], "", -5, [["expression", '["stbox"] call STARTERBOX']], "1", "1"],
            ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]        
    ];

showCommandingMenu "#USER:stbox";

STARTERBOX =
{    
    fn_doit = {
        PVDZE_stbox = [_this select 0];
        publicVariableServer "PVDZE_stbox";    
    };
    call fn_doit;
};

 

stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

  Reveal hidden contents


private ["_crate"];

if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};
 


box =
	{
	    script_in_progress = true;

		_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
                _crate setpos  (player modelToWorld [0,6,0]);
                _crate setDir ([_crate, player] call BIS_fnc_dirTo);

	clearWeaponCargoGlobal _crate;
	clearMagazineCargoGlobal _crate;

	// add weapons
		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
		_crate addWeaponCargoGlobal ["ItemEtool", 2];
		_crate addWeaponCargoGlobal ["ItemCompass", 2];
		_crate addWeaponCargoGlobal ["Binocular", 2];
		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
		_crate addWeaponCargoGlobal ["ItemGPS", 2];
		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
		_crate addWeaponCargoGlobal ["ItemKnife", 2];
		_crate addWeaponCargoGlobal ["ItemMap", 2];
		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
		_crate addWeaponCargoGlobal ["ItemWatch", 2];
		_crate addWeaponCargoGlobal ["NVGoggles", 2];
		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
		_crate addWeaponCargoGlobal ["ItemMachete", 2];
		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
		_crate addWeaponCargoGlobal ["ItemShovel", 2];
		_crate addWeaponCargoGlobal ["ItemSledge", 2];
		_crate addWeaponCargoGlobal ["ChainSaw", 1];
		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
	
	// add items
	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
		_crate addMagazineCargoGlobal ["MortarBucket", 26];
		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
		_crate addMagazineCargoGlobal ["ItemPole", 16];
		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
		_crate addMagazineCargoGlobal ["ItemVault", 2];
		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
		_crate addMagazineCargoGlobal ["ItemBandage", 10];
		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
	_crate addMagazineCargoGlobal ["PartEngine", 5];
	_crate addMagazineCargoGlobal ["PartVRotor", 5];
	_crate addMagazineCargoGlobal ["PartWheel", 24];
	_crate addMagazineCargoGlobal ["PartGlass", 24];
	_crate addMagazineCargoGlobal ["PartFueltank", 4];
	_crate addMagazineCargoGlobal ["PartGeneric", 100];
	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
	
	

};
call box;
	


sleep 90;
deleteVehicle _crate;
titleText ["crate was deleted","PLAIN DOWN"]; titleFadeOut 4;

 

 

Man thank you a lot, much love <3

Link to comment
Share on other sites

  • 0
7 hours ago, juandayz said:

@Andrej

using a server side script you can try a quick adaptation of admin events to see if works.

1-open your server_functions.sqf

  Hide contents


find:

server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf";

add below:

//stbox
server_stbox = compile preprocessFileLineNumbers "\z\addons\dayz_server\stbox\server_stbox.sqf";

 

2-open your init.sqf

  Hide contents

A_change the path for publicEH.sqf  by this



call compile preprocessFileLineNumbers "custom\publicEH.sqf";

b- at very bottom add:



[] execVM "clientstbox\init_stbox.sqf"; 

 

4-Drop your publicEH.sqf   ( Located in: \@DayZ_Epoch\addons\dayz_code\init\ ) 

into mpmissions\your instance\custom\

5. open the custom publicEH.sqf

  Hide contents


find:
"PVDZE_maintainArea" 	addPublicVariableEventHandler {(_this select 1) spawn server_maintainArea};

below  paste:
"PVDZE_stbox"      addPublicVariableEventHandler {(_this select 1) spawn server_stbox};

 

6-Create sqfs

  Hide contents

server_stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

  Hide contents



private ["_date","_key","_result","_outcome","_datestr","_stbox"];
diag_log("STARTERBOX INIT");
_stbox = _this select 0;
_key = "CHILD:307:";
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
    _date = _result select 1;
    _datestr  = str(_date);
    diag_log ("STARTER BOX EXECUTED: " + (_stbox) + " on " + _datestr);
    [] execVM "\z\addons\dayz_server\stbox\" + (_stbox) + ".sqf";
};

 

init_stbox.sqf (mpmissions\your instance\clientstbox\)

  Hide contents



waituntil {!isnull (finddisplay 46)};
sleep 15;
executeevents = player addaction [("<t color=""#F7D708"">" + ("StarterBox") +"</t>"),"clientstbox\execute_stbox.sqf","",5,false,true,"",""]; 

 

execute_stbox.sqf (mpmissions\your instance\clientstbox\)

  Reveal hidden contents



stbox =
    [
        ["",true],
            ["Starter_Box", [2], "", -5, [["expression", '["stbox"] call STARTERBOX']], "1", "1"],
            ["", [-1], "", -5, [["expression", ""]], "1", "0"],
        ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]        
    ];

showCommandingMenu "#USER:stbox";

STARTERBOX =
{    
    fn_doit = {
        PVDZE_stbox = [_this select 0];
        publicVariableServer "PVDZE_stbox";    
    };
    call fn_doit;
};

 

stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

  Hide contents


private ["_crate"];

if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
        systemChat "This script is only useable once (untill restart)!";
};
 


box =
	{
	    script_in_progress = true;

		_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
                _crate setpos  (player modelToWorld [0,6,0]);
                _crate setDir ([_crate, player] call BIS_fnc_dirTo);

	clearWeaponCargoGlobal _crate;
	clearMagazineCargoGlobal _crate;

	// add weapons
		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
		_crate addWeaponCargoGlobal ["ItemEtool", 2];
		_crate addWeaponCargoGlobal ["ItemCompass", 2];
		_crate addWeaponCargoGlobal ["Binocular", 2];
		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
		_crate addWeaponCargoGlobal ["ItemGPS", 2];
		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
		_crate addWeaponCargoGlobal ["ItemKnife", 2];
		_crate addWeaponCargoGlobal ["ItemMap", 2];
		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
		_crate addWeaponCargoGlobal ["ItemWatch", 2];
		_crate addWeaponCargoGlobal ["NVGoggles", 2];
		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
		_crate addWeaponCargoGlobal ["ItemMachete", 2];
		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
		_crate addWeaponCargoGlobal ["ItemShovel", 2];
		_crate addWeaponCargoGlobal ["ItemSledge", 2];
		_crate addWeaponCargoGlobal ["ChainSaw", 1];
		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
	
	// add items
	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
		_crate addMagazineCargoGlobal ["MortarBucket", 26];
		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
		_crate addMagazineCargoGlobal ["ItemPole", 16];
		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
		_crate addMagazineCargoGlobal ["ItemVault", 2];
		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
		_crate addMagazineCargoGlobal ["ItemBandage", 10];
		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
	_crate addMagazineCargoGlobal ["PartEngine", 5];
	_crate addMagazineCargoGlobal ["PartVRotor", 5];
	_crate addMagazineCargoGlobal ["PartWheel", 24];
	_crate addMagazineCargoGlobal ["PartGlass", 24];
	_crate addMagazineCargoGlobal ["PartFueltank", 4];
	_crate addMagazineCargoGlobal ["PartGeneric", 100];
	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
	
	

};
call box;
	


sleep 90;
deleteVehicle _crate;
titleText ["crate was deleted","PLAIN DOWN"]; titleFadeOut 4;

 

 

I Followed instructions for the server side but no option on mouse wheel ... 

(I deleted all Char data player data and login data and tried again but still no option)

What am I doing wrong?

Thanks for your help!

====================

EDIT:  @Andrej  was able to get the menu to show up on test server but nothing happens when he clicks it.

I'm still unable to get the menu to show up on the live server though. 

I'm running this script on the live server already - would it be causing any issues? 

Going over the install again to see if we missed something.

Link to comment
Share on other sites

  • 0

mmm if andrej can see the scroll menu option... then the public variable works.. but if nothing happend when he click on the option.. thers an issue on stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

maybe this part.

_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
                _crate setpos  (player modelToWorld [0,6,0]);
                _crate setDir ([_crate, player] call BIS_fnc_dirTo);

i think the "player" object cannot be recognized on a server side script.  its for epoch 1,6 or 1,5?

Link to comment
Share on other sites

  • 0
50 minutes ago, juandayz said:

mmm if andrej can see the scroll menu option... then the public variable works.. but if nothing happend when he click on the option.. thers an issue on stbox.sqf (\@DayZ_Epoch_Server\addons\dayz_server\stbox\)

maybe this part.


_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
                _crate setpos  (player modelToWorld [0,6,0]);
                _crate setDir ([_crate, player] call BIS_fnc_dirTo);

i think the "player" object cannot be recognized on a server side script.  its for epoch 1,6 or 1,5?

Thanks for the reply Juan - This is for Epoch 1.0.6

Link to comment
Share on other sites

  • 0
23 hours ago, juandayz said:

you can use the time to prevent a second use. but cuz is a client side script, if player disconect and relog again they can use the started box one more time.

any way:

starterbox.sqf (mpmissions\your instance\custom\ )

  Reveal hidden contents


private ["_LastUsedTime","_Time","_distance","];

_LastUsedTime = 3600;
_Time = time - lastuse;


if(_Time < _LastUsedTime) exitWith { 
    cutText [format["wait %1 seconds !",(round(_Time - _LastUsedTime))], "PLAIN DOWN"]; 
}else{

//CREATE THE BOX
box =
	{
		
_crate  = createVehicle ["USBasicWeapons_EP1",getpos player,[], 0, ""];
_crate setpos  (player modelToWorld [0,6,0]);
_crate setDir ([_crate, player] call BIS_fnc_dirTo);
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;

// add weapons
		_crate addWeaponCargoGlobal ["ItemToolbox", 2];
		_crate addWeaponCargoGlobal ["ItemEtool", 2];
		_crate addWeaponCargoGlobal ["ItemCompass", 2];
		_crate addWeaponCargoGlobal ["Binocular", 2];
		_crate addWeaponCargoGlobal ["Binocular_Vector", 2];
		_crate addWeaponCargoGlobal ["ItemGPS", 2];
		_crate addWeaponCargoGlobal ["ItemHatchet", 2];
		_crate addWeaponCargoGlobal ["ItemKnife", 2];
		_crate addWeaponCargoGlobal ["ItemMap", 2];
		_crate addWeaponCargoGlobal ["ItemMatchbox", 2];
		_crate addWeaponCargoGlobal ["ItemWatch", 2];
		_crate addWeaponCargoGlobal ["NVGoggles", 2];
		_crate addWeaponCargoGlobal ["ItemCrowbar", 2];
		_crate addWeaponCargoGlobal ["ItemMachete", 2];
		_crate addWeaponCargoGlobal ["ItemFishingPole", 2];
		_crate addWeaponCargoGlobal ["ItemShovel", 2];
		_crate addWeaponCargoGlobal ["ItemSledge", 2];
		_crate addWeaponCargoGlobal ["ChainSaw", 1];
		_crate addWeaponCargoGlobal ["M4A1_HWS_GL_SD_Camo", 2];
	
	// add items
	    _crate addMagazineCargoGlobal ["ItemBriefcase100oz", 12];
		_crate addMagazineCargoGlobal ["PartWoodPlywood", 26];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
		_crate addMagazineCargoGlobal ["MortarBucket", 26];
		_crate addMagazineCargoGlobal ["plot_pole_kit", 2];
		_crate addMagazineCargoGlobal ["ItemPole", 16];
		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
		_crate addMagazineCargoGlobal ["ItemComboLock", 2];
		_crate addMagazineCargoGlobal ["ItemVault", 2];
		_crate addMagazineCargoGlobal ["ItemAntibiotic", 5];
		_crate addMagazineCargoGlobal ["ItemBandage", 10];
		_crate addMagazineCargoGlobal ["ItemBloodbag", 10];
		_crate addMagazineCargoGlobal ["ItemMorphine", 10];
		_crate addMagazineCargoGlobal ["ItemPainkiller", 10];
		_crate addMagazineCargoGlobal ["ItemLightBulb", 10];
	_crate addMagazineCargoGlobal ["ItemLockbox", 2];
	_crate addMagazineCargoGlobal ["ItemMixOil", 10];
	_crate addMagazineCargoGlobal ["ItemJerrycan", 10];
	_crate addMagazineCargoGlobal ["PartEngine", 5];
	_crate addMagazineCargoGlobal ["PartVRotor", 5];
	_crate addMagazineCargoGlobal ["PartWheel", 24];
	_crate addMagazineCargoGlobal ["PartGlass", 24];
	_crate addMagazineCargoGlobal ["PartFueltank", 4];
	_crate addMagazineCargoGlobal ["PartGeneric", 100];
	_crate addMagazineCargoGlobal ["30Rnd_556x45_StanagSD", 50];
	_crate addMagazineCargoGlobal ["ItemSodaPepsi", 10];
	_crate addMagazineCargoGlobal ["ItemSandbag", 20];
	_crate addMagazineCargoGlobal ["ItemCorrugated", 10];
	_crate addMagazineCargoGlobal ["ItemWoodFloor", 20];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
	_crate addMagazineCargoGlobal ["FoodCanSardines", 10];
	_crate addMagazineCargoGlobal ["ItemEpinephrine", 10];
	_crate addMagazineCargoGlobal ["ItemGenerator", 10];
	_crate addMagazineCargoGlobal ["PartWoodLumber", 20];
	
	

};
call box;
	
_distance = 100;

waitUntil {(player distance _crate) > _distance};
deleteVehicle _crate;
titleText ["started box was deleted","PLAIN DOWN"]; titleFadeOut 4;

};

 

init_starterbox.sqf

  Reveal hidden contents


waituntil {!isnull (finddisplay 46)};
sleep 15;
startedbox = player addaction [("<t color=""#6599FF"">" + ("StarterBox") +"</t>"),"custom\starterbox.sqf","",5,false,true,"",""]; 

 

At bottom of init.sqf

[] ExecVM "custom\init_starterbox.sqf";

but remember the better way is try to do it throug server side...i guess

@juandayz Do you may know how to solve this problem if you have time.

 

Link to comment
Share on other sites

  • 0
On 20/3/2017 at 1:42 AM, McPimpin said:

I get the same thing... I get the option but no box spawns.  can someone help me with the stbox.sqf portion?

Spoiler

private ["_hasitem","_LastUsedTime","_Time","_boxtype","_loot_lists","_loot","_positionp","_this","_positiondrop","_box","_chute","_smoke"];

_LastUsedTime = 3600;                                                                  
_Time = time - lastuse;
_boxtype = "USVehicleBox_EP1";
_hasitem = "ItemBookBible" in magazines player; 


if (!_hasitem) exitWith {cutText [format["You need a bible"], "PLAIN DOWN"];};
                         
if(_Time < _LastUsedTime) exitWith {
    cutText [format["Not again",(round(_Time - _LastUsedTime))], "PLAIN DOWN"];
};

                         
lastuse = time;
player removeMagazine "ItemBookBible";
_loot_lists = [
[
["BAF_LRR_scoped","DMR_DZ","SCAR_H_LNG_Sniper","M240_DZ"],
["5Rnd_86x70_L115A1","5Rnd_86x70_L115A1","5Rnd_86x70_L115A1","20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_B_SCAR","20Rnd_762x51_B_SCAR","100Rnd_762x51_M240","100Rnd_762x51_M240","Skin_TK_INS_Soldier_AR_EP1_DZ","Skin_RUS_Commander_DZ","FoodbaconCooked","FoodGoatCooked","ItemSodaFranka","ItemSodaMzly","PartGeneric"]
],
[
["revolver_gold_EP1"],
["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","SmokeShellGreen","HandGrenade_west","HandGrenade_west","HandGrenade_east","HandGrenade_east","1Rnd_HE_M203","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemKiloHemp","ItemKiloHemp","ItemKiloHemp","PipeBomb"]
],
[
["Binocular_Vector","NVGoggles","ItemMatchbox","ItemEtool","ItemHatchet","ItemMachete","ItemPickaxe","ItemSledge"],
["ItemLightBulb","ItemMixOil","plot_pole_kit","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz"]
],
[
["ChainSaw"],
["ItemSandbag","ItemWire","equip_brick","ItemDesertTent","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemPole","ItemComboLock","ItemGenerator"]
],
[
["RPK_DZ","RPK_DZ","PKM_DZ","PKM_DZ"],
["75Rnd_545x39_RPK","75Rnd_545x39_RPK","75Rnd_762x39_RPK","75Rnd_762x39_RPK","100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK","100Rnd_762x54_PK","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","ItemKiloHemp","ItemKiloHemp","ItemKiloHemp","ItemKiloHemp","ItemKiloHemp","ItemKiloHemp","ItemKiloHemp",""]
],
[
["L110A1_DZ"],
["ItemAntibiotic","ItemAntibacterialWipe","bloodBagONEG","bloodBagBPOS","transfusionKit","bloodTester","equip_gauze","equip_rag","equip_herb_box","equip_string","ItemMorphine"]
],
[
["Crossbow_DZ","MR43_DZ","RedRyder","Mosin_DZ","LeeEnfield_DZ"],
["12Rnd_Quiver_Wood","1Rnd_Bolt_Tranquilizer","1Rnd_Bolt_Explosive","5Rnd_762x54_Mosin","5Rnd_762x54_Mosin","10Rnd_303British","10Rnd_303British","equip_gauzepackaged","equip_rope","equip_rag","ItemMorphine","ItemMorphine","MortarBucket","MortarBucket","MortarBucket","MortarBucket","MortarBucket","MortarBucket","transfusionKit","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks"]
],
[
["M4SPR","M14_DZ","M24_des_EP1"],
["5Rnd_17HMR","5Rnd_17HMR","5Rnd_762x51_M24","5Rnd_762x51_M24","20Rnd_762x51_DMR","20Rnd_762x51_DMR","10Rnd_762x54_SVD","10Rnd_762x54_SVD","10Rnd_762x54_SVD"]
],

[
["SVD_DZ","SVD_DZ","SVD_des_EP1","SVD_des_EP1"],
["PartWheel","PartWheel","PartWheel","PartGlass","PartGlass","PartGlass","PartEngine","PartEngine","PartVRotor","PartVRotor","PartFueltank","PartFueltank","ItemFuelcan","ItemFuelcan","ItemJerrycan","ItemJerrycan","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","CinderBlocks","10Rnd_762x54_SVD","10Rnd_762x54_SVD"]
]
];
_loot = _loot_lists call BIS_fnc_selectRandom;






_positionp = player call FNC_GetPos;

_positiondrop = [(_positionp select 0) + 50, (_positionp select 1) + 50,25];
_box = _boxtype createVehicle _positiondrop;
clearweaponcargoglobal _box;
clearmagazinecargoglobal _box;

_chute = createVehicle ["ParachuteMediumEast", getPos _box, [], 0, "FLY"];
_box attachTo [_chute, [0,0,3]];
_smoke = "SmokeShellYellow" createVehicle (getPos _box);
_smoke attachTo [_box, [0,0,0]];

//add loot
{
_box addWeaponCargoGlobal [_x,1];
} forEach (_loot select 0);
{
_box addMagazineCargoGlobal [_x,1];
} forEach (_loot select 1);

sleep 180;

deleteVehicle _box;
deleteVehicle _chute;

 

you can use it with right click actions. but players can use it more than 1 time if they disconect and conect again.

To prevent it.. you can add a item restriction.. for example add a rare item in your loadout. a bible (ItemBookBible)

then in a extra_rc.hpp add:

Spoiler

class ExtraRc {
 
   class ItemBookBible {
     class Box {
            text = "HolyBox";
            script = "execVM 'custom\holybox.sqf'";
        };
   };	
};

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...