Jump to content
  • 0

Custom Crate & Editing infistar


lordgeorge

Question

Hey guys

 

I am new to sql scripting, so please understand my knowledge of this is very low.

I have been a server admin for over two weeks on a dayz epoch server.

I also help with the scripting, normal business of fixing minor issues and adding addons.

The server heavily relys on donations to run "as they all do".

1st: is it possible to create a custom adminbox for donator gear ? If so how ? :)

2nd We use infistar AH admin tools, i would love to add these custom crates to the spawn menu to make it easy for the admin's with no access to acp and databse to spawn the item when a donation is made.

 

Any help would be greatly appreciated :)

 

Cheers

George

Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

If you open AH.sqf (the infistar file) you can see there's options to create various boxes. (Epoch Box, etc)

You can use that code as a starting block to adding your own boxes. I'll share my "Donor Box" code when

I get home (currently at work) if you still need it.

 

Remember to back everything up.

Also, take a look at the Blur Gaming forums, it appears the latest version has a "back-door" that's allowing

cheaters to access the infistar menu's and use it as if they were Higher Admins. Hopefully it'll be fixed soon.

Link to comment
Share on other sites

  • 0

If you open AH.sqf (the infistar file) you can see there's options to create various boxes. (Epoch Box, etc)

You can use that code as a starting block to adding your own boxes. I'll share my "Donor Box" code when

I get home (currently at work) if you still need it.

 

Remember to back everything up.

Also, take a look at the Blur Gaming forums, it appears the latest version has a "back-door" that's allowing

cheaters to access the infistar menu's and use it as if they were Higher Admins. Hopefully it'll be fixed soon.

Hey

 

Yeah I did look inside the AH.sqf and found the section for the epoch-box, I then proceeded to add three boxes after that.

I am also at work :P

Thank you very much, I was finding it more puzzling how to link the menu code to execute the code as I have not been able to find the location of the epoch-box contents to know it all links :(

Thanks for the heads up on the backdoor btw :)

Any help is amazing so that would be brill ;)

 

Taa

George

Link to comment
Share on other sites

  • 0

QUICK DISCLAIMER: I'll simply tell you what I did in order to get my boxes to work.

I won't attempt to explain the code because I'll probably be wrong on 70% or more of it :-)

 

Ok, first off all, let's find the Menu items for the boxes.

Open Notepad++ (or your editor of choice) and find:

adminadd = adminadd + ["  Spawn Epoch-Box",admincrateEpoch,"0","0","0","0",[]];

It's at around line 2177.

 

We'll make a copy of that but modify it to suit our needs, like this:

adminadd = adminadd + ["  Spawn Donor-Box",admincrateDonor,"0","0","0","0",[]];

Next up, search the code (CTRL+F) for admincrateEpoch, it'll take you down to somewhere around line 3039 and this block:

admincrateEpoch =
{
	PVAH_AdminRequest = [61,player];
	publicVariableServer "PVAH_AdminRequest";
	
	hint format ["Epoch-Box"];
	cutText [format["Epoch-Box"], "PLAIN DOWN"];
	
	_savelog = format["%1 - EPOCH-BOX at %2",name player,mapGridPosition getPos player];
	PVAH_WriteLogRequest = [_savelog];
	publicVariableServer "PVAH_WriteLogRequest";
};

As you can see, the number 61 is the key here. We'll need to make a copy of that block, paste it underneath and replace 61 with our own number.

A number that's not already used for similar purposes. I used 3571 - it's part of my username but with a 1 on the end as it's the first box I added. Clever, no? :-P

admincrateDonor =
{
	PVAH_AdminRequest = [3571,player];
	publicVariableServer "PVAH_AdminRequest";
		
	hint format ["Donor-Box"];
	cutText [format["Donor-Box"], "PLAIN DOWN"];
	
	_savelog = format["%1 - Donor-BOX at %2",name player,mapGridPosition getPos player];
	PVAH_WriteLogRequest = [_savelog];
	publicVariableServer "PVAH_WriteLogRequest";
};

Now, let's do a search for 61, which'll jump us down to line 5056 and this code:
 

if (_option == 61) then
{
	_dir = getdir (_array select 1);
	_pos = getPos (_array select 1);
	_pos = [(_pos select 0)+2*sin(_dir),(_pos select 1)+2*cos(_dir),(_pos select 2)];
	[_dir,_pos,(_array select 1)] spawn {
		_dir = _this select 0;
		_pos = _this select 1;
		_b0x = 'Foodbox0' createVehicle _pos;
		clearWeaponCargoGlobal _b0x;
		clearmagazinecargoGlobal _b0x;
			
		{_b0x addMagazineCargoGlobal [_x, 40];} forEach ['ItemWoodWallGarageDoor','ItemWoodWallGarageDoorLocked',
		'ItemWoodFloorHalf','ItemWoodWallDoorLg','ItemWoodWallWithDoorLgLocked','ItemWoodWallLg',
		'ItemWoodWallWindowLg','ItemWoodFloorQuarter','ItemWoodWallDoor','ItemWoodWallWithDoorLocked',
		'ItemWoodWall','ItemWoodWallWindow','ItemWoodWallThird','ItemWoodLadder','ItemWoodFloor','ItemWoodStairs',
		'ItemWoodStairsSupport','ItemTentDomed2','ItemTentDomed','ItemTent','ItemTankTrap',
		'ItemSandbagLarge','ItemSandbag','ItemPole','ItemCorrugated','ItemCanvas','ItemBurlap','PartWoodLumber',
		'PartWoodPlywood','bulk_empty','wooden_shed_kit','wood_shack_kit','workbench_kit','stick_fence_kit',
		'sandbag_nest_kit','sun_shade_kit','rusty_gate_kit','outhouse_kit','storage_shed_kit','light_pole_kit',
		'ItemLightBulb','desert_net_kit','forest_net_kit','desert_large_net_kit','forest_large_net_kit',
		'metal_panel_kit','ItemComboLock','FoodMRE','CinderBlocks','deer_stand_kit',
		'ItemGoldBar10oz','ItemSilverBar10oz','ItemGoldBar','ItemSilverBar','MortarBucket',
		'ItemCopperBar','ItemCopperBar10oz','ItemBriefcase100oz','ItemBriefcase80oz',
		'ItemBriefcase60oz','ItemBriefcase40oz','ItemBriefcase20oz',
		'm240_nest_kit','itemLockbox','metal_floor_kit','cinder_wall_kit','cinder_garage_kit','cinder_door_kit'];
		{_b0x addWeaponCargoGlobal [_x, 20];} forEach ['ItemKeyKit','ItemToolbox','ItemEtool'];
			
		_b0x attachTo [(_this select 2),[0,2,1]];
		sleep 1;
		detach _b0x;
	};
};

You'll need to make a copy (again) of this block and alter the contents to suit your needs. Being very careful about placement of comma's and semi-colons.

Here's what I used:
 

if (_option == 3571) then
{
	_dir = getdir (_array select 1);
	_pos = getPos (_array select 1);
	_pos = [(_pos select 0)+2*sin(_dir),(_pos select 1)+2*cos(_dir),(_pos select 2)];
	[_dir,_pos,(_array select 1)] spawn {
		_dir = _this select 0;
		_pos = _this select 1;
		_b0x = 'Foodbox0' createVehicle _pos;
		clearWeaponCargoGlobal _b0x;
		clearmagazinecargoGlobal _b0x;
			
		{_b0x addMagazineCargoGlobal [_x, 3];} forEach [
		'30Rnd_762x39_AK47',
		'6Rnd_45ACP',
		'ItemWoodWallGarageDoor',
		'ItemWoodWallGarageDoorLocked',
		'ItemWoodFloorHalf',
		'ItemWoodWallDoorLg',
		'ItemWoodWallWithDoorLgLocked',
		'ItemWoodWallLg',
		'ItemWoodWallWindowLg',
		'ItemWoodFloorQuarter',
		'ItemWoodWallDoor',
		'ItemWoodWallWithDoorLocked',
		'ItemWoodWall',
		'ItemWoodWallWindow',
		'ItemWoodWallThird',
		'ItemWoodLadder',
		'ItemWoodFloor',
		'ItemWoodStairs',
		'ItemWoodStairsSupport',
		'ItemTankTrap',
		'ItemSandbagLarge',
		'ItemSandbag',
		'ItemPole',
		'ItemCorrugated',
		'ItemCanvas',
		'ItemBurlap',
		'PartWoodLumber',
		'PartWoodPlywood',
		'bulk_empty',
		'wooden_shed_kit',
		'wood_shack_kit',
		'workbench_kit',
		'stick_fence_kit',
		'sandbag_nest_kit',
		'sun_shade_kit',
		'rusty_gate_kit',
		'outhouse_kit',
		'storage_shed_kit',
		'light_pole_kit',
		'ItemLightBulb',
		'desert_net_kit',
		'forest_net_kit',
		'desert_large_net_kit',
		'forest_large_net_kit',
		'metal_panel_kit',
		'FoodMRE',
		'CinderBlocks',
		'deer_stand_kit',
		'MortarBucket',
		'metal_floor_kit',
		'cinder_wall_kit',
		'cinder_garage_kit',
		'cinder_door_kit'];
			
		{_b0x addWeaponCargoGlobal [_x, 2];} forEach [
		'AKS_Gold',
		'revolver_gold_ep1',
		'ItemEtool'];
			
		_b0x attachTo [(_this select 2),[0,2,1]];
		sleep 1;
		detach _b0x;
	};
};	

It's not very organised (been too busy + keep forgetting) but it works.

You can add:

sleep 300;
deleteVehicle _b0x;

after the "detach _b0x" part if you want the box to auto-delete after 5 minutes.
Opening the Inifistar menu and using "Delete All Boxes" will also remove it but it's nice to have the extra option incase you forget.

Link to comment
Share on other sites

  • 0

I am using a scrollwheel with different boxes in it, another way to do it ofcourse but i can give the box different amount of items, thanks for Axe Cop for the script as he made that but i implemented it in the AH.

First add the command in the admin menu

adminadd = adminadd + ["  Donator Packages",donatormenu,"1","0","0","0",[]];

Then you need to make a scrollwheel menu. I just looked at the admin lite menu scrollwheel and edited for a donatorbox scrollwheel and made this:

donatormenu =
	{
		if (isNil "admindonatorz") then {admindonatorz = 0;};
		if (admindonatorz == 0) then
		{
			donatorscrollwheel =
			[
				["",true],
					["Starter Cinder builder Kit", [0],  "", -5, [["expression", "[] spawn startcinbox"]], "1", "1"],
					["Starter Wood builder Kit", [0],  "", -5, [["expression", "[] spawn startwoodbox"]], "1", "1"],
					["Fortification Cinder Kit", [0],  "", -5, [["expression", "[] spawn fortcinbox"]], "1", "1"],
					["Fortification Wood Kit", [0],  "", -5, [["expression", "[] spawn fortwoodbox"]], "1", "1"],
					["Clan Builder Cinder kit", [0],  "", -5, [["expression", "[] spawn clancinbox"]], "1", "1"],
					["Clan Builder Wood kit", [0],  "", -5, [["expression", "[] spawn clanwoodbox"]], "1", "1"],
						["Exit", [0], "", -3, [["expression", ""]], "1", "1"]
			];
			admindonatorz = 1;
			Donator_Package_Menu = player addaction [("<t color=""#6b4ebc"">" + ("Donator Package Menu") +"</t>"),"ca\modules\MP\data\scriptCommands\moveIn.sqf",
			"Driver (call adminpackage_helper);",5,false,false,"",""];
			adminpackage_helper = {showCommandingMenu "#USER:donatorscrollwheel";};
		}
		else
		{
			player removeAction Donator_Package_Menu;
			admindonatorz = 0;
		};
		
	};

I pasted it after the adminlite menu, somewhere around line 2434.

Spawn clancinbox is calling the box.

 

Then i pasted the donatorbox script from Axe Cop after adminheal = (ctrl F to find it)

clancinbox =
	{
		_crate = "MedBox0" createVehicle (position player);
		_crate setVariable ["Mission",1,true];

	clearWeaponCargoGlobal _crate;
	clearMagazineCargoGlobal _crate;

	// add weapons
		_crate addWeaponCargoGlobal ["ItemToolbox", 1];
		_crate addWeaponCargoGlobal ["ItemEtool", 1];
	// add items
		_crate addMagazineCargoGlobal ["cinder_wall_kit", 26];
		_crate addMagazineCargoGlobal ["metal_floor_kit", 20];
		_crate addMagazineCargoGlobal ["CinderBlocks", 104];
		_crate addMagazineCargoGlobal ["MortarBucket", 26];
		_crate addMagazineCargoGlobal ["30m_plot_kit", 1];
		_crate addMagazineCargoGlobal ["cinder_garage_kit", 4];
		_crate addMagazineCargoGlobal ["ItemPole", 16];
		_crate addMagazineCargoGlobal ["ItemTankTrap", 16];
		_crate addMagazineCargoGlobal ["ItemComboLock", 4];
		_crate addMagazineCargoGlobal ["ItemVault", 4];

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

		_savelog = format["%1 - Clan-Cin at %2",name player,mapGridPosition getPos player];
		PVAH_WriteLogRequest = [_savelog];
		publicVariableServer "PVAH_WriteLogRequest";
};

As you can see i called it clancinbox, liek it is in the scrollwheel menu.

You can change the items add set the amount behind it.

