Jump to content
MakeWebGames

Buy House with level


Recommended Posts

sorry to post ere ive in help but no answer how do i set so that you have to be a certain level to buy a house ive imported sql with i think is right but what would i put in estate page ive been serached and one topic but it dont work any help thanks alot again sorry to post here

Link to comment
Share on other sites

Re: Buy House with level

my 2 cents...

It is not in 20 minutes that someone will answer you. 3 posts about the exact same thing is just one step to no one helping you out.

As of your first post about this, IF you read the entire thread instead skipping posts, you'd make it working.

Link to comment
Share on other sites

  • 2 weeks later...
Guest Sniko`

Re: Buy House with level

Open up staff_houses.php

and find

 

print "<h3>Add House</h3><hr />
<form action='staff_houses.php?action=addhouse' method='post'>
Name: <input type='text' name='name' />

Price: <input type='text' name='price' />

Max Will: <input type='text' name='will' />

<input type='submit' value='Add House' /></form>";

 

Replace with

 

print "<h3>Add House</h3><hr />
<form action='staff_houses.php?action=addhouse' method='post'>
Name: <input type='text' name='name' />

Price: <input type='text' name='price' />

Max Will: <input type='text' name='will' />

Level: <input type='text' name='level' />

<input type='submit' value='Add House' /></form>";

 

Now find

 

global $db, $ir, $c, $h, $userid;
$price=abs((int) $_POST['price']);
$will=abs((int) $_POST['will']);
$name=$_POST['name'];
if($price and $will and $name)

 

Replace with

 

global $db, $ir, $c, $h, $userid;
$price=abs((int) $_POST['price']);
$will=abs((int) $_POST['will']);
$name=$_POST['name'];
$lvl=$_POST['level'];
if($price and $will and $name)

 

Now find

 

$db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will')");

 

Replace with

 

$db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will', '$lvl')");

 

Now go to estate.php

find

 

$hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC");

 

Replace with

 

$hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} AND hLVL < {$ir['level']} ORDER BY hWILL ASC");

 

SQL

 

ALTER TABLE houses ADD hLVL INT(11) DEFAULT 1;

 

UNTESTED BUT SHOULD WORK

POST ANY BUGS

Thanks

Sniko

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