Jump to content
Sign in to follow this  
falconx1

pvp add all west players to same group

Recommended Posts

i want to add each faction to one group, so west is in their own group and independent is in their own group etc.

i want to know if im doing this correct first of all.

GroupGreen.sqf

//--create group for Independent, then have independent players join the group

_GroupGreen = Creategroup independent;
[g1,g2,g3,g4,g5,g6,g7,g8] joinSilent _GroupGreen;

GroupBlue.sqf

//--create group for West, then have west players join the group
_GroupBlue = Creategroup west;
[b1,b2,b3,b4,b5,b6,b7,b8] joinSilent _GroupBlue;

each green player in editor is named: g1,g2,g3,g4,g5,g6,g7,g8

each blue player in editor is named: b1,b2,b3,b4,b5,b6,b7,b8

each green players init field:

null = [this] execVM "GroupGreen.sqf"; this addeventhandler ["respawn","_this execVM 'GroupGreen.sqf'"];

each blue players init field:

null = [this] execVM "GroupBlue.sqf"; this addeventhandler ["respawn","_this execVM 'GroupBlue.sqf'"];

so another question. If I'm adding players to the groups correct etc do you see any bugs in code? like every single player who JIPS or respawns from death will always go into its right team sides group or no?

Share this post


Link to post
Share on other sites

are they gonna be back in group when they respawn? i still would like to know if i'm doing it right etc, because im trying to learn scripting more too

Share this post


Link to post
Share on other sites

Yes, groups are preserved upon respawn.

---------- Post added at 03:38 PM ---------- Previous post was at 03:36 PM ----------

Yes, groups are preserved upon respawn.

Also, the arguments of the function must be local to the machine running it, so you are not supposed to run it for a player on the server or run it for a player on another server's machine.

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  

×