
legrolls
Members-
Posts
111 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by legrolls
-
Some people use so much energy in my game that their energy covers the entire screen. How can I make it remain the same?
-
Re: Deleting an item? FIXED, thanks everyone.
-
Re: Deleting an item? I followed you, and it worked for ID 1, but how do I make it work for all IDs?
-
I know adding an item to inventory is just: $db->query("INSERT INTO inventory VALUES('',id,$userid,1)"); But what is delete? I tried: $db->query("DELETE FROM inventory VALUES('',35,$userid,1)"); but nothing happened.
-
I want it so if you cook a pizza, you get exp in the cooking skill. Now, the cooking skill is just like any other skill, so how would I make it so you get cooking exp when you make the pizza? <? include "globals.php"; if($ir['cooking']< 0) { print "You have to have at least 15 cooking level to make a pizza."; $h->endpage(); exit; } if($ir['makepizza'] == 0) { die("Making a pizza without ingredients? It can't be done!"); } else { if($ir['makepizza'] == 1) { //set $win prize winings $win=rand(100,1700); $loss=rand(10,276); if(rand(1,30) <= 14) { print " You successfully create a pizza, and gain $win cooking exp!"; } else { if(rand(1,30) <= 15) { print " You burn the pizza, you dont win anything, you lose $loss dollars!"; $db->query("UPDATE users SET money=money-$loss WHERE userid=$userid",$c); } else { if(rand(1,30) <= 5) { print " You lose the dough![<u>[url='makepizza.php']Buy more dough[/url]</u>]"; $db->query("UPDATE users SET makepizza=0 WHERE userid=$userid",$c); } } } } } ?> It'd be the exact same as doing any other skill, like giving out strength or guard, but it's just called cooking. How do I do it?
-
If you have an item, you can create another?
legrolls replied to legrolls's topic in General Discussion
Re: If you have an item, you can create another? Still not working, thanks anyway, everyone. -
If you have an item, you can create another?
legrolls replied to legrolls's topic in General Discussion
Re: If you have an item, you can create another? I just don't know why, but it still says I don't have the sufficient ingredients. It's probably my fault, but I'm 100% sure they are the correct IDs, because I checked PHPMyAdmin and the game itself. -
If you have an item, you can create another?
legrolls replied to legrolls's topic in General Discussion
Re: If you have an item, you can create another? I have no php file yet. I just want to know how to make it work, it's still not working... -
If you have an item, you can create another?
legrolls replied to legrolls's topic in General Discussion
Re: If you have an item, you can create another? Fatal error: Function name must be a string in /home/mylifeth/public_html/pizzamake.php on line 4... -
If you have an item, you can create another?
legrolls replied to legrolls's topic in General Discussion
Re: If you have an item, you can create another? Where do I put that? -
If you have an item, you can create another?
legrolls replied to legrolls's topic in General Discussion
Re: If you have an item, you can create another? Still not working. If it makes any difference, it's mccodes v2 -
I want it so if you have a tomato (ID 32), cheese (ID 33), and crust (ID 34), you can make a pizza (ID 35) I'm not really sure on how to do it, I know how to $db->query("INSERT INTO inventory VALUES('',35,$userid,1)"); but I'm stuck on how to make it so if they have the ingredients, they can make the food, but if they don't, it tells them they need the ingredients.
-
Re: Adding item to inventory? Thanks once again! +1
-
Re: Adding item to inventory? Thank you! Also, how do I make a page donator only?
-
How do I add an item to the user's inventory? I have it so if they get all the materials, they smith a sword. The materials are used fine, but I'm not sure how to give the sword to them. $db->query("UPDATE users SET smithing=smithing-1 WHERE userid=".$ir['userid']); This is what happens after they make the sword. They get an invisible stat thingy called "smithing" that tells the code that they bought the materials. Once they smith it, the "smithing" goes away, so they need to buy new materials, hence the -1. How do I make it add a sword? The sword item is ID 16
-
How to make person say something else after you beat quest?
legrolls replied to legrolls's topic in General Discussion
Re: How to make person say something else after you beat quest? bump! -
Re: Energy not going up? Yeah me too.
-
The crons used to work fine, then I got a mysql error, now they don't work. * * * * * curl http://www.mylifetherpg.com/cron_minute ... xxxxxxxxxx * * */5 * * curl http://www.mylifetherpg.com/cron_fivemi ... xxxxxxxxxx 0 * * * * curl http://www.mylifetherpg.com/cron_hour.p ... xxxxxxxxxx 0 0 * * * curl http://www.mylifetherpg.com/cron_day.ph ... xxxxxxxxxx cron_minute.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE users set hospital=hospital-1 WHERE hospital>0"); $db->query("UPDATE `users` SET jail=jail-1 WHERE `jail` > 0"); $hc=$db->num_rows($db->query("SELECT * FROM users WHERE hospital > 0")); $jc=$db->num_rows($db->query("SELECT * FROM users WHERE jail > 0")); $db->query("UPDATE settings SET conf_value='$hc' WHERE conf_name='hospital_count'"); $db->query("UPDATE settings SET conf_value='$jc' WHERE conf_name='jail_count'");$db->query("UPDATE users SET traveltime = traveltime - 1 WHERE traveltime > 0"); $fetch_user = mysql_query("SELECT userid,username,parcel_time,parcel_got FROM users WHERE parcel_got!=0"); $soc = mysql_fetch_assoc($fetch_user); //Illusions idea! if($soc['parcel_time'] == 0) { mysql_query("UPDATE users SET parcel_time=0, parcel_got=0 WHERE userid=".$soc['userid']); $data = mysql_query("SELECT userid,username FROM users WHERE laston>unix_timestamp()-1440*60 ORDER BY DESC RAND() LIMIT 1"); $soc_u = mysql_fetch_assoc($data); mysql_query("UPDATE users SET parcel_time=10, parcel_got=".$soc['parcel_got']." WHERE userid=".$soc_u['userid']); event_add($soc_u['userid'],'You have just got the parcel! Click [url="wrappers.php?x=unwrap"]here[/url] to unwrap and see if you got the prize!'); } else { mysql_query("UPDATE users SET parcel_time=parcel_time-1 WHERE userid=".$soc['userid']); }?> cron_fivemins.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //brave update $query="UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave<maxbrave "; $query2="UPDATE users SET brave=maxbrave WHERE brave>maxbrave"; $query3="UPDATE users SET hp=hp+(maxhp/3) WHERE hp<maxhp"; $query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; $db->query($query); $db->query($query2); $db->query($query3); $db->query($query4); //enerwill update $query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy AND donatordays=0"; $query5="UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy<maxenergy AND donatordays>0"; $query2="UPDATE users SET energy=maxenergy WHERE energy>maxenergy"; $query3="UPDATE users SET will=will+10 WHERE will<maxwill"; $query4="UPDATE users SET will=maxwill WHERE will>maxwill"; $db->query($query); $db->query($query5); $db->query($query2); $db->query($query3); $db->query($query4); if($set['validate_period'] == 5 && $set['validate_on']) { $db->query("UPDATE users SET verified=0"); } if($set['validate_period'] == 15 && $set['validate_on'] && in_array(date('i'),array("00", "15", "30", "45"))) { $db->query("UPDATE users SET verified=0"); } ?> cron_hour.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $db->query("UPDATE gangs SET gangCHOURS=gangCHOURS-1 WHERE gangCRIME>0"); $q=$db->query("SELECT g.*,oc.* FROM gangs g LEFT JOIN orgcrimes oc ON g.gangCRIME=oc.ocID WHERE g.gangCRIME > 0 AND g.gangCHOURS = 0"); while($r=$db->fetch_row($q)) { $suc=rand(0,1); if($suc) { $log=$r['ocSTARTTEXT'].$r['ocSUCCTEXT']; $muny=(int) (rand($r['ocMINMONEY'],$r['ocMAXMONEY'])); $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $db->query("UPDATE gangs SET gangMONEY=gangMONEY+$muny,gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'success', $muny, '{$r['ocNAME']}', unix_timestamp())"); $i=$db->insert_id(); $qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}"); while($rm=$db->fetch_row($qm)) { event_add($rm['userid'],"Your Gang's Organised Crime Succeeded. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } else { $log=$r['ocSTARTTEXT'].$r['ocFAILTEXT']; $muny=0; $log=str_replace(array("{muny}","'"),array($muny,"''"),$log); $db->query("UPDATE gangs SET gangCRIME=0 WHERE gangID={$r['gangID']}"); $db->query("INSERT INTO oclogs VALUES ('',{$r['ocID']},{$r['gangID']}, '$log', 'failure', $muny, '{$r['ocNAME']}', unix_timestamp())"); $i=$db->insert_id(); $qm=$db->query("SELECT * FROM users WHERE gang={$r['gangID']}"); while($rm=$db->fetch_row($qm)) { event_add($rm['userid'],"Your Gang's Organised Crime Failed. Go [url='oclog.php?ID=$i']here[/url] to view the details.",$c); } } } if(date('G')==17) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET u.money=u.money+jr.jrPAY, u.exp=u.exp+(jr.jrPAY/20) WHERE u.job > 0 AND u.jobrank > 0"); $db->query("UPDATE userstats us LEFT JOIN users u ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET us.strength=(us.strength+1)+jr.jrSTRG-1,us.labour=(us.labour+1)+jr.jrLABOURG-1,us.IQ=(us.IQ+1)+jr.jrIQG-1 WHERE u.job > 0 AND u.jobrank > 0"); } if($set['validate_period'] == 60 && $set['validate_on']) { $db->query("UPDATE users SET verified=0"); } ?> cron_day.php <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) where bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;");$db->query("UPDATE users SET fishing_aloud=10");$db->query("UPDATE users SET dare = 5"); $db->query("UPDATE users SET clubvisits = 0");$db->query("UPDATE users SET player_week=-1 WHERE player_week > 0"); ?>
-
How to make person say something else after you beat quest?
legrolls replied to legrolls's topic in General Discussion
Re: How to make person say something else after you beat quest? MYSQL: ALTER TABLE `users` ADD `crayonquest` TINYINT NOT NULL DEFAULT '0'; crayonquestbuy.php <?php include "globals.php"; print "<h3>Buy some crayons for that pesky kid, or visit him [url='crayonquest.php'][<u>here!</u>][/url]</h3>"; print " <table border=2><th>Item</th><th>Price</th><th>Purchase</th> <tr> <td>Crayons</td><td>$30</td><td>[url='crayonquestbuy.php?spend=crayon']Buy[/url]</td></table>"; if($_GET['spend'] == 'crayon') { if($ir['money'] <30) { print "You don't have enough money!"; } else { if($ir['money'] >30) { print "You bought the crayons! Yippie! [url='index.php']Go Home[/url] [url='crayonquest.php']Go to the pesky kid[/url]"; $db->query("UPDATE users SET money=money-30,crayon=1 WHERE userid=$userid",$c); } } } $h->endpage(); ?> Crayonquest.php <?php include "globals.php"; print "<h3>Buy some crayons for that pesky kid, or visit him [url='crayonquest.php'][<u>here!</u>][/url]</h3>"; print " <table border=2><th>Item</th><th>Price</th><th>Purchase</th> <tr> <td>Crayons</td><td>$30</td><td>[url='crayonquestbuy.php?spend=crayon']Buy[/url]</td></table>"; if($_GET['spend'] == 'crayon') { if($ir['money'] <30) { print "You don't have enough money!"; } else { if($ir['money'] >30) { print "You bought the crayons! Yippie! [url='index.php']Go Home[/url] [url='crayonquest.php']Go to the pesky kid[/url]"; $db->query("UPDATE users SET money=money-30,crayon=1 WHERE userid=$userid",$c); } } } $h->endpage(); ?> -
How to make person say something else after you beat quest?
legrolls replied to legrolls's topic in General Discussion
Re: How to make person say something else after you beat quest? I just want it so you can't start the quest again... :cry: Can anyone please help me? -
How to make person say something else after you beat quest?
legrolls replied to legrolls's topic in General Discussion
Re: How to make person say something else after you beat quest? Didn't work...here are both codes as of right now: Crayonquestbuy.php <?php include "globals.php"; print "<h3>Buy some crayons for that pesky kid, or visit him [url='crayonquest.php'][<u>here!</u>][/url]</h3>"; print " <table border=2><th>Item</th><th>Price</th><th>Purchase</th> <tr> <td>Crayons</td><td>$30</td><td>[url='crayonquestbuy.php?spend=crayon']Buy[/url]</td></table>"; if($_GET['spend'] == 'crayon') { if($ir['money'] <30) { print "You don't have enough money!"; } else { if($ir['money'] >30) { print "You bought the crayons! Yippie! [url='index.php']Go Home[/url] [url='crayonquest.php']Go to the pesky kid[/url]"; $db->query("UPDATE users SET money=money-30,crayon=1 WHERE userid=$userid",$c); } } } $h->endpage(); ?> Crayonquest.php <? include "globals.php"; if($ir['crayonquest'] == 1) { die("you've already done this quest"); } else { if($ir['crayon'] == 0) { die("Pesky Kid: Buy me some crayons!"); } else { if($ir['crayon'] == 1) { //set $win prize winings $win=rand(10,170); $loss=rand(10,276); if(rand(1,30) <= 14) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $db->query("UPDATE users SET crayon=0 WHERE userid=$userid",$c); $db->query("UPDATE users SET exp=exp+$win WHERE userid=$userid",$c); $db->query("UPDATE users SET crayonquest=1 WHERE userid=$userid",$c); } else { if(rand(1,30) <= 15) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $db->query("UPDATE users SET crayon=0 WHERE userid=$userid",$c); $db->query("UPDATE users SET exp=exp+$win WHERE userid=$userid",$c); $db->query("UPDATE users SET crayonquest=1 WHERE userid=$userid",$c); } else { if(rand(1,30) <= 5) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $db->query("UPDATE users SET crayon=0 WHERE userid=$userid",$c); $db->query("UPDATE users SET exp=exp+$win WHERE userid=$userid",$c); $db->query("UPDATE users SET crayonquest=1 WHERE userid=$userid",$c); -
I developed my first quest, a quest where a pesky kid asks you for crayons, you buy them, and give them to him, and he gives you experience. However, if you refresh the page, he will ask you for crayons again, and you could just go and buy more of them, to get lots of experience. How could I make it so after you give him the crayons once, he would say, "Thank you for the crayons!" or something like that, so you can't give him anymore? This is the crayonquest.php page, if you need the crayonquestbuy.php page, just tell me. <? include "globals.php"; if($ir['crayon'] == 0) { die("Pesky Kid: Buy me some crayons!"); } else { if($ir['crayon'] == 1) { //set $win prize winings $win=rand(10,170); $loss=rand(10,276); if(rand(1,30) <= 14) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $db->query("UPDATE users SET crayon=0 WHERE userid=$userid",$c); $db->query("UPDATE users SET exp=exp+$win WHERE userid=$userid",$c); } else { if(rand(1,30) <= 15) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $db->query("UPDATE users SET crayon=0 WHERE userid=$userid",$c); $db->query("UPDATE users SET exp=exp+$win WHERE userid=$userid",$c); } else { if(rand(1,30) <= 5) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $db->query("UPDATE users SET crayon=0 WHERE userid=$userid",$c); $db->query("UPDATE users SET exp=exp+$win WHERE userid=$userid",$c);
-
Re: How to find cron info? No, you didn't. I'm just more of a HTML/Javascript kinda guy...
-
Re: How to find cron info? Wow, I'm very stupid. I apologize. Thanks, everyone!