Jump to content
  • 0

Create a custom box with infistar?


BetterDeadThanZed

Question

8 answers to this question

Recommended Posts

  • 0

I think  know what he's looking for and we're working on doing the same thing (but not there yet).  We run events on our server - things like "hunt the admin", road rallies, demolition derbies, and/or air battles for people to participate in, with various prizes for the winners.  What we do is spawn in boxes with contents appropriate for the event.  Like a road rally box that has spare parts.  The participants have 30 seconds (for example), to load up on whatever spare parts they want, and then the starting gun sounds and the race is off.  So what we are working on is the ability to spawn in those boxes with whatever contents we deem appropriate at the start of an event and then delete them when done.

 

We have the idea but haven't tackled it yet.  We're adding and fixing other scripts first.

 

Bob

Link to comment
Share on other sites

  • 0

Ok, here ya go. In this example, I show how I made a "Bambi Box". This box has some basic building materials so a new player can make a secure little area for their stuff if they are new. 

 

The code changes all go in ah.sqf. Find this line:

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

Below it, add this line: 

adminadd = adminadd + ["  Spawn Bambi Box",bambibox,"0","0","0","0",[]]; 

Find these lines 

supplypackage1 =
{

Just above that, add this:

bambibox =
{
    PVAH_AdminReq = [9050,player];
    publicVariableServer "PVAH_AdminReq";


    hint format["Bambi Box Spawned!"];
    cutText [format["Bambi Box Spawned!"], "PLAIN DOWN"];


    _sl = format["%1 - BAMBI BOX @%2",name player,mapGridPosition getPosATL player];
    PVAH_WriteLogReq = [player,_sl];
    publicVariableServer "PVAH_WriteLogReq";
};

Note the "9050,player". The 9050 is the "code" for the box. Supply package 1, as seen above, is "9004". I chose 9050 just to be sure it wouldn't interfere with the numbers for any other boxes.

 

Now, search for these lines:

if (_option == 9004) then
{

Just above that add this:

if (_option == 9050) then
{
   _dir = getdir _playerObj;
   _pos = getPos _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 = 'Foodbox1' createVehicle _pos;
       clearWeaponCargoGlobal _b0x;
       clearmagazinecargoGlobal _b0x;
       _b0x setPosATL _pos;
       {_b0x addMagazineCargoGlobal [_x, 1];} forEach ['ItemWoodWallLg','ItemWoodWallLg','ItemWoodWallLg','ItemWoodWallWithDoorLgLocked','ItemWoodWallLg','ItemWoodWallLg','ItemTentOld','30m_plot_kit','workbench_kit'];
       _b0x addWeaponCargoGlobal ['ItemHatchet_DZE', 1];
       _b0x addWeaponCargoGlobal ['ItemCrowbar', 1];
       _b0x addWeaponCargoGlobal ['ItemEtool', 1];
       ['ItemWoodWallLg','ItemWoodWallLg','ItemWoodWallLg',
'ItemWoodWallWithDoorLgLocked','ItemWoodWallLg','ItemWoodWallLg','ItemTentOld','30m_plot_kit','workbench_kit'];
};
};

That's all there is to it.

 

Link to comment
Share on other sites

  • 0

There is also a very easy way of doing so if you have no need for the presets :)

 

Look in your AH.sqf for:

 

 

if (_option == 9004) then

 

under it you should see a list made up of:

 

 

_b0x addMagazineCargoGlobal

 

_b0x addMagazineCargoGlobal ['youritem', itemamount];

 

so for 40 cinder it would be:

 

_b0x addMagazineCargoGlobal ['cinder_wall_kit', 40];

 

 

Now I suppose you are getting the idea of it,

 

you can add as many as you wish.

 

For example:

 

_b0x addMagazineCargoGlobal ['cinder_wall_kit', 40];
_b0x addMagazineCargoGlobal ['MortarBucket', 40];
_b0x addMagazineCargoGlobal ['CinderBlocks', 160];
_b0x addMagazineCargoGlobal ['sandbag_nest_kit', 2];
_b0x addMagazineCargoGlobal ['forest_large_net_kit', 3];
_b0x addMagazineCargoGlobal ['cinder_garage_kit', 2];
_b0x addMagazineCargoGlobal ['ItemTankTrap', 6];
_b0x addMagazineCargoGlobal ['ItemPole', 6];
_b0x addMagazineCargoGlobal ['ItemComboLock', 2];
_b0x addMagazineCargoGlobal ['ItemWoodenLadder', 5];
_b0x addMagazineCargoGlobal ['ItemWoodenStairs', 4];
_b0x addMagazineCargoGlobal ['ItemWoodenStairsSupport', 1];
_b0x addMagazineCargoGlobal ['metal_floor_kit', 20];
_b0x addMagazineCargoGlobal ['ItemVault', 3];
 
 
 
Goodluck!
 
Best regards,
Blite
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...