Jump to content
Sign in to follow this  
Fenrisswolf

Make a unit join the player group

Recommended Posts

Hey,

i want to make it possible to make a unit join the player group and this with addaction.

Place a unit and named it u1 and wrote into its init line ...

act1 = u1 addaction ["Join group","group\join.sqs",0,1, true, true,"test2"];

or

u1 addEventHandler ["Join Group", {handle = [(_this select 0),(_this select 1)] execVM call group\join.sqs}]

and in the join.sqf i wrote ...

_unit = _this select 0;
_user = _this select 1;
_usergroup = group _user;

[_unit] join _usergroup;

Unfortunaltely the soldier is not joining my group ... can anybody help?

Edited by Fenrisswolf

Share this post


Link to post
Share on other sites

Use group player instead and remove _user = _this select 1, it's not needed. Use this with addaction thoguh as there is no Eventhadler called "Join Group". Also, any particular reason why you use sqs over sqf?

Share this post


Link to post
Share on other sites
Use group player instead and remove _user = _this select 1, it's not needed. Use this with addaction thoguh as there is no Eventhadler called "Join Group". Also, any particular reason why you use sqs over sqf?

Oh, sps instead sqf was a typing error :D sorry. I modified the script as you told me, hope that is what you meant!?

act1 = u1 addaction ["Join group","group\join.sqs",0,1, true, true,"test2"];

and in the join.sqf i wrote ...

_unit = _this select 0;
_usergroup = group player;

[_unit] join _usergroup;

---------- Post added at 18:54 ---------- Previous post was at 18:17 ----------

Okay now the unit joins my group ... perfect! BUT it is not reacting on any of my orders ... :-(

I am using the ACE Mod btw ...

---------- Post added at 19:09 ---------- Previous post was at 18:54 ----------

Hm i found this in a very very old post regarding the join unit problem with the ACE Mod, its said to put it in the init line ...

can somebody tell me how to use this or explain how to get it to work?

[-2, { [_this select 0] join (_this select 1) }, [test1, player]] call ACE_NET_fSend;

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  

×