Jump to content
  • 0

Spawning a Donor Box


Mochan

Question

So I am working on a donor box script but a little stuck, my idea is a scroll wheel menu like the blue phonenix, where I can just choose deploy Box #1 or Box#2, It then executes the following script

if (isServer) then {


		_vehicle_999999 = objNull;
		
		if (true) then
		{
		  _this = createVehicle ["TKVehicleBox_EP1", [8000.0,10000.0], [], 0, "CAN_COLLIDE"];
		  _vehicle_999999 = _this;
		  _this setDir 20;

		  clearWeaponCargoGlobal _this;
		  clearMagazineCargoGlobal _this;

		  


		  _this addMagazineCargoGlobal ["30m_plot_kit", 1];
		  _this addMagazineCargoGlobal ["ItemWoodWallLg", 100];
		  _this addMagazineCargoGlobal ["ItemWoodFloor", 100];
		  _this addMagazineCargoGlobal ["ItemWoodWallWithDoorLgLocked", 15];
		  _this addMagazineCargoGlobal ["ItemWoodWallGarageDoorLocked", 5];
		  _this addMagazineCargoGlobal ["ItemWoodStairs", 25];
		  _this addMagazineCargoGlobal ["ItemWoodLadder", 25];
		  _this addMagazineCargoGlobal ["ItemDocumentRamp", 10];
		  _this addMagazineCargoGlobal ["cinder_wall_kit", 100];
		  _this addMagazineCargoGlobal ["cinder_garage_kit", 15];
		  _this addMagazineCargoGlobal ["cinder_door_kit", 15];
		  _this addMagazineCargoGlobal ["CinderBlocks", 250];
		  _this addMagazineCargoGlobal ["MortarBucket", 250];
		  _this addMagazineCargoGlobal ["PartGeneric", 250];
		  _this addMagazineCargoGlobal ["ItemPole", 100];
		  _this addMagazineCargoGlobal ["ItemTankTrap", 250];
		  _this addMagazineCargoGlobal ["metal_floor_kit", 100];
		  _this addMagazineCargoGlobal ["ItemVault", 2];
		  
		};

};

I am having a few issues, could I just use a self actions style of script then verify the UID? Also as you can see in the above code it states the worldspace, how can I change this to the current area of the player. 

 

Thanks Aidan :-)

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

If you pheonix admin tools you can make the following into an sqf file of your choosing and drop it into the tools folder, then add the menus through the admintoolsmain.sqf that sarge variable makes it so anti hack doesn't delete your box after a couple minutes. all items spawned like this disappear after restart. so its important that whoever donated gets the materials into a safe or vehicle before restart.

_crate = "USVehicleBox" createVehicle (position player);
_crate setVariable ["Sarge",1,true];

clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;

// add weapons
_crate addWeaponCargoGlobal ["ChainSaw", 2];
_crate addWeaponCargoGlobal ["ItemToolbox", 10];
_crate addWeaponCargoGlobal ["ItemEtool", 10];
_crate addWeaponCargoGlobal ["ItemKnife", 10];
_crate addWeaponCargoGlobal ["ItemEtool", 10];
_crate addWeaponCargoGlobal ["ItemCrowbar", 10];
_crate addWeaponCargoGlobal ["ItemSledge", 10];

// add items
_crate addMagazineCargoGlobal ["workbench_kit", 2];
_crate addMagazineCargoGlobal ["ItemJerrycan", 2];
_crate addMagazineCargoGlobal ["ItemMixOil", 2];
_crate addMagazineCargoGlobal ["ItemVault", 2];
_crate addMagazineCargoGlobal ["ItemFireBarrel_kit", 4];
_crate addMagazineCargoGlobal ["PartPlankPack", 100];
_crate addMagazineCargoGlobal ["PartPlywoodPack", 100];
_crate addMagazineCargoGlobal ["CinderBlocks", 100];
_crate addMagazineCargoGlobal ["MortarBucket", 100];
_crate addMagazineCargoGlobal ["PartGeneric", 100];
_crate addMagazineCargoGlobal ["ItemTankTrap", 100];
_crate addMagazineCargoGlobal ["ItemWire", 100];
_crate addMagazineCargoGlobal ["ItemSandbag", 100];
_crate addMagazineCargoGlobal ["cinder_wall_kit", 100];
_crate addMagazineCargoGlobal ["cinder_garage_kit", 5];
_crate addMagazineCargoGlobal ["cinder_door_kit", 5];
_crate addMagazineCargoGlobal ["metal_panel_kit", 100];
_crate addMagazineCargoGlobal ["metal_floor_kit", 100];
_crate addMagazineCargoGlobal ["ItemPole", 100];
_crate addMagazineCargoGlobal ["ItemComboLock", 10];
_crate addMagazineCargoGlobal ["30m_plot_kit", 5];

_crate attachto [player, [0,3,1.7]];
sleep 5;
detach _crate;
player reveal _crate;

here is the bit of my admintoolsmain that references this file. this file i saved and called buildingcrate.sqf. the above file will place a building crate in front of you that you can then select in real time where you want placed for about 5 seconds. after 5 seconds its placed.

 

this accomplishes two things, you don't ahve to worry about coordinates because the box spawns on top of you. and to give a donator a box you have be at their location, which means you get an idea where your players are building bases.

 

below is teh custom menu I built, and below that is how you setup the reference to a new custom menu.

StormysMenu =
[
["",true],
		["God Mode", [2],  "", -5, [["expression", format[_EXECscript1,"Godmode.sqf"]]], "1", "1"],	
		["Repair Buildings", [3],  "", -5, [["expression", format[_EXECscript1,"fixbuildings.sqf"]]], "1", "1"],
		["Generate Vehicle Key", [4],  "", -5, [["expression", format[_EXECscript1,"generatekey.sqf"]]], "1", "1"],
		["Select Object for Delete", [5],  "", -5, [["expression", format[_EXECscript1,"select.sqf"]]], "1", "1"],
		["Delete Selected Object", [6],  "", -5, [["expression", format[_EXECscript1,"delete.sqf"]]], "1", "1"],
		["Building Supplies(clan only)", [7],  "", -5, [["expression", format[_EXECscript1,"buildingcrate.sqf"]]], "1", "1"],
		["Building Supplies(sm)", [8],  "", -5, [["expression", format[_EXECscript1,"buildingsmall.sqf"]]], "1", "1"],
		["Medical Supplies", [9],  "", -5, [["expression", format[_EXECscript1,"medicalcrate.sqf"]]], "1", "1"],
		["", [-1], "", -5, [["expression", ""]], "1", "0"],
			["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
];
	if ((getPlayerUID player) in ["12345678"]) then { //mods puid listed as "11111111","2222222"
        adminmenu =
        [
			["",true],
				["Stormy's Tools", [2], "#USER:StormysMenu", -5, [["expression", ""]], "1", "1"],
				["", [-1], "", -5, [["expression", ""]], "1", "0"],
			["Exit", [13], "", -3, [["expression", ""]], "1", "1"]	
        ];};
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...