Dustin Rohel Posted July 4, 2023 Posted July 4, 2023 can someone please tell me how to make admins not able to be attacked? would be much appreciated! Thanks! Quote
Canjucks Posted July 4, 2023 Posted July 4, 2023 You need something along the lines of below in your attack files: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Dustin Rohel Posted July 4, 2023 Author Posted July 4, 2023 thank you Canjucks, where abouts would i place that in the attack files? Quote
Canjucks Posted July 4, 2023 Posted July 4, 2023 48 minutes ago, Dustin Rohel said: thank you Canjucks, where abouts would i place that in the attack files? Go with something like below at around line 35 (that is the out of the box version as I have 2 and my modded version is completely different): You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Dustin Rohel Posted July 4, 2023 Author Posted July 4, 2023 i put that on line 35, but i get this Red X on line 44. any tips? i took these out and it works. Thanks a ton Canjucks! } { no it works is this just for ID 1? or is this for ALL Admin Members? Quote
Canjucks Posted July 4, 2023 Posted July 4, 2023 1 hour ago, Dustin Rohel said: i put that on line 35, but i get this Red X on line 44. any tips? i took these out and it works. Thanks a ton Canjucks! } { no it works is this just for ID 1? or is this for ALL Admin Members? Just ID 1, you can put in an OR || GetID == "next Admin ID" <-- haven't looked at this closely enough to do by user level as you may need an sql query but hoping someone might give me a chop out whose more familiar with v2 than what I am these days (been 12 years) Quote
Dustin Rohel Posted July 4, 2023 Author Posted July 4, 2023 ok, i'll try that. No way to pick what user ID to put in the text on this? (Type the ID of each Admin member)? & Thanks again! Quote
KyleMassacre Posted July 4, 2023 Posted July 4, 2023 In your $odata_sql query, just add in there the `user_level` column and somewhere after the $odata = $db->fetch_row($q); you can add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Dustin Rohel Posted July 4, 2023 Author Posted July 4, 2023 i'm not sure how to find the sql's... Quote
Ishraq Posted July 4, 2023 Posted July 4, 2023 1 hour ago, Dustin Rohel said: i'm not sure how to find the sql's... If you're using MCC V2, it should just work if you copy and paste that snippet above on the top of the page where the rest of the if statement checks are. The user_level column should already be in the SQL. Post the top half of your attack.php and users table structure so we can confirm this. Quote
Dustin Rohel Posted July 4, 2023 Author Posted July 4, 2023 8 hours ago, KyleMassacre said: In your $odata_sql query, just add in there the `user_level` column and somewhere after the $odata = $db->fetch_row($q); you can add: if($odata['user_level'] == 2) { $_SESSION['attacklost'] = 0; echo 'You cannot attack and admin.<br />> <a href="index.php">Go Home</a>'; die($h->endpage()); } You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. put this at top of my attack.php page? Sorry, don't have my full brains back, hard to understand some things after my health issue few months back. Quote
KyleMassacre Posted July 5, 2023 Posted July 5, 2023 1 hour ago, Dustin Rohel said: put this at top of my attack.php page? Sorry, don't have my full brains back, hard to understand some things after my health issue few months back. Not in the top. You need to find the query that I mentioned if you have the stock attack file. Just do a crtl+f and find $odata_sql. In the query you will want to add user_level to the query. Then below that it has something like $odata = $db->fetch_row($odata_sql); and add that if statement somewhere below that and it should work Quote
Dustin Rohel Posted July 5, 2023 Author Posted July 5, 2023 sorry, im not understanding this... 😞 I'll just keep it as ID 1 Thanks for taking your time trying to help me! 🙂 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.