Jump to content
MakeWebGames

[mccode] No Attack


ddupuis

Recommended Posts

Ok here is a little bit of code just to stop attacks on staff and players till the reach a specific level.

//--- Can't attack staff

else if ($odata['user_level'] > 1)

{

print "You can't attack Staff";

$db->query("UPDATE users SET hp=0 WHERE userid=$userid");

$db->query("UPDATE users SET hospital=5 WHERE userid=$userid");

$h->endpage();

exit;

}

//--- Can't attack level 1 player. you can change the level

if($odata['level'] <= 1)

{

print "This player is Level one. Give them time to learn.

> Back";

$h->endpage();

$_SESSION['attacking']=0;

$ir['attacking']=0;

$db->query("UPDATE users SET attacking=0 WHERE userid=$userid");

exit;

}

Link to comment
Share on other sites

Re: No Attack

It was posted cause someone asked for it and the other one posted does NOT work..

It was also so players can't attack staff... I don't just repost the same things from the site.. In fact i don't use anything from here.. Most things are full of bugs and much simpler to write myself.. just trying to contibute to people who need it..

Link to comment
Share on other sites

  • 3 weeks later...

Re: No Attack

 

It was posted cause someone asked for it and the other one posted does NOT work..

It was also so players can't attack staff... I don't just repost the same things from the site.. In fact i don't use anything from here.. Most things are full of bugs and much simpler to write myself.. just trying to contibute to people who need it..

Yeah. I have to agree with that. I have copies of both codes so I test before I add on here but I'm not sure about other people.

Link to comment
Share on other sites

  • 2 months later...

Re: No Attack

been there done that!!!!!!!! Got tired of my coders getting hit when they were online so Latino Heat did this one for me LAST YEAR. Easy for all you new coders.

In the attack.php look for where it says you can only attack in same location then add this right below:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

this keeps my admins from getting hit, but owners and any player thats baby about getting hit can be added just change the players ID number. If you want staff not hit just change the USERID to USER_LEVEL and your done. THIS is V1 or V2. And also easy for any noob!!!!!!!!!!!!

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Re: No Attack

 

I Just tryed this mod it dont work it wont stop a member attacking a staff member and when a member is a levle to or higher it wont let you attack please fix this mod thanks

ronhouston2 try this:

 

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

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...