• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Kick player if their name is not _____

Status
Not open for further replies.
Level 7
Joined
May 15, 2009
Messages
169
I'm not the best with triggers, I'm more of a map balancer, but the guy who does the cool triggers for me is away, so I need some help.

For testing reasons, I host my map with a group of people, I want to be sure if one of them hosts it for someone else, it isn't going to get leaked.

My triggers guy was telling me you can make a trigger so if a players name isn't equal to XXXXXX then it will kick them. Can anyone help me with this?

I'm fully aware that someone could simply deprotect the map and remove this, or just as easily name spoof a name from the list, but if my map is cool enough for people to want to do that, all the power to em'.

Thanks!
 
Level 6
Joined
Apr 16, 2007
Messages
177
Well...
I have to say the following:
If you don't want the map to be leaked, kicking them ingame won't help.
Instead, they will just think "what a bugged map! I'll never play it again!!!"

I highly recommend showing a message instead "Warning: this is a closed beta map. The game will not be started.", and then popping up a dialog with just one button, the dialog should be titled
"Leave the game?" and have a button that says "Ok.".

To do that, I recommend adding the following global variables:
a string array for the names - TEST_Name
an integer with the number of names - TEST_NamesCount
a string - TEST_CurLoopName
a boolean - TEST_MayStay
Then you'll need a trigger:
One that runs at map init and checks for player names

At the one created at map init, initialize your name array:
  • Set TEST_Name[ 1 ] = "glorn2"
  • Set TEST_Name[ 2 ] = "betatesta"
  • Set TEST_NamesCount = 2
  • ---- Add more names and increase namescount as necessary ----
  • Set TEST_Dialog
  • Loop - For each integer A from 1 to 12, do:
    • Set TEST_CurLoopName = Lower Case (name of ( player( integer A ) ) )
    • set TEST_MayStay = false
    • Loop - For each integer B from 1 to TEST_NamesCount, do:
      • Set TEST_MayStay = TEST_Name[ 1 ] equals to (==) TEST_CurLoopName
      • 'If' - Conditions
        • - TEST_MayStay equals to== true
      • 'Then' - Actions
        • - set integer B = TEST_NamesCount
      • 'Else' - Actions
    • 'If' - Conditions
      • - TEST_MayStay equals to== false
    • 'Then' - Actions
      • - Display Timed Text to Player( integer A ): "|cffff3333This is a closed source map. You may not play this map."
      • - Show Custom Defeat Dialog to Player( integer A ) with the title "Leave?"
    • 'Else' - Actions
something between these lines
 
Status
Not open for further replies.
Top