Jump to content
MakeWebGames

Recommended Posts

Posted
$Auction = $db->query("SELECT `ID`,`SellerID`,`ItemID`,`CurrentBid`,`Time`,`TimeLeft` FROM `gAuction` WHERE (`Time` - ".time()." + `TimeLeft` < 1)");
while($Auction2 = $db->fetch_row($Auction))
{
$AuctionBids = $db->query("SELECT `ID`,`aID`,`BidderID`,`CurrentBid2` FROM `gAuctionBids` WHERE (`aID` = ".$Auction2['ID'].")");  
$atime = $Auction2['Time'] - time() + $Auction2['TimeLeft']; 
if($atime < 1 && !$db->num_rows($AuctionBids))
{
event_add($Auction2['SellerID'],'Your auction finished without any bids.');
$db->query("INSERT INTO `inventory` VALUES ('',".$Auction2['ItemID'].",".$Auction2['SellerID'].",1)");
$db->query("DELETE FROM `gAuction` WHERE (`ID` = ".$Auction2['ID'].")");
}
elseif($atime < 1 && $db->num_rows($AuctionBids))
{
$AuctionBids = $db->fetch_row($AuctionBids);
event_add($Auction2['SellerID'],'Your auction has finished, the maximum bid was $'.number_format($Auction2['CurrentBid']).'');
event_add($AuctionBids['BidderID'], 'You\'ve won the auction!');
$db->query("UPDATE `users` SET `money` = `money` + ".abs(intval($Auction2['CurrentBid']))." WHERE (`userid` = ".$Auction2['SellerID'].")");
$db->query("INSERT INTO `inventory` VALUES ('',".$Auction2['ItemID'].",".$AuctionBids['BidderID'].",1)");
$db->query("DELETE FROM `gAuction` WHERE (`ID` = ".$Auction2['ID'].")");
$db->query("DELETE FROM `gAuctionBids` WHERE (`aID` = ".$Auction2['ID'].")");
}
}

 

mainly what i found was instead of putting "$db->" you put "$db>"

i also took out any unnecessary coding that was not needed for v2

Posted

Good call.

Dropped Auctions from Header... it didnt belong there. I probably used two different mods, removed one and didnt clean up unneeded code it placed in the header... this Auctions works without header code. Good call!

Missions might work, but it would not have a shot with db> so thanks for picking up on that.

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