DeaTH_RideR Posted June 10, 2010 Posted June 10, 2010 Hitman 25 asked for something to help limit the attacks on his game. request This might not have been just what ya wanted but here it is. it's what i use and serves its purpose. I'm sure it could be done better,but it works .Ok here we go. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. ADD this with the others for your new bar: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. next open attack.php . I have added some of my attack file so you can see where to put the if statement You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. in the same file look for: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. ADD this with the others You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then add this to your cron_hour You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. hope this helps ya out. Quote
bladewolf2010 Posted June 10, 2010 Posted June 10, 2010 Looks good thanks :) It doesn't stop them from attacking how do i make it work so they can't attack? it just keeps adding 25 over nd over I changed 10 to 25 by the way.. heres my attack.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and heres the link part You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Joshua Posted June 10, 2010 Posted June 10, 2010 if($ir['fatigue'] >= 100) If someone has say....13 fatigue and you +10 each time it would be over 100. Erego saying if($ir['fatigue'] == 100) is saying to deny only if it's equal. >= should do the trick there. heck even if($ir['fatigue'] > 99) would work. Would look better to change the if to else if as well. but not required. Quote
Uridium Posted June 10, 2010 Posted June 10, 2010 me personally i would have used Rand for the Fatigue from say 5-25 thats way users cant always be Guaranteed the same rise. Quote
bladewolf2010 Posted June 10, 2010 Posted June 10, 2010 it doesn't stop them from attacking on my end Quote
Joshua Posted June 10, 2010 Posted June 10, 2010 in this case mt_rand is not better. If it was a much larger variable mt would be better, but for the smaller integers rand is actually a bit faster. Quote
bladewolf2010 Posted June 11, 2010 Posted June 11, 2010 it still lets them do attacks when there fatigue gets full :/ Quote
Uridium Posted June 11, 2010 Posted June 11, 2010 Then what you need is fatigue v max_fatigue so when max_fatigue is reached you cant attack Quote
Agon Posted June 20, 2010 Posted June 20, 2010 I have another idea on this one. Maybe also set it up so a player can't be attacked more than X amount of times a day. I'm real busy with other mods right now, but if I can find the time, this would be a pretty easy adjustment. 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.