Gold/Copper
Posted: Tue Nov 01, 2011 12:39 am
				
				Hey, I've got a little problem with my currencies.  , When I for example complete a quest it gives me gold. But I want it to be able to get both gold and copper from quests and creatures. not just gold.
, When I for example complete a quest it gives me gold. But I want it to be able to get both gold and copper from quests and creatures. not just gold.
if anyone know a code, please tell me
Quests.php a part of it, that one about gold. I've marked it(gold)
Thank you!
			 , When I for example complete a quest it gives me gold. But I want it to be able to get both gold and copper from quests and creatures. not just gold.
, When I for example complete a quest it gives me gold. But I want it to be able to get both gold and copper from quests and creatures. not just gold.if anyone know a code, please tell me
Quests.php a part of it, that one about gold. I've marked it(gold)
Code: Select all
else
  {
  $updatecre="Update players SET `$type`=`$type`-'$selectquest3[reqamount]' WHERE name='$playerinfo3[name]'";
	    mysql_query($updatecre) or die("Could not update player");
		echo $selectquest3['reqamount'] . " " . $type . " removed from inventory<br><br>";
		echo $selectquest3['finishquest'];
		$updatearmor="DELETE FROM currentquests where pid='$playerinfo3[name]' AND location = '$qid'  AND name = '$qname' limit 1";	   
	  mysql_query( $updatearmor) or die("Could not delete quest");
  if(isset($_POST['newquest']))
{$SQL = "INSERT into playerquests(pid,location,name,level) VALUES ('$playerinfo3[name]','$qid','$qname','2')"; mysql_query($SQL) or die("could not add to quests");}
else
{ $updatecre="Update playerquests SET level=level+1 WHERE pid='$playerinfo3[name]' AND location='$qid'  AND name='$qname'";
	    mysql_query($updatecre) or die("Could not update old quests");
		}
	$updatecre="Update players SET gold=gold+'$selectquest3[copper]',exper=exper+'$selectquest3[exper]' WHERE name='$playerinfo3[name]'";
	    mysql_query($updatecre) or die("Could not update quests")
//**HERE**//	echo "<br><br>Recieved " . $selectquest3['exper'] . " experience and " . $selectquest3['copper'] . " gold.";
	//////////////////if given item is a item/////////////////	
		if($selectquest3['item'] != 'none')
{
$iteminfo="SELECT * from items where name='$selectquest3[item]'";
$iteminfo2=mysql_query($iteminfo) or die("Could not get user items");
$iteminfo3=mysql_fetch_array($iteminfo2);
$SQL = "INSERT into inventory(id,name,type,stats,statadd,price) VALUES ('$playerinfo3[id]','$iteminfo3[name]','$iteminfo3[type]','$iteminfo3[stats]','$iteminfo3[statadd]','$iteminfo3[price]')"; mysql_query($SQL) or die("could not add to inventory");
echo $selectquest3['item'] . " added to your backpack.<br>";
}