Disabling Triggers For Only 1 Player

Level 3
Joined
Oct 8, 2007
Messages
41
I would like to know is it possible, and if possible , how to disable a trigger for only a few players. I have thought about the idea of like creating a different trigger for each player and then just disabling those that the i want to disable, however that way seems too messy and complicated.
 
Level 4
Joined
Nov 18, 2007
Messages
79
There's no way to do that. If you disable a trigger, you disable the trigger. They aren't selective in any way.
 
Level 4
Joined
Nov 18, 2007
Messages
79
You would still be disabling the trigger as a whole. The trigger would not run for any player. So unless you made a set of triggers for each player, you wouldn't be able to disable a trigger specifically for one player.

An option, however, is to use a conditional. Use Need_O2's array, and put it into the Conditions statement of a trigger. If isdisabled(player) is false, then the Condition checks out and the trigger plays. Else, it does not.
 

Dr Super Good

Spell Reviewer
Level 60
Joined
Jan 18, 2005
Messages
26,722
You can easily run a trigger for only one player.

You use the GetLocalPlayer() or something to run it out of sync.

JASS:
If GetLocalPlayer() == YOURPLAYERHERE then
    //disable trigger
endif

NOTE that this probably will cause the player to fall out of sync with the game and be dropped, especially if the trigger influences objects so I strongly do not advise doing it in the first place.

If you mean disabling a trigger action from running with only one player while keeping the game in sync, use a condition and a variable to check if that player that he is allowed to use it.
 
Top