• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Disabling Triggers For Only 1 Player

Status
Not open for further replies.
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 63
Joined
Jan 18, 2005
Messages
27,178
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.
 
Status
Not open for further replies.
Top