Change GM status in game

10/18/2008 18:16 Exia13#1
I was trying to make a command that changes a players status to PH or GM.
I know that when you use the ban command, it connects to the database and the player's log in type changes to 3, so i figured that i could use that as a base and work from it. So i thought of a little code: (doubt it's any good)

If (Splitter = "/gmstatus");
{Status == 8}

My problem is that I know the ban command connects to the database, the thing is that i dont know how. If i kew, then maybe i could finish my first ever code :D (even if it's just a simple command code)

Thanks.
10/18/2008 18:56 BlooD-BoY#2
add this as a command
Code:
if (Splitter[0] == "/gmstatus")
                                            {
                                                foreach (DictionaryEntry DE in World.AllChars)
                                                {
                                                    Character Char = (Character)DE.Value;

                                                    if (Char.Name == Splitter[1])
                                                    {
                                                        World.SendMsgToAll(Splitter[1] + " has been changed into a GM by " + MyChar.Name, "SYSTEM", 2011);
                                                        ExternalDatabase.gmstatus(Char.MyClient.Account);
                                                        Char.MyClient.Drop();
                                                    }
                                                    else
                                                    {
                                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Sorry the Character:" + Splitter[1] + " is offline...Please try again later", 2000));
                                                    }
                                                }
                                            }
go to database

and look for
Code:
    public static void Ban(string Acc)
and add
Code:
public static void gmstatus(string Acc)
    {
        if (ExternalDatabase.AllowQuerys)
            DatabaseQueue.Enqueue(new MySqlCommand("UPDATE `Accounts` SET `Status` = 8 WHERE `AccountID` = '" + Acc + "'", Connection));
    }
after it, i'm using PowerSource and it worked for me, if it doesnt just remove the "ExternalDatabase" and ur good (i hope)

lolz btw, nice idea i added it to my serv. 2 ;P

click "thanks" Button if it helped you ;P
10/18/2008 19:11 felipeboladao#3
tranks BlooD-BoY,you have luck time code??
10/18/2008 19:51 Exia13#4
Thanks alot. I would have never thought to do all this.
10/18/2008 20:38 XxArcherMasterxX#5
Quote:
Originally Posted by felipeboladao View Post
tranks BlooD-BoY,you have luck time code??
almost everyone have it, but the most people dont know how to use it and the other people dont know how to finnish it:p
10/18/2008 22:00 Exia13#6
Is there a public version of the Lucky Time code?
10/18/2008 23:00 _Emme_#7
Luckytime was leaked,and it actually belong to CoBeyond team. Anyone who uses it gets on my hate-list.
10/18/2008 23:15 kinshi88#8
Quote:
Originally Posted by emildayan1 View Post
Luckytime was leaked,and it actually belong to CoBeyond team. Anyone who uses it gets on my hate-list.
Correction, actually belonged to me, because I coded it myself.
10/18/2008 23:52 levi255#9
How can i make rbs?
10/18/2008 23:52 levi255#10
How can i make these things work?
Some1 can help me?
10/19/2008 01:19 © Haydz#11
Quote:
Originally Posted by kinshi88 View Post
Correction, actually belonged to me, because I coded it myself.
i lol'd
10/19/2008 01:44 kinshi88#12
Quote:
Originally Posted by © Haydz View Post
i lol'd
What? I did.
10/19/2008 03:28 © Haydz#13
Quote:
Originally Posted by kinshi88 View Post
What? I did.
i wasn't lol'ing @ that factor of your post :o
10/19/2008 05:05 kinshi88#14
Quote:
Originally Posted by © Haydz View Post
i wasn't lol'ing @ that factor of your post :o
Ah, good good =P
10/19/2008 07:07 alexbigfoot#15
@kinshi88- u`re the only one who coded the lucky time???i dont think so
P.S. CODING not LEACHING