The variable mission is to prevent it from dissappearing.

The box will attach to you for 5 seconds so you can place it where you want and then detach.

 

If you want more donator boxes just copy it, rename it to something else and add it in the scrollwheel menu

 

maybe this will help you aswell :)

Link to comment
Share on other sites

  • 0

Hey DOS

 

Again thankyou too, its awsome having some real help.

As you highlighted i may want to spawn different ammounts of each item, unfortunately when i put your menu changes into the AH.SQF file it totaly broke the menu and did not register the F2 key.

I have since reverted it and tried different ways to use the lines.

Would it be possible for you to show me that files so i can see exactly where these lines were put in ?

I Also tried to incorporate DY357LX  menu suggestion as it does work and spawns the box. But i was unable to tell it how many of each item to spawn.

I am now at work so bit hard to show you what i did :lol:

Is it going to be possible to use DY357LX menu suggestion but specify the items within the carrier ?

 

Thanks guys

"Bit of a learning curve ! " ;)

 

George

Link to comment
Share on other sites

  • 0

Hello again, the part of the code that tells the box how many of each item to place in the box is on this line:
 

{_b0x addMagazineCargoGlobal [_x, 3];} forEach [

Change the 3 to 20 or whatever you want. I have it on 3 because that's what the guy who pays for the server wants it :)

(I simply maintain the addons. I rarely play the game, except to be the local heli-taxi for the new spawns.)

 

Remember that only certain items are "Magazine" cargo. (Think about what items can go in your 12 slot main inventory. Food, drink, etc. Tools cannot go there, neither can weapons, for those you'll need to edit "Weapon" cargo. See below.)

 

Same for:

{_b0x addWeaponCargoGlobal [_x, 20];} forEach

That'll make 20 of each weapon. Change to 2 or whatever suits your needs.

 

If you wanted a box containing 50x morphine + Painkillers you could use:

{_b0x addWeaponCargoGlobal [_x, 50];} forEach [
		'ItemMorphine', 'ItemPainkiller']; 

If you need the correct classnames (for example "ItemMophine" will work, "Itemmorphine" will not) I recommend bookmarking vbawol's git-hub link:
https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/Configs/CfgMagazines.hpp

Link to comment
Share on other sites

  • 0

Hey DOS

 

Again thankyou too, its awsome having some real help.

As you highlighted i may want to spawn different ammounts of each item, unfortunately when i put your menu changes into the AH.SQF file it totaly broke the menu and did not register the F2 key.

I have since reverted it and tried different ways to use the lines.

Would it be possible for you to show me that files so i can see exactly where these lines were put in ?

I Also tried to incorporate DY357LX  menu suggestion as it does work and spawns the box. But i was unable to tell it how many of each item to spawn.

I am now at work so bit hard to show you what i did :lol:

Is it going to be possible to use DY357LX menu suggestion but specify the items within the carrier ?

 

Thanks guys

"Bit of a learning curve ! " ;)

 

George

 

What does your RPT file say?

You probably forgot a small thing as i have it working :)

Link to comment
Share on other sites

  • 0

Hello again, the part of the code that tells the box how many of each item to place in the box is on this line:

 

{_b0x addMagazineCargoGlobal [_x, 3];} forEach [

Change the 3 to 20 or whatever you want. I have it on 3 because that's what the guy who pays for the server wants it :)

(I simply maintain the addons. I rarely play the game, except to be the local heli-taxi for the new spawns.)

 

Remember that only certain items are "Magazine" cargo. (Think about what items can go in your 12 slot main inventory. Food, drink, etc. Tools cannot go there, neither can weapons, for those you'll need to edit "Weapon" cargo. See below.)

 

Same for:

{_b0x addWeaponCargoGlobal [_x, 20];} forEach

That'll make 20 of each weapon. Change to 2 or whatever suits your needs.

 

If you wanted a box containing 50x morphine + Painkillers you could use:

{_b0x addWeaponCargoGlobal [_x, 50];} forEach [
		'ItemMorphine', 'ItemPainkiller']; 

If you need the correct classnames (for example "ItemMophine" will work, "Itemmorphine" will not) I recommend bookmarking vbawol's git-hub link:

https://github.com/vbawol/DayZ-Epoch/blob/master/SQF/dayz_code/Configs/CfgMagazines.hpp

Hey dude

 

Ok so what i meant is to make a box something like this

 

    // add weapons

        _crate addWeaponCargoGlobal ["ItemToolbox", 2];

        _crate addWeaponCargoGlobal ["ItemEtool", 2];

        _crate addweaponCargoGlobal ["itemcrowbar",2];

        _crate addweaponCargoGloabl ["ItemLockbox",1];

    // add items

        _crate addMagazineCargoGlobal ["ItemWoodWallLg", 15];

        _crate addMagazineCargoGlobal ["ItemWoodWallWithDoorLgLocked", 1];

        _crate addMagazineCargoGlobal ["ItemWoodFloor", 20];

        _crate addMagazineCargoGlobal ["ItemWoodWallWindow", 5];

        _crate addMagazineCargoGlobal ["30m_plot_kit", 1];

        _crate addMagazineCargoGlobal ["ItemWoodWallGarageDoorLocked", 4];

        _crate addMagazineCargoGlobal ["ItemWoodStairsSupport", 2];

        _crate addMagazineCargoGlobal ["storage_shed_kit", 1];

        _crate addMagazineCargoGlobal ["outhouse_kit", 1];

I know the above does not work, it was just a sample i used to test then alter.

So im looking at a box that has say 20 wood floors but then 10 wood walls.

I have tried all sorts of different ways to split each item but it causes all sorts of bugs in the RPT like errors in the lines i have edited, at times it stops the entire AH.sqf file loading with errors saying its missing.

 

 

Cheers for all the help so far :)

 

George

Link to comment
Share on other sites

  • 0

Try splitting them down into groups. I.E If you want 20 of item x, y and z, do this:

            // 20 Wood Floors + Metal Floors.
            {_b0x addMagazineCargoGlobal [_x, 20];} forEach [
            'ItemWoodFloor',
            'MetalFloor_DZ'];

            // 10 Wood Walls with windows. 10 without.
            {_b0x addMagazineCargoGlobal [_x, 10];} forEach [
            'ItemWoodWallLg',
            'ItemWoodWallWindow'];            
Link to comment
Share on other sites

  • 0

If you open AH.sqf (the infistar file) you can see there's options to create various boxes. (Epoch Box, etc)

You can use that code as a starting block to adding your own boxes. I'll share my "Donor Box" code when

I get home (currently at work) if you still need it.

 

Remember to back everything up.

Also, take a look at the Blur Gaming forums, it appears the latest version has a "back-door" that's allowing

cheaters to access the infistar menu's and use it as if they were Higher Admins. Hopefully it'll be fixed soon.

After the new infistar antihack patch there is no option to make your own custom crate. :(

Link to comment
Share on other sites

  • 0

After the new infistar antihack patch there is no option to make your own custom crate. :(

When did it update? I can still see the option my our files but we might be on an older version.

(Will check when I get home from work.)

Link to comment
Share on other sites

  • 0

You can still make custom boxes, using my old method, making a 2nd epoch box or something is a bit different now tho, but i have it working but i don't know if i can post that here as i used infiSTAR his crate spawning code and i don't want to get into trouble :p

Link to comment
Share on other sites

  • 0

instead of doing this, I have a custom crate.sqf that spawns at a designated area (obviously the players base) that refills after a designated amount of time. No other player can see it except for the person who bought it, as it is also based on UID's and uses createVehicleLocal.  I'll post it if anyone wants. 

Link to comment
Share on other sites

  • 0

Hello.
I'm working with infiSTAR. Try one lockbox with things inside appears and I get a few seconds but disap.
Here is the code.
Thank you

				adminadd = adminadd + ["  Vacio",admincrateEpoch,"0","0","0","0",[]];
				
	
admincrateEpoch =
	{
		PVAH_AdminReq = [9003,player];
		publicVariableServer "PVAH_AdminReq";
		
		hint format["Epoch-Box"];
		cutText [format["Epoch-Box"], "PLAIN DOWN"];
		
		_sl = format["%1 - EPOCH-BOX @%2",name player,mapGridPosition getPosATL player];
		PVAH_WriteLogReq = [player,_sl];
		publicVariableServer "PVAH_WriteLogReq";
	};
if (_option == 9003) then
		{
			_dir = getdir _playerObj;
			_pos = getPosATL _playerObj;
			_pos = [(_pos select 0)+2*sin(_dir),(_pos select 1)+2*cos(_dir),(_pos select 2)];
			[_dir,_pos,_playerObj] spawn {
				_dir = _this select 0;
				_pos = _this select 1;
				_b0x = 'LockboxStorage' createVehicle _pos;
				clearWeaponCargoGlobal _b0x;
				clearmagazinecargoGlobal _b0x;
				_b0x setPosATL _pos;
				_b0x addWeaponCargoGlobal ['ItemToolbox', 2];			
			};
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
  • Discord

×
×
  • Create New...