-
Posts
2,667 -
Joined
-
Last visited
-
Days Won
75
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Hope this helps.. Add to global_func.php function inv_item_dropdown($connection,$ddname="userinv",$selected=-1) { global $db,$r,$ir; $ret="<select name='$ddname' type='dropdown'>"; $q=$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_userid=".$ir['userid'].""); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['itmname']}'"; if ($selected == $r['itmname'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['itmname']} <b>You Have ({$r['inv_qty']}) Of This Item</b></option>"; } $ret.="\n</select>"; return $ret; } then add anywhere near top of inventory.php print "<h3>Inventory Quick View</h3><br /> ".inv_item_dropdown($c,'userinv')."<br />"; Should list Items you have by name and Quantity
-
Im on your game now any chance you can send me some items probably 12 of about 3 items
-
send me link to your game addy....
-
check in your itemuse.php and make sure that theres no mention of the items being deducted twice
-
if the user has 500+ items that dropdown box could become rather larger
-
I think what he emans is restructering the staff so instead of admin being 2 it would be something else me personallid just add a new field called staff and give them names so if $ir[staff] == "Admin";
-
$from="2"; $idtochange="userid's number" $to="new user_level number" $db->query("update users set user_level=$from where user_level=$to, userid=$idtochange");
-
This mod will prevent users from sitting on an attack page waiting for their Energy or HP to replenish. If user doesnt finish the attack i an alloted time they themselves are sent to Hosp for wasting time... 2 updates to the user table ALTER table users ADD fighttime INT(11) NOT NULL default 0; ALTER table users ADD timeout INT(2) NOT NULL default 0; in your attack.php find $mw=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$ir['equip_primary']}, {$ir['equip_secondary']})"); and add underneath it if($ir['fighttime'] == 0) { mysql_query("update users set fighttime=6 where userid=$userid"); } if($ir['fighttime'] > 1) { print"<td colspan=2 align='center'><center>Your Attack Time Has ".$ir['fighttime']." Min(s) Remaining</center>"; } if($ir['fighttime'] == 1) { mysql_query("update users set timeout=1 where userid=$userid"); } if($ir['timeout'] == 1) { $time = rand(30,60); print"<br /><br /><center>Your Slowness to move meant your opponent got bored and went home<br /><br /><a href='hospital.php'>Go Home</a></center>"; mysql_query("UPDATE users SET hospital=hospital+$time,hospreason='Failed to move in an attack!' WHERE userid=$userid",$c); mysql_query("update users set fighttime=0 where userid=$userid AND userid=".$_GET['ID'].""); mysql_query("update users set timeout=0 where userid=$userid AND userid=".$_GET['ID'].""); $db->query("UPDATE users SET attacking=0 WHERE userid=$userid AND userid=".$_GET['ID'].""); $db->query("UPDATE users SET energy=energy-20 WHERE userid=$userid"); $db->query("UPDATE users SET attacking=0 WHERE userid=".$_GET['ID'].""); die(); } Now open up hospital.php and add if($ir['timeout'] == 1) { mysql_query("update users set timeout=0, fighttime=0 where userid=$ir[userid]"); } And your done Users can no long sit and wait for things to replenish
-
wow this is taking me back a bit first one i made was a simple edit item type http://makewebgames.io/showthread.php/25281-Edit-Item-Type-Code-Solved?highlight=edit+item+types
-
if ($ir[character] =='Human'){ mysql_query("Select * from shops where viewer='Human'"); else print"You Not Human" }
-
unexpected T_STRING Error?? Can't find the problem!!
Uridium replied to jjnicholascolwill's topic in PHP
Infact the http and the target blank need to be removed as lucky mentioned they were not in the original but for some reason the forums have decided to place them there Using >>> print " [<a href=\"http://dpuse.php?ID={$i['inv_id']}\" target=\"_blank\">Use</a>]"; will give an error so use >> print " [<a href=dpuse.php?ID={$i['inv_id]}">Use</a>]"; -
It only seems to do it when a php file has multiple line spacing ive never had problems with Notepad++ and used it for a long time but the file worked fine before i edited it UNLESS it was sent from the FTP to my comp in that state... so might be a transfer problem....
-
-
is anyone who is using Notepad++ having an issue where by you save a file send to FTP and you get a unexpected T_Include one line 1 Then when you paste to normal notepad the whole script is on line one instead of being spaced out ?? example: <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php ------------------------------------------------------- -- Armory Script PLUS v1.0 -- A product of Flash Fire Gaming -- Copyright held 2006 by Cronus -----------------------------------------------------*/ include "globals.php"; if($ir[hospital]>0) die("You are in the hospital for {$ir[hospital]} minutes."); if($ir[jail]>0) die("You are in jail for {$ir[jail]} minutes."); $_GET['ID']= abs((int) $_GET['ID']); $_POST['qty']= abs((int) $_POST['qty']); if(!$_GET['ID'] || !$_POST['qty']) { print "Invalid use of file"; } else if($_POST['qty'] <= 0) { print "You have been added to the delete list for trying to cheat the game."; } else { $q=mysql_query("SELECT * FROM items WHERE itmid={$_GET['ID']}",$c); if(mysql_num_rows($q) == 0) { print "Invalid item ID"; } else { $itemd=mysql_fetch_array($q); if($ir['money'] < $itemd['itmbuyprice']*$_POST['qty']) { print "You don't have enough money to buy this item!"; $h->endpage(); exit; } if($itemd['itmbuyable'] == 0) { print "This item can't be bought!"; $h->endpage(); exit; } $price=($itemd['itmbuyprice']*$_POST['qty']); mysql_query("INSERT INTO inventory VALUES('',{$_GET['ID']},$userid,{$_POST['qty']},0);",$c); mysql_query("UPDATE users SET money=money-$price WHERE userid=$userid",$c); mysql_query("INSERT INTO itembuylogs VALUES ('', $userid, {$_GET['ID']}, $price, {$_POST['qty']}, unix_timestamp(), '{$ir['username']} bought {$_POST['qty']} {$itemd['itmname']}(s) for {$price}')", $c); print "You bought {$_POST['qty']} {$itemd['itmname']}(s) for \$$price"; } } $h->endpage(); ?> Infact that seemed to work fine when posting on here so i'll try do a screen shot
-
Its the same bloody principal. are you trying to make me look stupid...
-
Yep not gonna work like that you may get the itemid or is it itmid i cant remember im sure its itmid though so for now im gonna use that to explain <img src='itemimg/{$itmid['itmid']}.jpg' size=70 width=70> <<< WILL WORK <img src='itemimg/{$itmid['itmid']}' size=70 width=70> <<< wont wont So your images can be only one format choose then stick to that format... But have to say very nice though DamagedCity :) Yep tested it and it worked ok :)
-
try changing mysql_query to $db->query
-
From what ive learned about most peoples sites ive worked on the Users dbase can get rather large
-
http://www.speedtest.net/result/1453035517.png
-
Smokey that error just means that there are 2 Functions with the exact same name being used easiest way to find this out would be to open all the PHP files in notepad++ and do a search in all files for that name thats being declared twice if you get 2 results then you know 1 needs to be removed..
-
I dont think its the Installer thats at fault i think a better Readme file would help people with common errors and how to eliminate them exmple when setting up via xampp and the user doesnt have a password for the dbase setup the installer wont install
-
spud i suggest changing max-width and max-height to just width and height it dont seem to work on IE
-
wow people still use 600 x 800 screen res lol