Jump to content
MakeWebGames

Recommended Posts

Posted

first i would like to say this is my first mod and i had a little help from my good friend Zero Affect.

Ok i wanted to have something that would keep players from using a bunch of items that give like full energy over and over so here is what i done.

 

first add these to your users table .phpmyadmin

You're unable to view this code.

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

 

then open header.php

look for

You're unable to view this code.

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

 

right under that add

You're unable to view this code.

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

 

then just a few lines down should be

You're unable to view this code.

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

 

Add

You're unable to view this code.

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

right under

 

then still in header find

You're unable to view this code.

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

right under that add

You're unable to view this code.

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

save and close header.

next open up itemuse.php and look for

You're unable to view this code.

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

 

right under that add

You're unable to view this code.

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

"note you will have to find out the item type id for the items you want to use this for. save and close the file"

then open up your cron_hour and put

You're unable to view this code.

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

 

save and close cron_hour.

your done , if something dont work check your edits or post here.

Posted

if($r['itmtypeid'] == 3)

{

if($ir['hunger'] > 20){ die("You are already full, are you trying to have a heart attack?");}

$db->query("UPDATE users SET hunger=hunger+25 WHERE userid='" . mysql_real_escape_string($userid) . "' AND hunger < maxhunger", $c);

$db->query("UPDATE users SET energy=energy+100 WHERE userid='" . mysql_real_escape_string($userid) . "' AND energy < maxenergy", $c);

$db->query("UPDATE inventory SET inv_qty=inv_qty-1 WHERE inv_id={$_GET['ID']}",$c);

$db->query("DELETE FROM inventory WHERE inv_qty=0",$c);

echo "<table class='mailbox' width=555'><td align='center'><font color='orange'>You are starving, you wolf down the food and feel a little better.</font>

";

event_add($ir['userid'],"You used the ".$r['itmname']." but remember it only lets you eat so much.",$c);

}

  • 2 weeks later...
  • 2 years later...

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