- Joined
- Feb 15, 2013
- Messages
- 372
May I ask how to craetes special effect that only show to allies?
GetLocalPlayer() == udg_Player then
endif
if IsPlayerInForce(GetLocalPlayer(), GetPlayersAllies(Player(0))) then
...
endif
No, GetLocalPlayer() returns a single player. You can only compare it to other player expressions.
You can use
JASS:if IsPlayerInForce(GetLocalPlayer(), GetPlayersAllies(Player(0))) then ... endif
GetPlayersAllies creates a new force though, that should be removed or recycled. You can setup the force in GUI.
Also, the local block works that way that only players (clients) who match the condition execute what is inside. GetLocalPlayer returns a different player per client, that's why it causes an asynchronity. You have to be careful to only put stuff in these places that is not prone to cause net traffic and does not alter the gameplay.