Go down
Sath
Sath
MG
MG
Posts : 1576
realm_3
Réputation : 62
KICK VOTE SYTEM usin dialog boxes Pp_fou10
Regist Date : 2005-07-15
http://dotd6.net

KICK VOTE SYTEM usin dialog boxes Empty KICK VOTE SYTEM usin dialog boxes

Thu 23 Feb 2006, 17:58
Code:
KICK
    Events
        Player - Player 1 (Red) types a chat message containing -boot as A substring
        Player - Player 2 (Blue) types a chat message containing -boot as A substring
        Player - Player 3 (Teal) types a chat message containing -boot as A substring
        Player - Player 4 (Purple) types a chat message containing -boot as A substring
        Player - Player 5 (Yellow) types a chat message containing -boot as A substring
        Player - Player 6 (Orange) types a chat message containing -boot as A substring
        Player - Player 7 (Green) types a chat message containing -boot as A substring
        Player - Player 8 (Pink) types a chat message containing -boot as A substring
        Player - Player 9 (Gray) types a chat message containing -boot as A substring
        Player - Player 10 (Light Blue) types a chat message containing -boot as A substring
        Player - Player 11 (Dark Green) types a chat message containing -boot as A substring
        Player - Player 12 (Brown) types a chat message containing -boot as A substring
    Conditions
    Actions
        Dialog - Clear BootDialog
        Set PlayerConsidered = (Player((Integer((Substring((Entered chat string), 7, 8))))))
        Dialog - Change the title of BootDialog to (Boot  + ((Name of PlayerConsidered) + ?))
        Dialog - Create a dialog button for BootDialog labelled Yes
        Set Yes = (Last created dialog Button)
        Dialog - Create a dialog button for BootDialog labelled No
        Set No = (Last created dialog Button)
        Player Group - Pick every player in (All players matching (((Matching player) slot status) Equal to Is playing)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Picked player) Not equal to PlayerConsidered
                    Then - Actions
                        Dialog - Show BootDialog for (Picked player)
                    Else - Actions
        Countdown Timer - Start VoteTime as a One-shot timer that will expire in 10.00 seconds
        Countdown Timer - Create a timer window for VoteTime with title Time to vote:
        Set VoteTimeWindow = (Last created timer window)
        Countdown Timer - Show VoteTimeWindow
        Trigger - Turn off (This trigger)

Code:
VOTE
    Events
        Dialog - A dialog button is clicked for BootDialog
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to No
            Then - Actions
                Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has voted to not boot  + (Name of PlayerConsidered)))
                Set NoVotes = (NoVotes + 1)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to Yes
            Then - Actions
                Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has voted to boot  + (Name of PlayerConsidered)))
                Set YesVotes = (YesVotes + 1)
            Else - Actions



Code:
COUNT
    Events
        Time - VoteTime expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                NoVotes Greater than or equal to YesVotes
            Then - Actions
                Game - Display to (All players) the text: ((Name of PlayerConsidered) +  wasn't booted, who tried to boot a person not worthy of booting?)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                YesVotes Greater than NoVotes
            Then - Actions
                Unit Group - Pick every unit in (Units owned by PlayerConsidered) and do (Actions)
                    Loop - Actions
                        Unit - Remove (Picked unit) from the game
                Game - Display to (All players) the text: ((Name of PlayerConsidered) +  was booted. Huzzah!)
                Game - Defeat PlayerConsidered with the message: You Have been kicked...
            Else - Actions
        Set NoVotes = 0
        Set YesVotes = 0
        Countdown Timer - Hide VoteTimeWindow
        Trigger - Turn on KICK <gen>
Back to top
Permissions in this forum:
You cannot reply to topics in this forum