- Joined
- Mar 24, 2010
- Messages
- 950
So i have a list of things to choose from.
for example the amount of points needed to win.
i have a dialog come up with 20/30/40/50 and 100 points options to vote on.
just was wondering if theres a better/more efficient way to do this. wasnt really thinking too much about it when i threw this together.
I dont bother showing the dialog as it doesnt really matter
this below orders from least to greatest to make it easy to find the largest number.
Problem is i have no easy way now to assign the value it has.
like for the var[2] its 30 points and var[5] is 100
but in this process the var is the votes it gets so this way wont work.
I need to keep the original vote in the same var[int] so i know what array value it has so i know the points to assign it after i found out the highest vote.
its kind of late now not thinking the best but i would like to finish this lol
for example the amount of points needed to win.
i have a dialog come up with 20/30/40/50 and 100 points options to vote on.
just was wondering if theres a better/more efficient way to do this. wasnt really thinking too much about it when i threw this together.
I dont bother showing the dialog as it doesnt really matter
-
CTF Button Points
-

Events
-


Dialog - A dialog button is clicked for Dialog_CTF
-
-

Conditions
-

Actions
-


Dialog - Hide Dialog_CTF for (Triggering player)
-


For each (Integer A) from 1 to 5, do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Clicked dialog button) Equal to Dialog_CTFPoints_Buttons[(Integer A)]
-
-





Then - Actions
-






Game - Display to (All players) for 8.00 seconds the text: (Voted + Dialog_CTF_Strings[(Integer A)])
-






Set Vote_Count[(Integer A)] = (Vote_Count[(Integer A)] + 1)
-
-





Else - Actions
-
-
-
-
-
this below orders from least to greatest to make it easy to find the largest number.
Problem is i have no easy way now to assign the value it has.
like for the var[2] its 30 points and var[5] is 100
but in this process the var is the votes it gets so this way wont work.
I need to keep the original vote in the same var[int] so i know what array value it has so i know the points to assign it after i found out the highest vote.
its kind of late now not thinking the best but i would like to finish this lol
-
Take Vote Tally 5
-

Events
-

Conditions
-

Actions
-


For each (Integer A) from 1 to 5, do (Actions)
-



Loop - Actions
-




For each (Integer B) from 1 to 5, do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Vote_Count[(Integer A)] Less than Vote_Count[(Integer B)]
-








(Integer A) Greater than (Integer B)
-
-







Then - Actions
-








Set Temp_Integer = Vote_Count[(Integer B)]
-








Set Vote_Count[(Integer B)] = Vote_Count[(Integer A)]
-








Set Vote_Count[(Integer A)] = Temp_Integer
-
-







Else - Actions
-
-
-
-
-
-


Set CTF_Points_Cap = Vote_Count[5]
-


Game - Display to (All players) for 9.00 seconds the text: (|c00FF0000Majority Voted|r |c00FFCC00 + ((String(CTF_Points_Cap)) + |r |c00FF0000points for the Win!|r))
-


For each (Integer A) from 1 to 5, do (Actions)
-



Loop - Actions
-




Set Vote_Count[(Integer A)] = 0
-
-
-
-
Last edited:




