Forum Jump :

Author Message


Posts: 17
Rank:


Level: Hidden

Country: us
Location:
Occupation:
Age:
In-game name: Smash Balls

 
#1 Posted at 2012-10-21 22:26        
     
I'm trying to make a free mode so me and my friends can mess around and do whatever with all the vehicles lined up at the airport with limited population in the cities. I got everything I want such as respawnable cars, and points for your guy...ect but alls i need to do is get the ammo crates to reset every few minutes so that way we can't use up all of are guns. Can anyone give me a script that will make this possible if not then I'll find another way.


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#2 Posted at 2012-10-21 22:51        
     
Something like this should work. Verify the classnames, can't remember if the A2 is in AA or just A2. :)
/////////////////////////////////////////////////////
//
// US Weapons Ammo Crate Fill Script.
//
// Called from an ammocrate's init field via:
//   nul = this execVM "ammo.sqf";
//
/////////////////////////////////////////////////////

while {alive _this} do
{

// Remove the stock items from the crate
clearMagazineCargo _this;
clearWeaponCargo _this;

/////////////////////////////////////////////////////
// WEAPONS
/////////////////////////////////////////////////////

// Main Battle Rifles (MBR)
_this addWeaponCargo ["M16A2", 100];

// Pistols
_this addWeaponCargo ["M9", 100];

// AT & AA
_this addWeaponCargo ["M136", 100];

/////////////////////////////////////////////////////
// AMMO
/////////////////////////////////////////////////////

// MBR ammo
_this addMagazineCargo ["20Rnd_556x45_Stanag", 100];

// Pistol ammo
_this addMagazineCargo ["15Rnd_9x19_M9", 100];

// M203 ammo
_this addMagazineCargo ["1Rnd_HE_M203", 100];

// AT & AA ammo
_this addMagazineCargo ["M136", 100];

// Items
_this addWeaponCargo ["Binocular", 100];
_this addWeaponCargo ["NVGoggles", 100];

// Grenades & Satchels
_this addMagazineCargo ["HandGrenade_West", 100];
_this addMagazineCargo ["SmokeShell", 100];

// Restock time.  1800 = 30 minutes.
sleep 1800;
};


Advertisement


Author Message


Posts: 17
Rank:


Level: Hidden

Country: us
Location:
Occupation:
Age:
In-game name: Smash Balls

 
#3 Posted at 2012-10-22 01:50        
     
Thank you Pirin for your help! This gets me a lot closer to what i want to do but is there a way to make it so were it just regenerates the weapons already put in the crate instead of replacing them? (I'm a noob at scripting) an example would be much appreciated!


Author Message

Pirin  



Posts: 1547
Rank:


Level: Member

Country: us
Location: Atlanta, GA
Occupation: IT
Age: 43
In-game name: kylania

 
#4 Posted at 2012-10-22 01:53        
     
That's basically what the script does. First it clears whatever default items are in the box. Then it adds all the weapons and ammo you declare via the addWeaponCargo and addMagazineCargo commands. Then it repeats that process every 5 minutes or however long you want it to.

While you could grab what's it in and keep track of that and refill via that, it's usually easier to just clear/fill from scratch. :)


Author Message


Posts: 17
Rank:


Level: Hidden

Country: us
Location:
Occupation:
Age:
In-game name: Smash Balls

 
#5 Posted at 2012-10-22 02:30        
     
Thanks again Pirin for you help! this works great! I've looked everywhere for this answer and I could not find it *HELP* so I finally decide to post a question about it and it gets answered instantly *YAHOO* . (best forum yet *THUMBS UP* )


Author Message


Posts: 497
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 42
In-game name:

 
#6 Posted at 2012-10-22 07:41        
     
Heres another tool, an ammo script builder, and regenerator:
DOGS OF WAR AMMOBOX FILLER
http://13th-vdv.co.uk/dowaf/weapon.php


Author Message


Posts: 17
Rank:


Level: Hidden

Country: us
Location:
Occupation:
Age:
In-game name: Smash Balls

 
#7 Posted at 2012-10-22 21:24        
     
Thank you Günter Severloh! that link is very useful because I am far too lazy to script this on my own!