kahssymhir 1 Posted May 26, 2018 Hello, How can you retrieve (and subsequently save) the colours a group leader assigned to its squad mates? Thanks! Kahss Share this post Link to post Share on other sites
Belbo 462 Posted May 26, 2018 Here you go: https://community.bistudio.com/wiki/assignedTeam Share this post Link to post Share on other sites
kahssymhir 1 Posted May 26, 2018 28 minutes ago, Belbo said: Here you go: https://community.bistudio.com/wiki/assignedTeam Thanks! But I thought this didn't return anything, does it return a value if I don't provide the string? (sorry, I can't test this right now) Share this post Link to post Share on other sites
Belbo 462 Posted May 26, 2018 This returns the string of the team a unit is in - or nothing, if no unit is provided. _team = assignedTeam player; if (_team in ["MAIN","RED","GREEN","BLUE"]) then {format ["player has the colour %1",_team]}; 1 Share this post Link to post Share on other sites
kahssymhir 1 Posted May 27, 2018 Ah i see, perfect! Thank you very much! Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted May 27, 2018 15 hours ago, Belbo said: This returns the string of the team a unit is in - or nothing, if no unit is provided. _team = assignedTeam player; if (_team in ["MAIN","RED","GREEN","BLUE"]) then {format ["player has the colour %1",_team]}; this is right, but can also lead to script errors due to the potential for the command to return nothing. assignedTeam should always have an "isNil" check before use if (!isNil {assignedTeam <unit>}) then { _team = assignedTeam <unit>; } else { _team = "MAIN"; }; 2 Share this post Link to post Share on other sites
Belbo 462 Posted May 27, 2018 Yeah, it was not a specific way to handle this command, just an example of what the return means. Share this post Link to post Share on other sites