[Request] Nobility

08/05/2009 04:56 Jay1029#1
I've seen things you can add for nobility but I can't find everything I need to make it work without errors

Someone said I need Rank, Donation, SaveRank, and SaveDonation but I cant find it.
If it's possible, I would appreciate it if someone would send me the whole thing or just what I've listed above.
08/05/2009 05:41 n0mansland#2
All the releases have it lol..

Character.cs
Code:
public int Rank = 0;
public int Donation = 0;
Database.cs search for

Code:
public void savechar
Under it add this

Code:
        public void SaveDonation()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveDonation(this);
        }
        public void SaveRank()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveRank(this);
        }
Now in Database.cs search for
Code:
public static void saverchar
Under it add this..

Code:
        public static void Donation(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `Donation` = '" + Charr.Donation + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
        public static void Rank(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `Rank` = '" + Charr.Rank + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
Save Compile

MySQL design table add field.. Donation and Rank.. Guides should tell you what to put.
08/05/2009 18:50 Jay1029#3
public void savechar
Can't be found. Do you mean public void Save()?
agian..
public static void savechar can't be found
Do you mean public static void SaveAllChars()?..

SaveDonation and SaveRank are underlined.
I should have held my thanks until I actually got it working -.-
08/05/2009 19:15 damianpesta#4
Quote:
Originally Posted by Jay1029 View Post
public void savechar
Can't be found. Do you mean public void Save()?
agian..
public static void savechar can't be found
Do you mean public static void SaveAllChars()?..

SaveDonation and SaveRank are underlined.
yeah he meant Save...
08/05/2009 19:24 n0mansland#5
Yea doesn't really matter just how it is for mine.. As long as you see codes similar to the ones listed.. You can put above or below..
08/05/2009 20:25 Jay1029#6
Yeah, that's what I figured but SaveDonation and SaveRank are still underlined.
Could I have added
Code:
public int Rank = 0;
public int Donation = 0;
in the wrong place? I added it under public byte Stamina = 0;

I added this: under public void Save()
Code:
        public void SaveDonation()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveDonation(this);
        }
        public void SaveRank()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveRank(this);
        }
And this: under public static void SaveChar(Character Charr)
Code:
        public static void Donation(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `Donation` = '" + Charr.Donation + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
        public static void Rank(Character Charr)
        {
            try
            {
                MySqlCommand Command = null;
                Command = new MySqlCommand("UPDATE `Characters` SET `Rank` = '" + Charr.Rank + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
                Command.ExecuteNonQuery();

            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
I'm pretty sure everything is right. Just check that for me please.
08/07/2009 23:41 Jay1029#7
When I add
public void SaveDonation()
{
if (MyClient.There)
if (MyClient.Online)
DataBase.SaveDonation(this);
}
public void SaveRank()
{
if (MyClient.There)
if (MyClient.Online)
DataBase.SaveRank(this);
}

Under
public void Save()

SaveDonation and SaveRank are underlined =\ Do you know how to fix that?
08/07/2009 23:59 n0mansland#8
You don't have the public static void SaveDonation with it..
08/09/2009 05:09 Jay1029#9
But you didn't include that in your post before Oo
So what do I add and where do I add it?=p

//edit: This is what I tried. I'm almost 100% sure it wont work because I'm noob >.>

public static void SaveRank(Character Charr)
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `Rank` = '" + Charr.Rank + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
public static void SaveDonation(Character Charr)
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `Donation` = '" + Charr.Donation + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
08/09/2009 05:10 TehPwnzor#10
Just thought I'd let you know that I think this coding could be better, and at the end youll run into a problem where the effect spawns rapidly so...
08/09/2009 05:15 andyd123#11
It appears you posted relatively the same thing earlier.
Please, do not make multiple threads for the same thing!

#Closed