[Help] Points!!

09/07/2009 04:29 Jay1029#1
I'm sure a lot of you know about EmmeTheCoder's release about Points. I got everything working perfectly, which is great! However, when the character logs out the points do not save and the char logs back in with 0 points. Does anyone know who to fix this?!

These are the two save codes I've tried. None work!

#1
Code:
        public void SavePoints()
        {
            LastSave = DateTime.Now;
            if (MyClient.There)
                if (MyClient.Online)
                {
                    DataBase.SaveChar(this);
                    DataBase.SavePoints(this);
                }
        }
#2
Code:
        public void SavePoints()
        {
            LastSave = DateTime.Now;
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveChar(this);
                    DataBase.SavePoints(this);
        }
09/07/2009 07:50 .Guru#2
public void SavePoints()
{
LastSave = DateTime.Now;
if (MyClient.There)
{
if (MyClient.Online)
{
DataBase.SaveChar(this);
DataBase.SavePoints(this);
}
}
}

possibly? never tried points.
09/07/2009 08:20 hunterman01#3
Try This

Code:
public void SavePoints()
        {
            LastSave = DateTime.Now;
            if (MyClient.There)
                 {
                      if (MyClient.Online)
                       {
                            DataBase.SaveChar(this);
                            DataBase.SavePoints(this);
                        }
                  }
        }
09/07/2009 08:37 .Guru#4
lmaoz that's exactly what i just posted
09/07/2009 09:34 UnoAmigos#5
are you using MySQL source or Ini Source? i can helpyou if you're using Ini source..
09/07/2009 17:46 Jay1029#6
BAHH!!! Points still don't save -.-'
Thanks anyways guys, looks like I'll have to keep trying. Or wait for someone else to post their way of makin' it work.
09/07/2009 17:53 .Guru#7
under every if

you need to open brackets

ex.

Code:
if (blah)
{
   if (blah)
   {
    blah
   }
}
09/07/2009 19:57 hunterman01#8
Yeah thats what i was trying to say and dident realise he said it right above me 0.0
09/07/2009 20:30 Empty Project#9
The proper thing for you to do would actually be adding it into the SaveChar function, This way you wont need to do SavePoints() You can just leave it alone because whenever someone disconnects from the server it saves the character which in fact it will save the points.
09/07/2009 21:06 .Guru#10
Quote:
Originally Posted by Empty Project View Post
The proper thing for you to do would actually be adding it into the SaveChar function, This way you wont need to do SavePoints() You can just leave it alone because whenever someone disconnects from the server it saves the character which in fact it will save the points.
yeah i would have to agree on this one, because if you are using SavePoints()
& SaveChar(), it's basically wasting space. SaveChar() saves all the char's attributes, points and all, so like empty project said, would be easier to save the whole character instead.
09/08/2009 21:22 Jay1029#11
K thanks guys