a really small prob.

10/23/2008 13:34 BlooD-BoY#1
ok so umm i made a small code that will check if you use Lotto 10 times or not....but the prob. is when you relog it becomes 0 again O.O any ideas why? umm thx +)
10/23/2008 13:53 randomnoob#2
Quote:
Originally Posted by BlooD-BoY View Post
ok so umm i made a small code that will check if you use Lotto 10 times or not....but the prob. is when you relog it becomes 0 again O.O any ideas why? umm thx +)
because it doesnt save the amount of times that you entered lotto...
10/23/2008 14:03 Rechocto#3
update your mysql database (coproj) table (characters) and add the column "lotto" as an integer, then in DataBase.SaveChar() update it to save that variable.

Good luck :)
10/23/2008 22:39 BlooD-BoY#4
Quote:
Originally Posted by Rechocto View Post
update your mysql database (coproj) table (characters) and add the column "lotto" as an integer, then in DataBase.SaveChar() update it to save that variable.

Good luck :)
ok nvm, tyvm for your help it works =) btw i got a question, if i make a timer that will make it 0 after lets say 24hrs and i got a restarter that restarts the server every 1hr...will the 24hrs timer keep going or start from 24hrs again? O.O thx
10/24/2008 03:24 Rechocto#5
you have a couple of options here:

1) make a 3rd party stand alone program to modify the database at a given time each day
("update characters set lotto=0");
2) make it save when they did their lottos (DateTime.Now) and if (DateTime.Compare(LottoTime, DateTime.Now) == 86400) { } and make thatupdate it (86,400 seconds = 24 hours)
3) put a timer in your source to go off at a certain time each day
4) Set up a scheduled time for "server maintenence" (server goes down for a half hour, you compile any updates, run C Cleaner, and restart your computer) and in the startup script for your server you update the database setting lotto=0


there are many more options and how you do it is up to you, these are pretty simple ways in my opinion, so good luck:)