Jump to content

Deviants

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Deviants's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. But they would have to be updated differently depending on how much they gain per 10 minutes. So instead of being multiplyed by .01 it would have to be multiplied by a column in the database for each user. How could I do this?
  2. I found this on a different forum and I thought this might work, but could someone elaborate more on this? I see these people coding 'turn based games' all the time, no idea how they work, but if a turn is every 30 minutes why not just look at the value returned by time(), then subtract the timestamp of when the first turn took place and then divide by the amount of seconds in a half hour, then floor() it, make this a function and call it to see what turn it's on. This way you only store the timestamp of each users first turn in the DB, no cron jobs, and mySql can focus on more important things, you also don't have to worry about users not getting their 'turns' incremented right away (if your update script takes 5 minutes to run the last users will experience delayed update times) I guess if your database isn't that large your way isn't an issue, but if your site gets too big you will need a more efficient way. :-)
  3. Okay, it was just a test lol at 1 minute... It will probably be around 10 minutes... Anyways, each player should gain a different amount of money each 10 minutes, is there a way to make a cron job for that?
  4. Alright, well I want to create a way to update the resources of a player... lets say Money every 1 minute. How would I go about doing this? I've never delt with a time stamp before. I have a column of a table for Money which is set to 0 as default... so how would I make it add lets say.... 1,000 to it every 1 minute
  5. Sorry, I got this log in script from a rather old thread I guess... thanks for the help
  6. I've got a question... how come everytime I try to start a session, I get this error? Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\mygame\login_success.php:2) in C:\xampp\htdocs\mygame\login_success.php on line 3 Login Successful It displays the login succesful, it shows this annoying error above it... Heres my source for login_success.php <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html> <body> Login Successful </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.