Coly010 Posted January 3, 2011 Posted January 3, 2011 Ok this is the Real Estate mod i mention in the Sleep to restore health topic it is basically another way for the users to make money but the have to spend it to get it. They have to buy houses and hotels to up their income but then taxes get taken off it. taxes vary depending on income level and real estate level. everything else is explained in the files now to start: run this into the sql [mysql] CREATE TABLE IF NOT EXISTS `Real_Estate` ( `R_id` int(11) NOT NULL, `R_lvl` int(11) NOT NULL DEFAULT `0`, `R_houses` int(11) NOT NULL DEFAULT `0`, `R_hotels` int(11) NOT NULL DEFAULT `0`, `R_income` int(11) NOT NULL DEFAULT `0`, `R_tax` int(11) NOT NULL DEFAULT `0`, `R_upgrade` int(11) NOT NULL DEFAULT `10000`, PRIMARY KEY (`R_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ALTER TABLE `users` ADD `R_E` int(11) NOT NULL DEFAULT `0`; [/mysql] create file real_estate.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then add into the cron_day.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then add in either Explore or Mainmenu: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. thanks for reading . as always post and bugs or errors so i can learn from my mistake. Quote
Zan Posted January 3, 2011 Posted January 3, 2011 sql aint working and in realestate.php Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/damagedc/public_html/real_estate.php on line 32 Sql is not working and in real estate.php Quote
Coly010 Posted January 4, 2011 Author Posted January 4, 2011 where is the error for the sql coming up cos i dont see a problem and the same with line 32 Quote
Curt Posted January 4, 2011 Posted January 4, 2011 LINE 32 $ir['username'] Should be {$ir['username']} Quote
Dominion Posted January 4, 2011 Posted January 4, 2011 When using You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. don't add or die(mysql_error()); as the class file does it for you. same with $c it's done by the class file. Quote
rulerofzu Posted January 4, 2011 Posted January 4, 2011 Why all the seperate queries?? For example in the bhsub function Your have two queries to the real estate table when it could be just one. Your just making more queries and more overhead. Quote
Coly010 Posted January 4, 2011 Author Posted January 4, 2011 @ zu can u do more than two in the same query? @ curt ok i'll take that on board thanks for pointing it out @ dominion great thanks for pointing that out. i'm not used to v2 Quote
Equinox Posted January 4, 2011 Posted January 4, 2011 mysql_query("UPDATE `Table` SET `first` = 1, `second` = 2, `third` = 3, `fourth` = 4 WHERE (`something` = 'something')"); Quote
Eurogangster Posted January 6, 2011 Posted January 6, 2011 Can you guys fix this mod ? i mean the parse error Quote
rulerofzu Posted January 6, 2011 Posted January 6, 2011 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Fixed this up. Note this is not the way I would have coded this but I have no desire to recode it. Errors fixed for the OP fetch_array should be fetch_row No need for addition to users table - just check if there is a row using db->num_rows missing do= for upgrading and buying various spelling mistakes errors. mysql table uses mediumint rather than int which makes for less overhead in the database. I tested it briefly. Was able to sign up....buy upgrades, upgrade business which is everything its meant to do. Quote
rulerofzu Posted January 6, 2011 Posted January 6, 2011 Sorry but the php code function for this forum sucks ass!! [mysql]CREATE TABLE IF NOT EXISTS `Real_Estate` ( `R_id` mediumint(6) NOT NULL, `R_level` mediumint(6) NOT NULL, `R_houses` mediumint(6) NOT NULL, `R_hotels` mediumint(6) NOT NULL, `R_income` mediumint(6) NOT NULL, `R_tax` mediumint(6) NOT NULL, `R_upgrade` mediumint(6) NOT NULL, PRIMARY KEY (`R_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; [/mysql] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.