[Help]Coding a Npc Thats stores stuff(Not a wh)

06/26/2009 11:43 duddz#1
Ok i have been trying to get a Npc to Store PlusPoints. I want it so that every time i give a +1 stone it will add 1 point to PlusPoints Colum in my MySql Character table. Ive got it to take the stone, got the Colum ready, Just cant get it to add 1 point to it.
Im Using CoEmuV2
Any ideas on this?
Is it possibel
06/26/2009 16:47 Akarama#2
are you using lotf?
06/26/2009 20:31 duddz#3
[QUOTE=Akarama;2444066]are you using lotf?[/QUOTE

Oh sorry i forgot to say. Using CoEmuV2
06/26/2009 20:46 kinshi88#4
Code:
        public static void SavePlusPoint(ClientSocket CSocket)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `PlusPoints` = " + CSocket.Client.PlusPoints + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
06/26/2009 22:59 duddz#5
Quote:
Originally Posted by kinshi88 View Post
Code:
        public static void SavePlusPoint(ClientSocket CSocket)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `PlusPoints` = " + CSocket.Client.PlusPoints + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
Thanks you!
06/27/2009 02:57 m7med#6
I HAVE THIS ERROR
[Only registered and activated users can see links. Click Here To Register...]
PLEASE HELP
06/27/2009 23:06 duddz#7
Quote:
Originally Posted by m7med View Post
I HAVE THIS ERROR
[Only registered and activated users can see links. Click Here To Register...]
PLEASE HELP
Your dont put it in NpcTalk.cs i believe its Database.cs
06/28/2009 01:39 TheLeGend209#8
Quote:
Originally Posted by m7med View Post
I HAVE THIS ERROR
[Only registered and activated users can see links. Click Here To Register...]
PLEASE HELP

You Must put that in Database.cs
06/28/2009 01:40 TheLeGend209#9
Quote:
Originally Posted by kinshi88 View Post
Code:
        public static void SavePlusPoint(ClientSocket CSocket)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `PlusPoints` = " + CSocket.Client.PlusPoints + " WHERE `CharID` = " + CSocket.Client.ID + "", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
Ty Kinshi
07/08/2009 23:53 m7med#10
i have an error in PlusPoints

i fixed
in Entities\Character.cs
i add
public uint PlusPoints = 0;
07/08/2009 23:57 n0mansland#11
This isn't exactly a code.. That's just part of it... You still have to add a lot more parts in character.cs,npctalk.cs, etc. anyways duddz has already figured this out and released a Met Bank search for it and then use the codes in there...
07/09/2009 00:04 PeTe Ninja#12
its actually very easy.

here is what you have to add.

1. Points(or w.e u want) in the source, and mysql or ini w.e u use.
2. a save ( super easy )
3. a npc or command that lets you put it in and/or take it out.

and your done.