Jump to content

Recommended Posts

{    
_rankRating = _x getVariable "rankRatingServer";   

_x setVariable ["rankRatingServer", _rankRating+1];  
} forEach units group player;

Hi everyone, its possible setVariable for each players in group?

Share this post


Link to post
Share on other sites

Think about locality. Several players and a server means you are in multiplayer, so, if your code runs on server:

 

{ _x setVariable ["rankRatingServer", (_x getVariable ["rankRatingServer",0]) +1,TRUE] } forEach (units aGroup select {isPlayer _x});

 

Notes:

- True means the variable is shared  as public variable

- there is no player on dedicated so command player can't be used. You need to point at the right group aGroup by another mean.

 

  • Like 1

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

×