DJ Rankin Posted August 16, 2007 Share Posted August 16, 2007 Hi i need this mod to take money out of the bank if you dont have it in hand and if you dont have it in hand you lose your house <?php include "mysql.php"; global $c; include "global_func.php"; //House Tax Update $uq=mysql_query("SELECT * FROM users"); $Row=0; while($r=mysql_fetch_array($uq)) { $will = $r['maxwill']; $hq=mysql_query("SELECT * FROM houses WHERE hWILL='{$will}'"); if(mysql_num_rows($hq) == 0) { } $r2=mysql_fetch_array($hq); if($r['money'] < $r2['hTAX']) { $money=$r['money']; event_add($r['userid'],"You failed to pay the tax, so you have lost the house.",$c); mysql_query("UPDATE users SET money=money+{$r2['hPRICE']}, maxwill=100 WHERE userid={$r['userid']}"); } else { mysql_query("UPDATE users SET money=money-'{$r2['hTAX']}' WHERE userid='{$r['userid']}'"); } $Rows++; } ?> Totally there were <?php print($Rows); ?> rows which were executed. Quote Link to comment Share on other sites More sharing options...
SaMz Posted August 16, 2007 Share Posted August 16, 2007 Re: HOUSE TAX!!!! should be pretty simple Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 16, 2007 Author Share Posted August 16, 2007 Re: HOUSE TAX!!!! well code it then Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! well code it then Your attitude and how you talk to people you hope will help you sucks. I could and would have done this until i scrolled down to that message. Now all i have to say is: Do it yourself Thats exactly how i thought. well code it then I was going to do it i was just about to copy the code to edit it until i seen this message. This is why i dont come on much more! Im going soon so i am sure you didnt mean it to sound like you did therefore i will forgive you. Just make sure you say sorry in your next post! <?php include "mysql.php"; global $c; include "global_func.php"; //House Tax Update $uq=mysql_query("SELECT * FROM users"); $Row=0; while($r=mysql_fetch_array($uq)) { $will = $r['maxwill']; $hq=mysql_query("SELECT * FROM houses WHERE hWILL='{$will}'"); if(mysql_num_rows($hq) == 0) { } $r2=mysql_fetch_array($hq); $ymny=$r['money']+$r['bankmoney']; if($ymny < $r2['hTAX']) { $money=$r['money']; event_add($r['userid'],"You failed to pay the house tax, so you have lost your house.",$c); mysql_query("UPDATE users SET money=money+{$r2['hPRICE']}, maxwill=100, willmax=100, will=100 WHERE userid={$r['userid']}"); } else { mysql_query("UPDATE users SET bankmoney=bankmoney+'{$ir['money']}' WHERE userid='{$r['userid']}'"); mysql_query("UPDATE users SET bankmoney=bankmoney-'{$r2['hTAX']}' WHERE userid='{$r['userid']}'"); event_add($r['userid'],"We banked your money and at the same time took the house tax you owe us.",$c); } $Rows++; } ?> Totally there were <?php print($Rows); ?> rows which were executed. that should work Quote Link to comment Share on other sites More sharing options...
YoungGold Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! ait tested it kraig but i want to give you +1 for posting it as Dj rankin was rude in saying well code it then Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! thankyou! Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! its not takin money from hand Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! no, its adding the money from the hand into the bank and then taking it from the bank. So tax is 5000, in hand they have 3000 and 2000 in bank, it puts the 3000 in the bank and takes it away with the 2000 origionaly in the bank. or if tax is 5000, hand has 6000, bank 2000, it still banks all the hand money and then takes 5000 from the bank. this is the only way i could do it lol also, i dont see any sorry for your rude post Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! k sorry for that rude post truly sorry but i want the house tax to take it out of the bank if you dont have it in hand and if you have it in hand it takes that Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! k sorry for that rude post truly sorry but i want the house tax to take it out of the bank if you dont have it in hand and if you have it in hand it takes that Thats more like it. thankyou! I havent coded much for a while, so i dont think i can do that lol. cant you live with it? EDIT: <?php include "mysql.php"; global $c; include "global_func.php"; //House Tax Update $uq=mysql_query("SELECT * FROM users"); $Row=0; while($r=mysql_fetch_array($uq)) { $will = $r['maxwill']; $hq=mysql_query("SELECT * FROM houses WHERE hWILL='{$will}'"); if(mysql_num_rows($hq) == 0) { } $r2=mysql_fetch_array($hq); $ymny=$r['money']+$r['bankmoney']; if($r['bankmoney'] < $r2['hTAX'] AND $r['money'] < $r2['hTAX']) { $money=$r['money']; event_add($r['userid'],"You failed to pay the house tax, so you have lost your house.",$c); mysql_query("UPDATE users SET money=money+{$r2['hPRICE']}, maxwill=100, willmax=100, will=100 WHERE userid={$r['userid']}"); } } if($r['bankmoney'] > $r2['hTAX']) { mysql_query("UPDATE users SET bankmoney=bankmoney-'{$r2['hTAX']}' WHERE userid='{$r['userid']}'"); event_add($r['userid'],"We have taken the house tax from your bank.",$c); } else if($r['money'] > $r2['hTAX']) { mysql_query("UPDATE users SET money=money-'{$r2['hTAX']}' WHERE userid='{$r['userid']}'"); event_add($r['userid'],"We have taken the house tax from your money.",$c); } $Rows++; } ?> Totally there were <?php print($Rows); ?> rows which were executed. try that, if it doesnt work then tell me the error Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! it dosnt send any events it says Totally there were 1 rows which were executed. Quote Link to comment Share on other sites More sharing options...
YoungGold Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! why do you want it to send an event for its pointless. Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! cause i want to lol Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! Well people wont like an event every day man, just leave it. Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! i want it tho:( Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! if not can you have a look of that please http://criminalexistence.com/ceforums/i ... ic=12487.0 Quote Link to comment Share on other sites More sharing options...
YoungGold Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! lol it would be so damn annoying especially if you get lots of things sold or lots of attacks that day every day you login you would have like 2+ events i know i doesnt sound like much but if you went on holiday you would ahve tones or events and otnes of mails to deal with. and dj r ill cehck it out but not promising nout as im very busy. Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! ok cheers mate Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! lol it would be so damn annoying especially if you get lots of things sold or lots of attacks that day every day you login you would have like 2+ events i know i doesnt sound like much but if you went on holiday you would ahve tones or events and otnes of mails to deal with. My point exactly. if not can you have a look of that please http://criminalexistence.com/ceforums/i ... ic=12487.0 I dont do Email Validation codes. And a thankyou would be nice for taking my time to do that code for you man Quote Link to comment Share on other sites More sharing options...
DJ Rankin Posted August 17, 2007 Author Share Posted August 17, 2007 Re: HOUSE TAX!!!! thanks Quote Link to comment Share on other sites More sharing options...
CraigF Posted August 17, 2007 Share Posted August 17, 2007 Re: HOUSE TAX!!!! haha thats alright man Quote Link to comment Share on other sites More sharing options...
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.