Agon Posted June 15, 2010 Share Posted June 15, 2010 I was thinking some sort of daily cron event to take away a small amount of stats for the inactive. Just like real life, if you quit working out, your muscles get weaker. So yeah, some sort of cron to lower strength, agility, guard, and labor if inactive for X amount of days. Thanks for the read! Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted June 15, 2010 Share Posted June 15, 2010 This?? $lose_stat = mysql_query("SELECT userid FROM users WHERE laston < unix_timestamp() - 2592000");//This would be 30 days... $stat = mysql_fetch_assoc($lose_stat); mysql_query("UPDATE userstats SET strength = strength - 50, agility = agility - 50, guard = guard - 50, labour = labour - 50, IQ = IQ - 50 WHERE userid = ".$stat['userid'].""); Completely untested... Quote Link to comment Share on other sites More sharing options...
Joshua Posted June 15, 2010 Share Posted June 15, 2010 I'd say set up timestamps in header to do it, save some cron space, but either way i've used something similar before, i'll see if i still have it on my comp at home rather than re-coding the timestamp bit ( I suck with timestamps ) Quote Link to comment Share on other sites More sharing options...
gurpreet Posted June 15, 2010 Share Posted June 15, 2010 Wouldn't a percentage be better? Say 0.5% because 50 may be high for some users, and low for others. Also could go into - Quote Link to comment Share on other sites More sharing options...
Diesl Posted June 17, 2010 Share Posted June 17, 2010 Wouldn't a percentage be better? Say 0.5% because 50 may be high for some users, and low for others. Also could go into - It would depend how you structure your game. If you make it easy to get stats, than a percentage would work, but if it's hard to get stats, i would you a set amount and a percentage. ex. stat - (100 + (1 % of stat)) Quote Link to comment Share on other sites More sharing options...
Agon Posted June 17, 2010 Author Share Posted June 17, 2010 Help with the unix time? I'm gonna google search around, but figured I'd also ask here. Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted June 17, 2010 Share Posted June 17, 2010 Help with the unix time? I'm gonna google search around, but figured I'd also ask here. What do you need help with? Quote Link to comment Share on other sites More sharing options...
Agon Posted June 17, 2010 Author Share Posted June 17, 2010 Basically want mine set at 7 days instead of 30. Quote Link to comment Share on other sites More sharing options...
Jordan Palmer Posted June 17, 2010 Share Posted June 17, 2010 Well I suck at calculations, but I think time() - (60 * 60 * 24 * 7); Something like that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.