soundblaster 12 Posted April 21, 2016 Hey guys, I am working on a modification of a script. Right now I want players to have the choice to be able to join each others their group. Currently when you join someone his group it works all fine. The problem right now is when you leave the group it should move you back to you're old groupID. Currently it is not doing that and I know it makes sense because you're ment to save your GroupID before you join someone his group and with that information you can set the groupID back to the old GroupID. I am just confused with the bit how do I save someone his GroupID once in a variable to use in a command, an example: _YourOldGroup = groupId (group player); [player] joinSilent _YourOldGroup; I think this way it would work but the problem is obviously _YourOldGroup will change because you are joining someone else his group, because of that it will set your group ID to your current group and not your old group... I hope I made a bit sense... Thank you for your time! Share this post Link to post Share on other sites
hoverguy 177 Posted April 21, 2016 Why don't you just store your old group in a global var before joining a new group. My_Old_Group = groupId (group player); Then you check if group still exists, if it does re-join it. 1 Share this post Link to post Share on other sites
soundblaster 12 Posted April 22, 2016 Why don't you just store your old group in a global var before joining a new group. My_Old_Group = groupId (group player); Then you check if group still exists, if it does re-join it. I guess not a bad idea! There is only one problem... Will the group still exist even without someone in it? I am using a mission that is dependent on players to be in a certain groupID. Share this post Link to post Share on other sites
MKD3 27 Posted April 22, 2016 If 100% of the players/units leave the group then yeah it will be lost. What relies on the groupID? cos you could probably do it other ways.Why not just save the leader of the old group and then rejoin on whatever group he is in now. Share this post Link to post Share on other sites
Guest Posted April 22, 2016 1. Attach old group id on the player (player setvariable ["oldGroup",group player]; 2. When you want to make him join his last group check : if((player getVariable "oldGroup") in allGroups) 3. _oldGrp = player getVariable "oldGroup"; player setvariable ["oldGroup",group player];[player] joinSilent _oldGrp; Share this post Link to post Share on other sites
soundblaster 12 Posted April 22, 2016 1. Attach old group id on the player (player setvariable ["oldGroup",group player]; 2. When you want to make him join his last group check : if((player getVariable "oldGroup") in allGroups) 3. _oldGrp = player getVariable "oldGroup"; player setvariable ["oldGroup",group player];[player] joinSilent _oldGrp; Dude you're my hero! 1 Share this post Link to post Share on other sites