I was trying to make a votekick system for my map. I made the system and when i typed command "-votekick 2" W3 crashed... I dont know why... xD I think there is something with the first trigger, because W3 crashed just after i entered the votekick command. Anyway, here are all the triggers of my system:
Variables:
aa_vote_in_progress - BDLBQ, used to stop starting new vote if there is another running already.
aa_kick_player_num - C, number of player that is being voted to kick him.
aa_[number]_have_voted - BDLBQ, used to stop players voting 2 times on one votekick.
yesvotes - C, number of votes to kick player.
novotes - C, number of votes to dont kick player.
Gladiators - C, here used as number of voting players.
Variables:
aa_vote_in_progress - BDLBQ, used to stop starting new vote if there is another running already.
aa_kick_player_num - C, number of player that is being voted to kick him.
aa_[number]_have_voted - BDLBQ, used to stop players voting 2 times on one votekick.
yesvotes - C, number of votes to kick player.
novotes - C, number of votes to dont kick player.
Gladiators - C, here used as number of voting players.
-
call votekick
-
Events
- Player - Player 1 (Red) types a chat message containing -votekick as Part (?)
- Player - Player 2 (Blue) types a chat message containing -votekick as ... etc. etc. for 10 player (red - lightblue)
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- aa_vote_in_progress Equal to True
-
Then - Actions
- Game - Display to (Player group((Triggering player))) the text: |cff8080FFVote hint...
- Skip remaining actions
- Else - Actions
-
If - Conditions
- Set aa_vote_in_progress = True
- Trigger - Turn off (This trigger)
- Trigger - Turn on kick and end votekick <gen>
- If ((Entered chat string) Equal to (-votekick + (String((Integer A))))) then do (For each (Integer A) from 1 to 10, do (Set aa_kickplayer_num = (Integer A))) else do (Do nothing)
- Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has started votekick against |cffffcc00 + ((Name of (Player(aa_kickplayer_num))) + |r.)))
- Trigger - Turn on vote yes 1 <gen>
- Trigger - Turn on vote yes 2 <gen>
- Trigger - Turn on vote yes 3 <gen> ... etc etc for 10 player (red - lightblue)
- -------- -------------------------------------------------------------------- --------
- Trigger - Turn on vote no 1 <gen>
- Trigger - Turn on vote no 2 <gen>
- Trigger - Turn on vote no 3 <gen> ... etc etc for 10 player (red - lightblue)
- -------- -------------------------------------------------------------------- --------
- Set aa_1_have_voted = False
- Set aa_2_have_voted = False
- Set aa_3_have_voted = False
- Set aa_4_have_voted = False
- Set aa_5_have_voted = False
- Set aa_6_have_voted = False
- Set aa_7_have_voted = False
- Set aa_8_have_voted = False
- Set aa_9_have_voted = False
- Set aa_10_have_voted = False
- Set yesvotes = 0
- Set novotes = 0
- Wait 30.00 seconds
- Trigger - Run kick and end votekick <gen> (ignoring conditions)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
kick and end votekick
-
Events
- Time - Every 0.50 seconds of game time
-
Conditions
- (yesvotes + novotes) Equal to Gladiators
-
Actions
- Trigger - Turn off (This trigger)
- Trigger - Turn off vote no 1 <gen>
- Trigger - Turn off vote no 2 <gen>
- Trigger - Turn off vote no 3 <gen> ... etc etc up to 10 times.
- Trigger - Turn off vote no 10 <gen>
- Trigger - Turn off vote yes 1 <gen>
- Trigger - Turn off vote yes 2 <gen>
- Trigger - Turn off vote yes 3 <gen> ... etc etc up to 10 times.
- Set aa_vote_in_progress = False
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- yesvotes Equal to novotes
-
Then - Actions
- Game - Display to (All players) the text: (|cff8080FFVote hint -|r + Vote failed - 50% players voted |cffffcc00yes|r, 50% player voted |cffffcc00no|r. Draw.)
- Set yesvotes = 0
- Set novotes = 0
- Skip remaining actions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- yesvotes greater than novotes
-
Then - Actions
- Set yesvotes = 0
- Set novotes = 0
- Game - Defeat (Player(aa_kickplayer_num)) with the message: You have been votek...
- Unit Group - Pick every unit in (Units owned by (Player(aa_kickplayer_num))) and do (Unit - Remove (Picked unit) from the game)
- Game - Display to (All players) the text: (|cff8080FFVote hint -|r + Vote |cffffcc00passed|r.)
- Game - Display to (All players) the text: (|cff8080FFVote hint -|r + ((Name of (Player(aa_kickplayer_num))) + has been voteckied.))
- Game - Display to (All players) the text: (|cff8080FFVote hint -|r + ( + ((String((100 - (novotes x 10)))) + % players voted |cffffcc00yes|r.)))
-
Else - Actions
- Set yesvotes = 0
- Set novotes = 0
- Game - Display to (All players) the text: (|cff8080FFVote hint -|r + Vote |cffffcc00failed|r.)
- Game - Display to (All players) the text: (|cff8080FFVote hint -|r + ( + ((String((100 - (yesvotes x 10)))) + % players voted |cffffcc00no|r.)))
-
If - Conditions
-
Events
-
vote yes 1 (same for player 2, 3, ..., 10)
-
Events
- Player - Player 1 (Red) types a chat message containing -yes as exact match
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- aa_1_have_voted Equal to False
-
Then - Actions
- Set yesvotes = (yesvotes + 1)
- Game - Display to (Player group((Triggering player))) the text: |cff8080FFVote hint...
- Set aa_1_have_voted = True
-
Else - Actions
- Game - Display to (Player group((Triggering player))) the text: |cff8080FFVote hint...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
vote no 1 (same for player 2, 3, ..., 10)
-
Events
- Player - Player 1 (Red) types a chat message containing -no as exact match
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- aa_1_have_voted Equal to False
-
Then - Actions
- Set novotes = (novotes + 1)
- Game - Display to (Player group((Triggering player))) the text: |cff8080FFVote hint...
- Set aa_1_have_voted = True
-
Else - Actions
- Game - Display to (Player group((Triggering player))) the text: |cff8080FFVote hint...
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
Last edited: