Jump to content
Sign in to follow this  
anthonyfromtheuk

Respawn with original loadout defined in init

Recommended Posts

Hello i know this question has been asked a million times already but i cannot find what i want so at the risk of annoying some of you, please could you point me to a script that will allow me to play my mission in MP that will respawn my players as they spawned in. i am using the code below and this is all i want again when i respawn

{
       if (side _x == West) then {
               _x unassignItem "NVGoggles";
               _x removeItem "NVGoggles";
               _x addPrimaryWeaponItem "muzzle_snds_H";
               _x addPrimaryWeaponItem "optic_Arco";
               _x additem "g_tactical_clear";
               _x assignitem "G_Tactical_Clear";
       };

} foreach allunits;

Share this post


Link to post
Share on other sites

You could use this and put that addEventHandler into every unit's init.

Edited by aeroson

Share this post


Link to post
Share on other sites

Ive seen that already but it isn't quite what i want. i don't want to have to remove everything and add it all again i like the original set ups i just want the NVGs gone, tactical glasses on and silencer for all BLUEFOR. though looking at it i guess it will do the job if thats the only way. i did have that link saved in my bookmarks already as a backup

Share this post


Link to post
Share on other sites

You can edit the loadout.sqf to suit your needs.

loadout.sqf

_target = _this select 0;
_target unassignItem "NVGoggles"; 
_target removeItem "NVGoggles"; 
_target addPrimaryWeaponItem "muzzle_snds_H"; 
_target addPrimaryWeaponItem "optic_Arco"; 
_target additem "g_tactical_clear"; 
_target assignitem "G_Tactical_Clear"; 

Or you can put following code into mission's init.sqf

if(side player == West) then {
player addEventHandler ["Respawn", {
	player unassignItem "NVGoggles"; 
	player removeItem "NVGoggles"; 
	player addPrimaryWeaponItem "muzzle_snds_H"; 
	player addPrimaryWeaponItem "optic_Arco"; 
	player additem "g_tactical_clear"; 
	player assignitem "G_Tactical_Clear"; 
}];
};

Edited by aeroson

Share this post


Link to post
Share on other sites

if(side player == West) then {
player addEventHandler ["Respawn", {
	player unassignItem "NVGoggles"; 
	player removeItem "NVGoggles"; 
	player addPrimaryWeaponItem "muzzle_snds_H"; 
	player addPrimaryWeaponItem "optic_Arco"; 
	player additem "g_tactical_clear"; 
	player assignitem "G_Tactical_Clear"; 
}];
};

I tried this and no luck still spawn without that gear, is there something more i need to put in? say on the players init or something to get that to work? im new to this and have never used addeventhandler

my respawn is just a marker named respawn_west and this

respawn = "base";
respawndelay = 8;

Edited by Anthonyfromtheuk
Nevermind i got it :D just added this to player init this addeventhandler ["respawn"] Many thanks for your help

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×