Forum Jump :

Author Message


Posts: 1
Rank:


Level: Member

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

 
#1 Posted at 2012-12-14 21:10        
     
I have a script so that when a unit dies it respawns with the customized loadout I had set for it. Okay, I have a killed event handler in the init.sqf like so:
player addEventHandler ["killed", 
	{ 
		[] spawn {
			waitUntil { alive player };
			execVM "weapons.sqf";
		};	
	}]; 

Then in the weapons.sqf I have this:
if (side = west) then {
removeallweapons _unit;
_unit addmagazine "30rnd_556x45_stanag";
_unit addweapon "M16A2";
_unit addmagazine "30rnd_556x45_stanag";
_unit addmagazine "30rnd_556x45_stanag";
_unit addmagazine "15rnd_9x19_M9";
_unit addweapon "M9";
_unit addmagazine "15rnd_9x19_M9";
_unit addmagazine "15rnd_9x19_M9";
_unit addmagazine "handgrenade_west";
_unit addmagazine "handgrenade_west";
};

Upon respawning the unit is just given back his class specific weapons.
If anyone could explain to me what I'm doing wrong that'd be super.






Tags: 2, Arma, Issues, Script