Jump to content
MakeWebGames

Simple Upkeep question


KyleMassacre
 Share

Recommended Posts

Ok heres the scenario,

I create a house and add in my properties table hUPKEEP(House Upkeep) and say its 500,000.

I would like the house upkeep to be charged to them everyday and take it out of their money cause i have tried almost every mod i can find and nothing works at all

so i was wondering if i can do something in my cron day

Link to comment
Share on other sites

i dont know how your wanting it to work but the one i just told gives you the option to do it on certain houses..

so if a users own a house with no upKEEP fees nothing will be deducted unless they own a house where the admin has enabled the upKEEP fee..

create upKEEP int 11 under your houses or properties table

now update it so " UPDATE `houses` WHERE `upKEEP`='0' something like that

Now that will have updated the upKEEP to all your propeties to 0 this is not the price remember!

Now you can manually update which houses you want upKEEP fees on so just pcik them out and edit it and update the upKEEP from 0 to 1

Now go to cronday and just add the query in:

if($rr['upKEEP'] == 1)

{

$db->query("UPDATE users SET money=money-500000 WHERE userid=$userid");

}

then define $rr= pick out the upKEEP from houses etc..

$rr = $db->query("SELECT `upKEEP` from `houses`"); i dont know something like that

 

Am bad at coding again i say but thats just a basic of what you are wanting

not tested :S

Edited by modernmafiia
Link to comment
Share on other sites

i dont know how your wanting it to work but the one i just told gives you the option to do it on certain houses..

so if a users own a house with no upKEEP fees nothing will be deducted unless they own a house where the admin has enabled the upKEEP fee..

create upKEEP int 11 under your houses or properties table

now update it so " UPDATE `houses` WHERE `upKEEP`='0' something like that

Now that will have updated the upKEEP to all your propeties to 0 this is not the price remember!

Now you can manually update which houses you want upKEEP fees on so just pcik them out and edit it and update the upKEEP from 0 to 1

Now go to cronday and just add the query in:

if($rr['upKEEP'] == 1)

{

$db->query("UPDATE users SET money=money-500000 WHERE userid=$userid");

}

then define $rr= pick out the upKEEP from houses etc..

$rr = $db->query("SELECT `upKEEP` from `houses`"); i dont know something like that

 

Am bad at coding again i say but thats just a basic of what you are wanting

not tested :S

Ok, I like where your going with that what if I did something like this so I can have diferent amounts of upkeep if I want

if($rr['upKEEP'] > 0)
{
$db->query("UPDATE users SET money=money-upKEEP WHERE userid=$userid");
}

That should work the same right, except I get to define the upkeep for each prop?

Link to comment
Share on other sites

firstly >0 thats no needed as it wont be more than 1 anyways so might as well make it == 1 also why do you want to do that money=money-upKEEP?

you will have to again define it again its just more long but is doing the same thing i posted?

You can just edit the UPKEEP price on the Query

and i would choose different words for both just so it dont mess up..

if($rr['upKEEP'] == 1)

{

$db->query("UPDATE users SET money=money-$FEES WHERE userid=$userid");

}

define fees: $FEES = '500000' i dont know lol something like but you cant just put upKEEP in there like that lol nothing will happen but you will get errors.

 

If your looking to do a upKEEP price for each Prop You need to edit the staff houses file, You need a option to enable the fee or not and a field where you can type in fees/price if you do enable it.

Second go PHPMYADMIN and create both upKEEP and Fees in the houses or properties table

Update everything to 0

 

and back in staff houses file you need to add into the Queries that if you have enabled it on that property it should make the upKEEP for that property id == 1 instead of 0 meaning you have enabled it and w/e fee or price you entered should be also updated on the phpmyadmin under that house id into the fee or price colum.

Now back in Crons just make it so it picks out that house id and if UPkeep == 1 deduct money $fees froms users who own that property

then define $fees and $upKEEP again

Edited by modernmafiia
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.

 Share

×
×
  • Create New...