Godhand Posted October 25, 2007 Share Posted October 25, 2007 I was thinking for a while to limit how long a player can stay on. I was trying to do something like if($ir['lifespan'])=0 $db->query("UPDATE users SET force_logout=force_logout+1 WHERE userid=$userid"); I kept getting unexpected = error. I'd also like to know how I should set the crons up. I have another stat for this also besides lifespan (cooldown) I mean more of the formula I should use to approach this to start with to avoid glitches.Thanks for your help Quote Link to comment Share on other sites More sharing options...
Godhand Posted October 25, 2007 Author Share Posted October 25, 2007 Re: (v2) session limits I just tried that and didn't work how I wanted but I think that it pointed me to the right direction how to approach it. Thank you very much Quote Link to comment Share on other sites More sharing options...
Godhand Posted November 2, 2007 Author Share Posted November 2, 2007 Re: (v2) session limits Yes I know this is a double post. So I started to code though a little while. I'm using stats to get a session limit to prevent people from playing constantly.I know that I don't have this set up in my crons yet because of a problem. <?php if(!$ir['cooldown']) { $db->query("UPDATE users SET force_logout=force_logout+1 WHERE userid=$userid"); } $query="UPDATE users SET lifespan=lifespan-5 WHERE $r['laston'] >=time()-5*60 AND lifespan>0 AND cooldown=0"; $query="UPDATE users SET cooldown=cooldown-5 WHERE lifespan=0 AND cooldown>0"; $query="UPDATE users SET cooldown=cooldown+15 WHERE lifespan=0 AND cooldown=0"; $query="UPDATE users SET lifespan=36 WHERE lifespan=0 AND cooldown=0 AND $r['laston'] >=time()-5*60"; $db->query($query); $db->query($query2); $db->query($query3); $db->query($query4); ?> the problem is Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/myinfo/whateverhere/botprotection.php on line 11 which if we go there it will show $query="UPDATE users SET lifespan=lifespan-5 WHERE $r['laston'] >=time()-5*60 AND lifespan>0 AND cooldown=0"; And I *know* that if the problem is the $r['laston'] >=time()-5*60 then there will be the same problem in another line of the code. Any thoughts that would constructively help? 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.