Jump to content
MakeWebGames

Admins Not Attackable V2


Recommended Posts

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.

 

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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 />&gt; <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.

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...