Command Kick Player

IcatiaNight

New Member
Reaction score
1
I am making a TD Called Creepers TD and I tought to put in it the command -Kick (teal,blue,violet) but if i Kick one of them he can use the unit as nothing happened so i decided to destroy all unit that Teal or blue or violet uses but i don t know how to create a trigger that does what i want..

Thank you in advance
 

Regga-Voska

New Member
Reaction score
0
You may use mine.
Trigger:
  • Set Variables
    • Events
      • Map initialization
    • Conditions
    • Set Player[1] = Player 1
    • Set Player[2] = Player 2
    • Set Player[3] = Player 3
    • Set Player[4] = Player 4
    • Set Player[5] = Player 5
    • Set Player[6] = Player 6
    • Set Player[7] = Player 7
    • Set Player[8] = Player 8


Trigger:
  • Kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick player as A substring
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to (-kick player + (String((Integer A))))
            • Then - Actions
              • Game - Display to (All players) the text: (Player + ((String((Integer A))) + got kicked!))
              • Game - Defeat Player[(Integer A)] with the message: Defeat!
              • Set Temp_Group = (Units owned by Player[(Integer A)])
              • Unit Group - Pick every unit in Temp_Group and do (Actions)
                • Loop - Actions
                  • Unit - Remove (Picked unit) from the game
              • Custom script: call DestroyGroup (udg_Temp_Group)
            • Else - Actions
              • Do nothing

I don't think it's the best but it works perfect.

EDIT: Needed to fix some errors in the first trigger.
 

UndeadDragon

Super Moderator
Reaction score
447
You don't need to set players into an array. You can just use Convert Player Index to Player (or something similar).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top