Jump to content
MakeWebGames

[Request] Basic Shared Housing


Jimbo

Recommended Posts

Just want a simple shared housing. The partner with the lower value house automatically moves into the higher value house and have the same amount of will.

I'm actually not looking for someone to code this as I can do it on my own. I just would like some ideas, I'm not exactly sure how I should go with it. Seems like there can be a lot of exploits with this and I want to make sure everything runs smoothly.

Link to comment
Share on other sites

I'm not sure why people want to do such a thing, with the way you want it it would be rather easy for someone that is high in the game to have the best house and marry a noob friend of theirs and that friend easily be able to out train people because of the housing. I don't see this as fair.

Link to comment
Share on other sites

In design, the easiest way would be to have the estate.php populate 2 fields;

 

1 new one, for arguments sake, "housewill".

1 old one, maxwill;

 

By using housewill, and only housewill, in the estate.php - it doesn't pollute the field anywhere in the game but locks down the buying and selling of property to that field alone.

 

Then use maxwill as it currently is.

 

if ($ir['married']) {

$sql = "SELECT MAX(maxwill) as max_will FROM users WHERE userid IN ($ir['userid'], $ir['married']);";

$result = $db->query($sql);

if ($db->num_rows($result)) {

$row = $db->fetch_row($result);

if ($ir['maxwill'] != $row['max_will']) {

$sql = "UPDATE users SET maxwill = $row['max_will'] WHERE userid = " . $ir['userid'];

$db->query($sql);

}

}

}

 

NOTE - I said simplest, not best.

Link to comment
Share on other sites

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