Jump to content
Sign in to follow this  
Coolinator

How to use "setgroupid" properly in multiplayer?

Recommended Posts

im really confuse how to use the "setgroupid" code for multiplayer. >_<

In my missions there's two squads and there's a squad leader for each squad.

When i go to preview, it just shows for the "Alpha1-1" for the first squad name, then for the second squad name is "Alpha1-2"

How do i make it to just "Alpha" name for the first squad, and "Bravo" for the second squad?

Also, how do i change the name of the first squad leader to "Alpha Team leader", and the second squad leader name to "Bravo Team Leader"?

Plz show step by step, im not really good at scripting. :(

Share this post


Link to post
Share on other sites
[[group <player/name>,["<group name>"]],'setGroupID',true,true] spawn BIS_FNC_MP;
//eg
[[group player,["Alpha 3-3"]],'setGroupID',true,true] spawn BIS_FNC_MP;

Share this post


Link to post
Share on other sites

{
[
	[_x,
	[str _x]],
	"setGroupId",
	true,
	true
] call BIS_fnc_mp;
} forEach [alpha,bravo];

Oops, ninja'd

Share this post


Link to post
Share on other sites
[[group <player/name>,["<group name>"]],'setGroupID',true,true] spawn BIS_FNC_MP;
//eg
[[group player,["Alpha 3-3"]],'setGroupID',true,true] spawn BIS_FNC_MP;

How do i initialize this???

---------- Post added at 02:59 ---------- Previous post was at 02:57 ----------

{
[
	[_x,
	[str _x]],
	"setGroupId",
	true,
	true
] call BIS_fnc_mp;
} forEach [alpha,bravo];

Oops, ninja'd

4th time i asked this lol, im really sorry iceman >_<, How do i initialize this properly?

Share this post


Link to post
Share on other sites

In a server script.

init.sqf

execVM "serverScript.sqf";

serverScript.sqf

/* Assuming you named the groups in the editor. eg; alpha = group this, bravo = group this etc etc */

if (!(isServer)) exitWith {};

myGroupArray = [alpha,bravo,charlie,delta];

{
   [
       [
		_x,
		[str _x]
	],
       "setGroupId",
       true,
       true
   ] call BIS_fnc_mp;
} forEach myGroupArray;

Share this post


Link to post
Share on other sites

Be wary of using (_this select 3) as true.

As per the wiki entry, it can mess up your game if you have lots of people joining and leaving. Obv if this isn't the case then go ahead. Just be aware it can slow down the game if you have lots of use of it coupled with lots of clients (players).

Share this post


Link to post
Share on other sites
In a server script.

init.sqf

execVM "serverScript.sqf";

serverScript.sqf

/* Assuming you named the groups in the editor. eg; alpha = group this, bravo = group this etc etc */

if (!(isServer)) exitWith {};

myGroupArray = [alpha,bravo,charlie,delta];

{
   [
       [
		_x,
		[str _x]
	],
       "setGroupId",
       true,
       true
   ] call BIS_fnc_mp;
} forEach myGroupArray;

THnx!!!!

"/* Assuming you named the groups in the editor. eg; alpha = group this, bravo = group this etc etc */"

i also need help with that? because i have no clue how it works lol. What do you mean by alpha = group this? is there another code i need to use?

Share this post


Link to post
Share on other sites
You guys should come hang out. Links in the sig =)

Maybe - you know how I don't like people? There won't be people though will there? Did I say I don't like people? ;)

Share this post


Link to post
Share on other sites

It's okay. No one here likes people. We're growing on one another though =)

Share this post


Link to post
Share on other sites

You know that I only talk to you as you live out in the arse end of nowhere and probably hate general society as much as I do.

;)

Share this post


Link to post
Share on other sites
so put in the squad leader's init:

alpha = group this;

Ahh ty so much!!!! :)

Share this post


Link to post
Share on other sites

But it's effects are local? Nvm, init fields :)

Edited by Iceman77

Share this post


Link to post
Share on other sites

Init fields are fine for setGroupID, for your second question (I assume that you mean in role selection) you just change the "description" of your unit.

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  

×