rigla Posted August 30, 2009 Share 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 Link to comment Share on other sites More sharing options...
Lithium Posted August 30, 2009 Share 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 Link to comment Share on other sites More sharing options...
POG1 Posted August 30, 2009 Share Posted August 30, 2009 Re: question about attack abs is clearly not needed.. Quote Link to comment Share on other sites More sharing options...
rigla Posted August 30, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
CrazyT Posted August 30, 2009 Share Posted August 30, 2009 Re: question about attack Because you need to use $odata not $r variable Quote Link to comment Share on other sites More sharing options...
Lithium Posted August 30, 2009 Share 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 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.