Jump to content
MakeWebGames

Recommended Posts

Posted

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.

Posted

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

Posted

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.

Posted

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.

Posted

@ 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

Posted

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.

Posted

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]

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