GM Ranking Script

*Created by Taz.*

```
Using "RC_Core.rcm"
; Age of Division
; Date/Time: 1:12:07 AM on 10/26/2010
; By Naddaz on TAZCO

Function rankgm()

;This will be used to set gm ranks. Only rank 5 GMs will be able to set ranks.
;When tag change is finished gm ranks will have an option for it on, may require gms to keep ranks showing.
;Will open a dialog to target telling them there rank is being changed.
;Make sure to add rank checks to gm abilitys in the ingame comands script.
;Add a attribute called Gm Rank, you can have it hidden or visable.

Player = Actor()
Target = ContextActor() ;ActorTarget(ContextActor())

PName$ = Name(Player)
TName$ = Name(Target)
PGmRank$ = Attribute(Player, "Gm Rank") ;Player GM Rank check.
TGmRank% = Attribute(Target, "Gm Rank") ;Target GM Rank check.

If (Target = 0) ; Check target is valid
  Output(Player, "Select a target to give Gm Ranks.", 255, 0, 0)
 Return
 Endif

 ;Check to make sure target is a gm
If (PlayerIsGM(Target)) ;check if target is a gm

   ;Check if player is rank 5 to use this gm rank system
  If (PGmRank <= 4) ;less or = to 4 tell player they cant use this and exit.
    OutPut(Player, "You need GM rank 5 to use this.", 255, 145, 23)
    Return
   Endif

     ChatBox$ = OpenDialog(Player, ContextActor(), "Set Gm Rank")
    ;ChatBox1$ = OpenDialog(Target, Player, "Set Gm Rank") ;open target chatbox
    DialogOutpUt(Player, ChatBox, "Your target Gm rank is " + TGmRank) ;tell player what rank there target is.
    DialogOutPut(Player, ChatBox, "Click a rank to get info and to assigned it to target.", 230, 145, 23)
    DialogOutput(Player, ChatBox, "What rank should be assigned to " + TName + "?", 230, 145, 23)
   ; DialogOutPut(Target, ChatBox1, "Please Wait " + Pname + " is modifying your GM Rank", 230, 145, 23)

     RankOption% = DialogInput(Player, ChatBox, "Rank 1 Apprectice Guide,Rank 2 Full Guide,Rank 3 Senior Guide,Rank 4 Guide Master,Rank 5 Guide Counselor,Take rank from player,Close")

         If (RankOption = 1) ;AG Gm rank 1
            CloseDialog(Player, ChatBox)
            ChatBox$ = OpenDialog(Player, ContextActor(), "Rank 1 info")
            DialogOutPut(Player, ChatBox, "Limited abilities, trial period of Guide in training AG", 230, 145, 23)
            DialogOutPut(Player, ChatBox, "Would you like to set " + TName + " to GM rank 1?", 230, 145, 23)
            SetOption$ = DialogInput(Player, ChatBox, "Yes,No")

                If (SetOption = 1) ;Set target to gm rank 1
                    DialogOutPut(Player, ChatBox, "Setting " + TName + " to GM rank 1", 230, 145, 23)
                    DoEvents(1000)
                    SetMaxAttribute(Target, "Gm Rank", 1)
                    SetAttribute(Target, "Gm Rank", 1)
                    OutPut(Target, "You have been set to GM rank 1 AG", 255, 145, 23) ;tell target what there gm rank is.
                    DialogOutPut(Player, ChatBox, "Process was finished successfully.", 230, 145, 23)
                    DialogInPut(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return

                ElseIf (SetOption = 2) ;Don`t do anything close script
                    DialogOutPut(Player, Chatbox, "Nothing will be done.", 230, 145, 23)
                    DialogInput(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return
                EndIf

        ElseIF (RankOption = 2) ;FG Gm rank 2
            CloseDialog(Player, ChatBox)
            ChatBox$ = OpenDialog(Player, ContextActor(), "Rank 2 info")
            DialogOutPut(Player, ChatBox, "Larger range of abilities full fledge guide able to handle most problems. FG", 230, 145, 23)
            DialogOutPut(Player, ChatBox, "Would you like to set " + TName + " to GM rank 2?", 230, 145, 23)
            SetOption$ = DialogInput(Player, ChatBox, "Yes,No")

                If (SetOption = 1) ;Set target to gm rank 2
                    DialogOutPut(Player, ChatBox, "Setting " + TName + " to GM rank 2", 230, 145, 23)
                    DoEvents(1000)
                    SetMaxAttribute(Target, "Gm Rank", 2)
                    SetAttribute(Target, "Gm Rank", 2)
                    OutPut(Target, "You have been set to GM rank 2 FG", 255, 145, 23) ;tell target what there gm rank is.
                    DialogOutPut(Player, ChatBox, "Process was finished successfully.", 230, 145, 23)
                    DialogInPut(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return

                ElseIf (SetOption = 2) ;Don`t do anything close script
                    DialogOutPut(Player, Chatbox, "Nothing will be done.", 230, 145, 23)
                    DialogInput(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return
                EndIf

         ElseIf (RankOption = 3) ;SG Gm rank 3
           CloseDialog(Player, ChatBox)
            ChatBox$ = OpenDialog(Player, ContextActor(), "Rank 3 info")
            DialogOutPut(Player, ChatBox, "Greater range of abilities can handle all problems. SG", 230, 145, 23)
            DialogOutPut(Player, ChatBox, "Would you like to set " + TName + " to GM rank 3?", 230, 145, 23)
            SetOption$ = DialogInput(Player, ChatBox, "Yes,No")

                If (SetOption = 1) ;Set target to gm rank 3
                    DialogOutPut(Player, ChatBox, "Setting " + TName + " to GM rank 3", 230, 145, 23)
                    DoEvents(1000)
                    SetMaxAttribute(Target, "Gm Rank", 3)
                    SetAttribute(Target, "Gm Rank", 3)
                    OutPut(Target, "You have been set to GM rank 3 SG", 255, 145, 23) ;tell target what there gm rank is.
                    DialogOutPut(Player, ChatBox, "Process was finished successfully.", 230, 145, 23)
                    DialogInPut(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return

                ElseIf (SetOption = 2) ;Don`t do anything close script
                    DialogOutPut(Player, Chatbox, "Nothing will be done.", 230, 145, 23)
                    DialogInput(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return
                EndIf

         ElseIf (RankOption = 4) ;GM Gm rank 4
             CloseDialog(Player, ChatBox)
            ChatBox$ = OpenDialog(Player, ContextActor(), "Rank 4 info")
            DialogOutPut(Player, ChatBox, "The highest rank of GM outside of the GC will all privilages and abilities, save for those only available to the GM SG", 230, 145, 23)
            DialogOutPut(Player, ChatBox, "Would you like to set " + TName + " to GM rank 4?", 230, 145, 23)
            SetOption$ = DialogInput(Player, ChatBox, "Yes,No")

                If (SetOption = 1) ;Set target to gm rank 4
                    DialogOutPut(Player, ChatBox, "Setting " + TName + " to GM rank 4", 230, 145, 23)
                    DoEvents(1000)
                    SetMaxAttribute(Target, "Gm Rank", 4)
                    SetAttribute(Target, "Gm Rank", 4)
                    OutPut(Target, "You have been set to GM rank 4 GM", 255, 145, 23) ;tell target what there gm rank is.
                    DialogOutPut(Player, ChatBox, "Process was finished successfully.", 230, 145, 23)
                    DialogInPut(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return

                ElseIf (SetOption = 2) ;Don`t do anything close script
                    DialogOutPut(Player, Chatbox, "Nothing will be done.", 230, 145, 23)
                    DialogInput(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return
                EndIf

         ElseIf (RankOption = 5) ; GC Gm rank 5 admin gm
            CloseDialog(Player, ChatBox)
            ChatBox$ = OpenDialog(Player, ContextActor(), "Rank 5 info")
            DialogOutPut(Player, ChatBox, "Rank for creators. GC", 230, 145, 23)
            DialogOutPut(Player, ChatBox, "Would you like to set " + TName + " to GM rank 5?", 230, 145, 23)
            SetOption$ = DialogInput(Player, ChatBox, "Yes,No")

                If (SetOption = 1) ;Set target to gm rank 5
                    DialogOutPut(Player, ChatBox, "Setting " + TName + " to GM rank 5", 230, 145, 23)
                    DoEvents(1000)
                    SetMaxAttribute(Target, "Gm Rank", 5)
                    SetAttribute(Target, "Gm Rank", 5)
                    OutPut(Target, "You have been set to GM rank 5 GC", 255, 145, 23) ;tell target what there gm rank is.
                    DialogOutPut(Player, ChatBox, "Process was finished successfully.", 230, 145, 23)
                    DialogInPut(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return

                ElseIf (SetOption = 2) ;Don`t do anything close script
                    DialogOutPut(Player, Chatbox, "Nothing will be done.", 230, 145, 23)
                    DialogInput(Player, ChatBox, "Close")
                    CloseDialog(Target, ChatBox)
                    CloseDialog(Player, ChatBox)
                    Return
                EndIf

         ElseIf (RankOption = 6) ; Take gm rank from target
          SetMaxAttribute(Target, "Gm Rank", 0)
          SetAttribute(Target, "Gm Rank", 0)
          DialogOutPut(Player, ChatBox, + TName + " Lost there GM rank.", 230, 145, 23)
          DialogInPut(Player, ChatBox, "Close")
          OutPut(Target, "You have been set to GM rank 0", 255, 145, 23)
          CloseDialog(player, ChatBox)
          Return
        ElseIf (RankOption = 7) ;Close
        CloseDialog(Player, ChatBox)
        Return
        Endif

 Else ; Target is not a gm don`t allow rank changes.
 OutPut(Player, "Your target is not a GM, you can not modify a rank of a non gm.", 230, 145, 23)
 Return
 Endif ;end target gm check

 End Function

```