- Joined
- Jul 18, 2007
- Messages
- 111
Need help with a vote that allows a Referee/Observer to enter the game through share control with the leaving player. They type -enter # and then there is 60% of votes required to pass it (-yes/-no). Also having some issues to not allow a player to vote more than once/spam command.
The trigger is not going past RTPercent Greater than or equal to 0.60 and the test string below it. This is in GUI, but JASS would work. I can only provide screenshots, currently, but I will update this ASAP. Thank you for the help, much appreciated.
The trigger is not going past RTPercent Greater than or equal to 0.60 and the test string below it. This is in GUI, but JASS would work. I can only provide screenshots, currently, but I will update this ASAP. Thank you for the help, much appreciated.
-
Enter Spec Init
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Trigger - Add to Enter Spec 2 <gen> the event (Player - (Picked player) types a chat message containing -yes as An exact match)
-
Trigger - Add to Enter Spec 2 <gen> the event (Player - (Picked player) types a chat message containing -no as An exact match)
-
-
-
-
-
Enter Spec
-
Events
-
Player - Player 21 (Coal) types a chat message containing -enter as A substring
-
Player - Player 22 (Snow) types a chat message containing -enter as A substring
-
Player - Player 23 (Emerald) types a chat message containing -enter as A substring
-
Player - Player 24 (Peanut) types a chat message containing -enter as A substring
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 24, do (Set VariableSet HasVoted[(Integer A)] = False)
-
Set VariableSet PlayerWhoMightBeSwapped = (Integer((Substring((Entered chat string), 8, 9))))
-
Set VariableSet TempPlayer = (Triggering player)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
((Player(PlayerWhoMightBeSwapped)) slot status) Equal to Is playing
-
-
-
-
Then - Actions
-
Game - Display to (All players) for 6.00 seconds the text: ((Name of (Player(PlayerWhoMightBeSwapped))) + |cff92BBCF's slot is still occupied.|r)
-
Skip remaining actions
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player number of TempPlayer) Equal to PlayerWhoMightBeSwapped) or ((PlayerWhoMightBeSwapped Less than 1) or (PlayerWhoMightBeSwapped Greater than 12))
-
-
Then - Actions
-
Game - Display to (All players) for 6.00 seconds the text: |cFFA40000Not a val...
-
-
Else - Actions
-
Game - Display to (All players) for 6.00 seconds the text: ((Name of TempPlayer) + (|cff92BBCF has initialized a vote to enter the game as a spectator for |r + ((Name of (Player(PlayerWhoMightBeSwapped))) + |cff92BBCF Type -yes to allow the vote and -no to deny it. You have 30 seconds remaining.|r)))
-
Set VariableSet ShowText = True
-
Trigger - Turn on Enter Spec 2 <gen>
-
Trigger - Turn off (This trigger)
-
Wait 30.00 seconds
-
Trigger - Turn off Enter Spec 2 <gen>
-
Trigger - Turn on (This trigger)
-
-
-
-
-
Enter Spec 2
-
Events
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HasVoted[(Player number of (Triggering player))] Equal to True
-
-
Then - Actions
-
Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: |cff92BBCFSorry, yo...
-
Skip remaining actions
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Entered chat string) Equal to -yes
-
-
Then - Actions
-
Set VariableSet NumVotes[PlayerWhoMightBeSwapped] = (NumVotes[PlayerWhoMightBeSwapped] + 1)
-
Set VariableSet HasVoted[(Player number of (Triggering player))] = True
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Entered chat string) Equal to -no
-
-
Then - Actions
-
Set VariableSet HasVoted[(Player number of (Triggering player))] = True
-
-
Else - Actions
-
-
Set VariableSet RefPercent = ((Real(NumVotes[PlayerWhoMightBeSwapped])) / (Real(NumPlayersInteger)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RefPercent Less than 0.60
-
-
Then - Actions
-
Game - Display to (All players) for 6.00 seconds the text: ((String(VoteYes)) + (|cff92BBCF out of |r + ((String(VoteTotal)) + (|cff92BBCF votes have been cast for the spectator to enter the game. |r + ((String((Max(0, ((VoteTotal / 2) - VoteYes))))) + |cff92BBCF more enable votes are required. Please type -yes and -
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
RefPercent Greater than or equal to 0.20
-
-
Then - Actions
-
Player - Make (Player(PlayerWhoMightBeSwapped)) treat TempPlayer as an Ally with shared vision
-
Player - Make TempPlayer treat (Player(PlayerWhoMightBeSwapped)) as an Ally with shared vision
-
Player - For TempPlayer, turn Full shared units On toward (Player(PlayerWhoMightBeSwapped))
-
Player - For (Player(PlayerWhoMightBeSwapped)), turn Full shared units On toward TempPlayer
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player(PlayerWhoMightBeSwapped)) is in Force1.) Equal to True
-
-
Then - Actions
-
Player Group - Pick every player in Force1 and do (Actions)
-
Loop - Actions
-
Player - Make (Picked player) treat TempPlayer as an Ally with shared vision
-
Player - Make TempPlayer treat (Picked player) as an Ally with shared vision
-
-
-
Player Group - Pick every player in Force2 and do (Actions)
-
Loop - Actions
-
Player - Make (Picked player) treat TempPlayer as an Enemy
-
Player - Make TempPlayer treat (Picked player) as an Enemy
-
-
-
-
Else - Actions
-
Player Group - Pick every player in Force2 and do (Actions)
-
Loop - Actions
-
Player - Make (Picked player) treat TempPlayer as an Ally with shared vision
-
Player - Make TempPlayer treat (Picked player) as an Ally with shared vision
-
-
-
Player Group - Pick every player in Force1 and do (Actions)
-
Loop - Actions
-
Player - Make (Picked player) treat TempPlayer as an Enemy
-
Player - Make TempPlayer treat (Picked player) as an Enemy
-
-
-
-
-
Game - Display to (All players) the text: ((Name of TempPlayer) + (|CFF007E00 has entered the game for + (Name of (Player(PlayerWhoMightBeSwapped)))))
-
Trigger - Turn off Enter Spec 2 <gen>
-
-
Else - Actions
-
-
-
Last edited: