rigla Posted August 30, 2009 Posted August 30, 2009 hey, anyone knows a way to stop users from attacking targets 10 levels lower AND higher than them ? found on the forums only a solution that stopped lower levels not higher. ty Quote
Lithium Posted August 30, 2009 Posted August 30, 2009 Re: question about attack if (abs($ir['level'] - $r['level']) > 10) { echo "no hitting users more than 10 levels apart"; die($h->endpage()); } Something along these lines is more than enough :) Quote
POG1 Posted August 30, 2009 Posted August 30, 2009 Re: question about attack abs is clearly not needed.. Quote
rigla Posted August 30, 2009 Author Posted August 30, 2009 Re: question about attack sorry but its not working, now i cant even attack players same level as me. Here's where ive put the code, maybe im wrong: if($odata['hp'] == 1) { print "This player is unconscious. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if (abs($ir['level'] - $r['level']) > 10) { echo "no hitting users more than 10 levels apart"; die($h->endpage()); } Quote
CrazyT Posted August 30, 2009 Posted August 30, 2009 Re: question about attack Because you need to use $odata not $r variable Quote
Lithium Posted August 30, 2009 Posted August 30, 2009 Re: question about attack "Something along these lines"... Meaning that it was just a way, NOT THE way to do it :) Quote
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.