Naffer20 Posted September 4, 2013 Share Posted September 4, 2013 Is there a code that would prevent attacking players online? What would I add? :D Quote Link to comment Share on other sites More sharing options...
Seker Posted September 4, 2013 Share Posted September 4, 2013 ($r['laston'] >= $time) ? die("No online attacking") : false ; Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 4, 2013 Share Posted September 4, 2013 ughhh. I have never been a fan of that. maybe put a limit of online attacks per hour per person would be a better solution Quote Link to comment Share on other sites More sharing options...
Naffer20 Posted September 4, 2013 Author Share Posted September 4, 2013 ($r['laston'] >= $time) ? die("No online attacking") : false ; Mhm, that won't let anyone attack even if there offline Quote Link to comment Share on other sites More sharing options...
SRB Posted September 4, 2013 Share Posted September 4, 2013 Mhm, that won't let anyone attack even if there offline Seriously? Spoon feeding incoming... if ($r['laston'] > (time() - 300)) { echo 'You can not attack people while they are online.'; $h->endpage; exit; } *sigh* Quote Link to comment Share on other sites More sharing options...
Seker Posted September 4, 2013 Share Posted September 4, 2013 Seriously? Spoon feeding incoming... if ($r['laston'] > (time() - 300)) { echo 'You can not attack people while they are online.'; $h->endpage; exit; } *sigh* I honestly thought what I posted was already too much. Sheesh. Quote Link to comment Share on other sites More sharing options...
SRB Posted September 4, 2013 Share Posted September 4, 2013 I honestly thought what I posted was already too much. Sheesh. They go away faster if they get what they want. It's a win/win, overall. Quote Link to comment Share on other sites More sharing options...
Naffer20 Posted September 5, 2013 Author Share Posted September 5, 2013 Still doesn't work, so maybe you should put the right spoon in my mouth so I can be fed. Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted September 5, 2013 Share Posted September 5, 2013 great community spirit guys. in what way is it not working? Quote Link to comment Share on other sites More sharing options...
SRB Posted September 5, 2013 Share Posted September 5, 2013 Still doesn't work, so maybe you should put the right spoon in my mouth so I can be fed. Since $r defines players in the attack file, the code is correct. Error is therefore on your part - so put it in the right place! Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted September 5, 2013 Share Posted September 5, 2013 Think the OP got scared off Quote Link to comment Share on other sites More sharing options...
Djkanna Posted September 5, 2013 Share Posted September 5, 2013 Think the OP got scared off Do you blame him/her? Thread cleaned up somewhat, keep it to the subject of the thread please. Quote Link to comment Share on other sites More sharing options...
Bennyh789 Posted September 5, 2013 Share Posted September 5, 2013 Assuming your using mccodes in attack.php try if($r['laston'] >= time()-15*60) { print "You cannot players that are online.<br /> <a href='index.php'>> Back</a>"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } If you get any problems give me a shout and will see what I can do :) Quote Link to comment Share on other sites More sharing options...
Seker Posted September 5, 2013 Share Posted September 5, 2013 $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); There's no need for this. If he's trying to stop them from attacking at all, putting the previously given conditionals at the beginning of the file will do exactly what he wants. The fact that it's "not working" means he obviously doesn't know where it goes. In which case, I must ask, why is this guy working on the code at all? Order of operations applies to more than just math. 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.