• 🏆 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!

[Trigger] Kick command with name

Status
Not open for further replies.
Level 4
Joined
Dec 11, 2019
Messages
55
Hello!

So i have been wondering, if it was possible to kick someone with just your account name. Meaning me "Bolty" writing "!kick blue" or "!kick 2" and then he will be kicked, i have tried a few ways but keept falining. It is a map with 8 players, and i really do not want to give the power to the Red player, i only want it since i somtimes got people who teamkill their own mates, and i would like to prevent it.

I have tried to do chat string is player red types !kick blue
Condition was: player red equals bolty basicly my name
and Action is defeat for player 2(blue) message "You have been kicked"
Display to all players text: "name of player blue" Has been kicked.

(( Also a note, i use the german version))
 
Level 4
Joined
Dec 11, 2019
Messages
55
I have trouble finding the option that you put in of (Name of (Triggering Player)), i just looked into almost everrything and do not seem to find it, did you create a variable extra? Also thanks for helping!
 
Do this instead:

Step 1:
Make a new variable called "Host". The variable type should be "Player".

Step 2:
Paste the following in your map header;
JASS:
function GetHost takes nothing returns nothing
   local gamecache g = InitGameCache("Map.w3v")
   call StoreInteger(g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
   call TriggerSyncStart()
   call SyncStoredInteger(g, "Map", "Host" )
   call TriggerSyncReady()
   set udg_Host = Player( GetStoredInteger(g, "Map", "Host" )-1)
   call FlushGameCache(g )
   set g = null
endfunction
You can paste it in the map header by simply clicking the map icon above all your triggers, then pasting it into the text box on the right side.

Step 3:
Set the host with the following trigger:
  • Get Host
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: Custom script: call GetHost()

Step 4:
Kicking players.
Use the following to kick a player:
  • Get Host
    • Events
      • Player - Player 1 (Red) types a chat message containing !kick blue as An exact match
    • Conditions
      • (Triggering player) Equal to Host
    • Actions
      • Game - Defeat Player 2 (Blue) with the message: You have been kicke...


Guide taken from here. It's throwing an insecure website warning so click at your own risk. That is why I wrote down the tutorial here instead of simply linking it.
 
Level 4
Joined
Dec 11, 2019
Messages
55
Does it work on any position? Lets say its a 8 player map and theres 8 forced Slots, That you can choose from and you are suddenly Purple or Teal, or Orange does these all work with having one command to kick a teamkiller or someone very toxic? Since that is all i aim for, i just want a decent kick command, for me so normal people won't abuse it.
 
Does it work on any position? Lets say its a 8 player map and theres 8 forced Slots, That you can choose from and you are suddenly Purple or Teal, or Orange does these all work with having one command to kick a teamkiller or someone very toxic? Since that is all i aim for, i just want a decent kick command, for me so normal people won't abuse it.
Yeah but you need to add in events/actions for the other players as well.
 
Level 4
Joined
Dec 11, 2019
Messages
55
solution from me.JPG


There you go
 
Level 9
Joined
Jul 30, 2018
Messages
445
Also, if the research time is not essential, you could just set the level of research with the trigger, without all that hassle with selecting all the correct units and adding gold etc. There is an action "Player - Set Current Research Level" (or something like that).
 
Status
Not open for further replies.
Top