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

Kick System v1.1

  • Like
Reactions: QuantumMatter
this is system i made for kicking a player (made in BTanks style).
i've done so much systems (~8-10) may i post it sometime.
type -kick and a player number or the player name to start kick vote.
the vote will end after 20 sec or if all players have voted.

v1.1 removed message display function

if you found leaks pm me.

Keywords:
kick; votekick; hell gate; GUI; balance
Contents

Kick System (Map)

Reviews
14:05, 3rd Jan 2010 TriggerHappy: Please don't use your lame MessageDisplay function and use one of the normal ones.

Moderator

M

Moderator

14:05, 3rd Jan 2010
TriggerHappy:

Please don't use your lame MessageDisplay function and use one of the normal ones.
 
I like it, but what determins the amount of votes required to kick somone?

Very nifty system. checking for leaks now.

not sure, but i think
  • Leaderboard - Create a leaderboard for (All players) titled (Kick Vote - Yes: + ((String(KS_YesVotes)) + ( No: + (String(KS_NoVotes)))))
"All players" is a leak, i think.
in KS Kick player there's a unit group leak,
  • Unit Group - Pick every unit in (Units owned by (Player(KS_KickPlayerNR))) and do (Unit - Remove (Picked unit) from the game)
// Oops, didn't see the Set BJ_WantDestroygroup = True down there...
Thats all i found, very nice system.

BTW, you dont need both the "Yes vote", and the "No vote" triggers, i merged them for efficiency
  • Vote
    • Events
      • Player - Player 1 (Red) types a chat message containing -yes as An exact match
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
      • Player - Player 7 (Green) types a chat message containing -yes as An exact match
      • Player - Player 8 (Pink) types a chat message containing -yes as An exact match
      • Player - Player 9 (Gray) types a chat message containing -yes as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -yes as An exact match
      • Player - Player 1 (Red) types a chat message containing -no as An exact match
      • Player - Player 2 (Blue) types a chat message containing -no as An exact match
      • Player - Player 3 (Teal) types a chat message containing -no as An exact match
      • Player - Player 4 (Purple) types a chat message containing -no as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -no as An exact match
      • Player - Player 6 (Orange) types a chat message containing -no as An exact match
      • Player - Player 7 (Green) types a chat message containing -no as An exact match
      • Player - Player 8 (Pink) types a chat message containing -no as An exact match
      • Player - Player 9 (Gray) types a chat message containing -no as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -no as An exact match
    • Conditions
      • KS_Voted[(Player number of (Triggering player))] Equal to False
    • Actions
      • Custom script: call MessageDisplay(GetTriggerPlayer(),"|cfffed312Vote registered|r")
      • Set KS_Voted[(Player number of (Triggering player))] = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -yes
        • Then - Actions
          • Set KS_YesVotes = (KS_YesVotes + 1)
        • Else - Actions
          • Set KS_NoVotes = (KS_NoVotes + 1)
      • Leaderboard - Change the title of KS_Leaderboard to (Kick + (Vote + (( - Yes: + (String(KS_YesVotes))) + ( No: + (String(KS_NoVotes))))))
 
Last edited:
I like it, but what determins the amount of votes required to kick somone?

Very nifty system. checking for leaks now.

not sure, but i think
  • Leaderboard - Create a leaderboard for (All players) titled (Kick Vote - Yes: + ((String(KS_YesVotes)) + ( No: + (String(KS_NoVotes)))))
"All players" is a leak, i think.
in KS Kick player there's a unit group leak,
  • Unit Group - Pick every unit in (Units owned by (Player(KS_KickPlayerNR))) and do (Unit - Remove (Picked unit) from the game)
// Oops, didn't see the Set BJ_WantDestroygroup = True down there...
Thats all i found, very nice system.

BTW, you dont need both the "Yes vote", and the "No vote" triggers, i merged them for efficiency
  • Vote
    • Events
      • Player - Player 1 (Red) types a chat message containing -yes as An exact match
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
      • Player - Player 7 (Green) types a chat message containing -yes as An exact match
      • Player - Player 8 (Pink) types a chat message containing -yes as An exact match
      • Player - Player 9 (Gray) types a chat message containing -yes as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -yes as An exact match
      • Player - Player 1 (Red) types a chat message containing -no as An exact match
      • Player - Player 2 (Blue) types a chat message containing -no as An exact match
      • Player - Player 3 (Teal) types a chat message containing -no as An exact match
      • Player - Player 4 (Purple) types a chat message containing -no as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -no as An exact match
      • Player - Player 6 (Orange) types a chat message containing -no as An exact match
      • Player - Player 7 (Green) types a chat message containing -no as An exact match
      • Player - Player 8 (Pink) types a chat message containing -no as An exact match
      • Player - Player 9 (Gray) types a chat message containing -no as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -no as An exact match
    • Conditions
      • KS_Voted[(Player number of (Triggering player))] Equal to False
    • Actions
      • Custom script: call MessageDisplay(GetTriggerPlayer(),"|cfffed312Vote registered|r")
      • Set KS_Voted[(Player number of (Triggering player))] = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -yes
        • Then - Actions
          • Set KS_YesVotes = (KS_YesVotes + 1)
        • Else - Actions
          • Set KS_NoVotes = (KS_NoVotes + 1)
      • Leaderboard - Change the title of KS_Leaderboard to (Kick + (Vote + (( - Yes: + (String(KS_YesVotes))) + ( No: + (String(KS_NoVotes))))))

thx i'll optimize it soon.
i don't know why (All Players) should leak?
 
Triggers
  • KS init
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • -------- Paste these to your map initialization trigger. --------
      • For each (Integer KS_TempInteger) from 1 to 12, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ((Player(KS_TempInteger)) is in (All players)) Gleich True
            • 'THEN'-Aktionen
              • Set KS_Players = (KS_Players + 1)
            • 'ELSE'-Aktionen
  • KS KickAction
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 2 (Blau) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 4 (Lila) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 5 (Gelb) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 6 (Orange) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 7 (Grün) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 8 (Rosa) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 9 (Grau) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 10 (Hellblau) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 11 (Dunkelgrün) types a chat message containing -kick as Ein Teil-String
      • Spieler - Spieler 12 (Braun) types a chat message containing -kick as Ein Teil-String
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KS_CanVote Gleich True
        • 'THEN'-Aktionen
          • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312Wait unitill the current vote is finished.|r")
          • Skip remaining actions
        • 'ELSE'-Aktionen
      • Set KS_KickPlayerNR = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Or - Any (Conditions) are true
            • Bedingungen
              • KS_KickPlayerNR Kleiner gleich 0
              • KS_KickPlayerNR Gleich (Player number of (Triggering player))
              • KS_KickPlayerNR Größer als 12
        • 'THEN'-Aktionen
          • Set KS_KickPlayerNR = 0
          • Set KS_TempString = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
          • For each (Integer KS_TempInteger) from 1 to 12, do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • KS_TempString Gleich (Name of (Player(KS_TempInteger)))
                  • KS_TempInteger Ungleich (Player number of (Triggering player))
                • 'THEN'-Aktionen
                  • Set KS_KickPlayerNR = KS_TempInteger
                  • Set KS_UseName = True
                • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • KS_UseName Gleich True
            • 'THEN'-Aktionen
              • Set KS_UseName = False
            • 'ELSE'-Aktionen
              • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312You have to specify a player to kick.|r")
              • Skip remaining actions
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Or - Any (Conditions) are true
            • Bedingungen
              • ((Player(KS_KickPlayerNR)) slot status) Gleich Wird nicht benutzt
              • ((Player(KS_KickPlayerNR)) is in KS_KickedPlayers) Gleich True
              • ((Player(KS_KickPlayerNR)) slot status) Gleich Hat das Spiel verlassen
        • 'THEN'-Aktionen
          • Set KS_KickPlayerNR = 0
          • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312You have to specify a player to kick.|r")
          • Skip remaining actions
        • 'ELSE'-Aktionen
      • Custom script: set udg_KS_TempString = PlayerColour(GetPlayerId(GetTriggerPlayer())+1)
      • Custom script: set udg_KS_Colour = PlayerColour(udg_KS_KickPlayerNR)
      • Spiel - Display to (All players) the text: ((KS_TempString + ((Name of (Triggering player)) + |r)) + ( |cfffed312would like to kick |r + (KS_Colour + ((Name of (Player(KS_KickPlayerNR))) + |r))))
      • Spiel - Display to (All players) the text: |cfffed312You have ...
      • Set KS_CanVote = True
      • Auslöser - Turn on KS YesVote <gen>
      • Auslöser - Turn on KS NoVote <gen>
      • For each (Integer KS_TempInteger) from 1 to 12, do (Actions)
        • Schleifen - Aktionen
          • Set KS_Voted[KS_TempInteger] = False
      • Set KS_Voted[(Player number of (Triggering player))] = True
      • Set KS_YesVotes = 1
      • Set KS_NoVotes = 0
      • Bestenliste - Create a leaderboard for (All players) titled (Kick Vote - Yes: + ((String(KS_YesVotes)) + ( No: + (String(KS_NoVotes)))))
      • Set KS_Leaderboard = (Last created leaderboard)
      • Custom script: call LeaderboardAddItem(udg_KS_Leaderboard,"|cfffed312Kick: |r"+udg_KS_Colour+GetPlayerName(ConvertedPlayer(udg_KS_KickPlayerNR))+"|r",0,ConvertedPlayer(udg_KS_KickPlayerNR))
      • Custom script: call LeaderboardSetStyle(udg_KS_Leaderboard,true,true,false,false)
      • Custom script: call LeaderboardSetSizeByItemCount(udg_KS_Leaderboard,1)
      • Countdown-Timer - Start KS_Timer as a Einmalig timer that will expire in 20.00 seconds
  • KS TimeEnd
    • Ereignisse
      • Zeit - KS_Timer expires
    • Bedingungen
    • Aktionen
      • Auslöser - Run KS KickPlayer <gen> (ignoring conditions)
  • KS KickPlayer
    • Ereignisse
      • Zeit - Every 0.50 seconds of game time
    • Bedingungen
      • (KS_YesVotes + KS_NoVotes) Gleich KS_Players
    • Aktionen
      • Set KS_CanVote = False
      • Bestenliste - Destroy KS_Leaderboard
      • Countdown-Timer - Pause KS_Timer
      • Auslöser - Turn off KS YesVote <gen>
      • Auslöser - Turn off KS NoVote <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KS_YesVotes Größer als KS_NoVotes
        • 'THEN'-Aktionen
          • Custom script: set bj_wantDestroyGroup = true
          • Einheitengruppe - Pick every unit in (Units owned by (Player(KS_KickPlayerNR))) and do (Einheit - Remove (Picked unit) from the game)
          • Spielergruppe - Add (Player(KS_KickPlayerNR)) to KS_KickedPlayers
          • Spiel - Display to (All players) the text: |cfffed312Vote pas...
          • Spiel - Display to (All players) the text: ((KS_Colour + ((Name of (Player(KS_KickPlayerNR))) + |r)) + |cfffed312was kicked!|r)
          • Spiel - Defeat (Player(KS_KickPlayerNR)) with the message: You have been kicke...
        • 'ELSE'-Aktionen
          • Spiel - Display to (All players) the text: |cfffed312Vote fai...
          • Spiel - Display to (All players) the text: ((KS_Colour + ((Name of (Player(KS_KickPlayerNR))) + |r)) + |cfffed312was not kicked.|r)
      • Spiel - Display to (All players) the text: ((|cfffed312 + Votes - ) + (((Yes: + (|r + ((String(KS_YesVotes)) + |cfffed312))) + ( No: + (|r + (String(KS_NoVotes))))) + |r))
      • Set KS_YesVotes = 0
      • Set KS_NoVotes = 0
      • Set KS_KickPlayerNR = 0
      • Set KS_Players = 0
      • For each (Integer KS_TempInteger) from 1 to 12, do (Actions)
        • Schleifen - Aktionen
          • Set KS_Voted[KS_TempInteger] = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ((Player(KS_TempInteger)) is in (All players)) Gleich True
              • ((Player(KS_TempInteger)) is in KS_KickedPlayers) Gleich False
            • 'THEN'-Aktionen
              • Set KS_Players = (KS_Players + 1)
            • 'ELSE'-Aktionen
  • KS YesVote
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 5 (Gelb) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 6 (Orange) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 7 (Grün) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 8 (Rosa) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 9 (Grau) types a chat message containing -yes as Exakte Übereinstimmung
      • Spieler - Spieler 10 (Hellblau) types a chat message containing -yes as Exakte Übereinstimmung
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KS_Voted[(Player number of (Triggering player))] Gleich False
        • 'THEN'-Aktionen
          • Set KS_YesVotes = (KS_YesVotes + 1)
          • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312Vote registered|r")
          • Set KS_Voted[(Player number of (Triggering player))] = True
          • Bestenliste - Change the title of KS_Leaderboard to (Kick + (Vote + (( - Yes: + (String(KS_YesVotes))) + ( No: + (String(KS_NoVotes))))))
        • 'ELSE'-Aktionen
          • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312You already have voted!|r")
  • KS NoVote
    • Ereignisse
      • Spieler - Spieler 1 (Rot) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 2 (Blau) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 3 (Blaugrau) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 4 (Lila) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 5 (Gelb) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 6 (Orange) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 7 (Grün) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 8 (Rosa) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 9 (Grau) types a chat message containing -no as Exakte Übereinstimmung
      • Spieler - Spieler 10 (Hellblau) types a chat message containing -no as Exakte Übereinstimmung
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KS_Voted[(Player number of (Triggering player))] Gleich False
        • 'THEN'-Aktionen
          • Set KS_NoVotes = (KS_NoVotes + 1)
          • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312Vote registered|r")
          • Set KS_Voted[(Player number of (Triggering player))] = True
          • Bestenliste - Change the title of KS_Leaderboard to (Kick + (Vote + (( - Yes: + (String(KS_YesVotes))) + ( No: + (String(KS_NoVotes))))))
        • 'ELSE'-Aktionen
          • Custom script: call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cfffed312You already have voted!|r")
  • KS PlayerLeave
    • Ereignisse
      • Spieler - Spieler 1 (Rot) leaves the game
      • Spieler - Spieler 2 (Blau) leaves the game
      • Spieler - Spieler 3 (Blaugrau) leaves the game
      • Spieler - Spieler 4 (Lila) leaves the game
      • Spieler - Spieler 5 (Gelb) leaves the game
      • Spieler - Spieler 6 (Orange) leaves the game
      • Spieler - Spieler 7 (Grün) leaves the game
      • Spieler - Spieler 8 (Rosa) leaves the game
      • Spieler - Spieler 9 (Grau) leaves the game
      • Spieler - Spieler 10 (Hellblau) leaves the game
      • Spieler - Spieler 11 (Dunkelgrün) leaves the game
      • Spieler - Spieler 12 (Braun) leaves the game
    • Bedingungen
    • Aktionen
      • Set KS_Players = 0
      • For each (Integer KS_TempInteger) from 1 to 12, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • ((Player(KS_TempInteger)) is in KS_KickedPlayers) Gleich False
              • ((Player(KS_TempInteger)) is in (All players)) Gleich True
            • 'THEN'-Aktionen
              • Set KS_Players = (KS_Players + 1)
            • 'ELSE'-Aktionen
 
Level 5
Joined
Dec 8, 2008
Messages
102
this really looks useful, +rep
but pls post triggers at the start so i dont have to download^^

oh and btw AllPlayers() doesnt leak even a bit, cause at the map start the globals force
bj_FORCE_ALL_PLAYERS is declared, and if you call this function, it simply returns this global force, so its like using a global variable
 
Level 12
Joined
May 21, 2009
Messages
994
  • KS init
  • Ereignisse
  • Map initialization
  • Bedingungen
  • Aktionen
  • -------- Paste these to your map initialization trigger. --------
  • For each (Integer KS_TempInteger) from 1 to 12, do (Actions)
  • Schleifen - Aktionen
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • 'IF'-Bedingungen
  • ((Player(KS_TempInteger)) is in (All players)) Gleich True
  • 'THEN'-Aktionen
  • Set KS_Players = (KS_Players + 1)
  • 'ELSE'-Aktionen
ehm "((Player(KS_Tempinteger)) is in (All players)) Gleich True"
couldnt you just use all players if (All Players) is a global that has been declared from start ?
 
Top