Jump to content
MakeWebGames

Recommended Posts

Posted

Hey I'm trying to get it so that way when a user uses a Donater pack that will get stats money crystals level and an item but I can get the item to work

Help me thanks

MyDp.php

 

<?php

include "globals.php";

$_GET[iD] = abs((int) $_GET[iD]);

if(!$_GET[iD]) { echo '<h2>Oops</h2>Invalid use of file'; }

else

{

$i=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET[iD]} AND iv.inv_userid=$userid");

}

if(!$db->num_rows($i)) { print "<h2>Oops</h2>Invalid item ID"; }

else

{

$r=$db->fetch_row($i);
if($r[itmid] == 32)

{


$db->query("UPDATE users SET donatordays=donatordays+365 WHERE userid=$userid");  
$db->query("INSERT INTO inventory VALUES('',$itemid,$userid,1));
$db->query("UPDATE users SET money=money+1500000000 WHERE userid=$userid");

$db->query("UPDATE users SET crystals=crystals+75000 WHERE userid=$userid");
$db->query("UPDATE userstats SET IQ=IQ+1000000 WHERE userid=$userid");



echo '<h2>Donator Pack</h2>You have used your donator pack!';

}

item_remove($userid, $r['inv_itemid'], 1);

}
$h->endpage();

?>

Posted
Thats for making a DP into an item i want to put an item into a DP

Same principle. If the packs are there, adding money etc for the one using it, you can simply use the item_add() function that mcc already has to also give an item.

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