Jump to content
Sign in to follow this  
2nd47

Respawning with different loadout

Recommended Posts

I'm not very experienced with scripting and am trying to respawn players as a sort of scout class and replace their default loadout with this one. I've tried the following but it doesn't seem to work. I've made onPlayerRespawn.sqf and set this inside of it "_this execVM "spawn.sqf";". Then in the spawn.sqf I've done a

if (_this playerside == west) then 
{removeallweapons this; this addweapon "m16a2GL"; this addmagazine "flarered_m203"}; 

to give the players flares and a rifle. When I tried it out myself I still respawned with the regular loadout of M4 and whatnot. If anyone could help me out with this it would be much appreciated.

Edited by 2nd47

Share this post


Link to post
Share on other sites

You need to add the Killevent for every player... in this wait the playerrespawntime.. then exec your weapon Script... in this make sure you add the magazines FIRST !

if you want to add different Weapons for the Playerclasses you need to readout the Class with: typOf player

Edited by R34P3R

Share this post


Link to post
Share on other sites
You need to add the Killevent for every player... in this wait the playerrespawntime.. then exec your weapon Script... in this make sure you add the magazines FIRST !

if you want to add different Weapons for the Playerclasses you need to readout the Class with: typOf player

I'm understanding what you mean but I have no clue how to implement it into what I have now.

Share this post


Link to post
Share on other sites
i will post you a sample later...

Thanks

Share this post


Link to post
Share on other sites

Call respawn.sqf from init.sqf

Have within it a killed event handler

player addEventHandler ["killed", 
{ 
	[] spawn {
		waitUntil { alive player };
		execVM "weapons.sqf";
	};	
}];

With weapons containing the loadout

if (side=west) then {
removeallweapons this;
et cetera;};

Or something similar...

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  

×