Jump to content
MakeWebGames

War_Hero

Members
  • Posts

    232
  • Joined

  • Last visited

Everything posted by War_Hero

  1. Re: [MOD] V2 Fight the good Fight I like this idea. I may try it out because then I can edit the attack script again to include a suggestion by one of the users on my brother's game. :) Thanks for this. :)
  2. Re: [mccode] Killing License   I believe this would update everyone's hospital time, if they are in hospital. I think it should be:   $db->query("UPDATE users SET hospital = hospital - 1 WHERE hospital > 0 AND userid = $userid");   :)
  3. Re: [V2] Upgraded Brothel You could try this: <?php include "globals.php"; $price = 50; //The price of the hoes $cashfh = $price * 100; //The total cash your hoes earn a day and give to you print "<h3>Brothel</h3> [i]Sign up to the brothel with your bought hoes and gain some money each day.[/i] [b]You currenltly have {$ir['hoes']} Meaning you earn {$cashfh} a day!"; switch($_GET['action']) { case "join": join(); break; case "joinconfirm": joinconfirm(); break; case "leave": leave(); break; case "buy": buy(); break; case "buyhoes": buyhoes(); break; case "buyconfirm": buyconfirm(); break; default: index(); break; } function index() { global $db, $ir,$c,$userid,$h; print "[url='.$_SERVER[']Join brothel And Buy Hoes[/url] [url='.$_SERVER[']Buy Extra Hoes[/url] [url='.$_SERVER[']Leave and loose all your hoes[/url] "; } function join() { global $db, $ir,$c,$userid,$h; print "So, you would like to join the brothel and buy some hoes? It costs [b]FREE[/b] to sign up and \$5000 for each hoe. From each hoe you gain \$100 a day [b]How many hoes would you like to buy? You need 1 To Join![/b] <form action='.$_SERVER['PHP_SELF'].'?action=buyconfirm' method='post'> <input type=text name=hoes> <input type=submit value=submit> </form> "; } function joinconfirm() { global $db, $ir,$c,$userid,$h; print "We have now taken your cash and you have now joined"; $db->query('UPDATE `users` SET money = money - $price WHERE userid = $userid'); $db->query('UPDATE `users` SET brotheljoin = 1 WHERE userd = $userid')"; } function buy() { global $db, $ir,$c,$userid,$h; print 'You can only buy one hoe a day, So would you like to buy a hoe today? [url='.$_SERVER[']Buy your hoe ($5000)[/url] '; } function buyhoes() { global $db, $ir,$c,$userid,$h; print 'Buying A Hoe "; if($ir['money'] < '2000') { print "<font color=red>Error!</font> You dont have enough for the hoe you need 2000 dollars [url='index.php']Back Home[/url] "; } if($ir['money'] > '1999') { print "<font color=green>Success!</font> You buy a hoe for 2000 Dollars"; $db->query('UPDATE users SET money = money - 2000 WHERE userid = $userid'); $db->query('UPDATE users SET hoesbuy = 1 WHERE userid = $userid'); $db->query('UPDATE `users` SET money = money + totalhoes * 100 WHERE userid = $userid')"; } if($ir['hoesbuy'] == 1) { print '<font color=red>Error!</font> You have already bought a hoe today!'; } function leave() { global $db, $ir,$c,$userid,$h; echo 'Leaving Brothel "; if($ir['brotheljoin'] == '0') { print "<font color=red>Error!</font> You are not joined in the brothel [url='index.php']Back Home[/url] "; } if($ir['brotheljoin'] == '1') { print "<font color=green>Success!</font> You leave the brothel and you get rid of all your hoes"; $db->query('UPDATE users SET totalhoes = 0 WHERE userid = $userid'); $db->query('UPDATE users SET brotheljoin = 0 WHERE userid = $userid')"; } $h->endpage(); ?>   I'm tired, so there's probably something wrong in there. :-P
  4. Re: [mccode] Killing License I take it you're using the one I posted? Also, please post the error here, if you're getting one. :)
  5. Re: [V2] Upgraded Brothel No, I haven't. I'm using my crappy computer, so the database goes really slow and everything. It get's really annoying. If I get round to it, I'll test it for you. :)
  6. Re: [V2] Upgraded Brothel No problem mate. I do that sometimes. I sometimes forget the names of my functions, especially when I've got a lot of them. So I just go back and double check. :)
  7. Re: [V2] Upgraded Brothel Excellent work mate! It looks good. I believe I spotted one simple error though: you have function joinconfirm() instead of function buyconfirm(). But other than that, good work. :) Keep it up mate. :-D
  8. Re: [mccode] Killing License   The one I posted is V2. :) So it should work.
  9. Re: [MCcodes All] Staff Members cannot be attacked.   I agree with you there mate. All the other staff on my brother's game play the game properly, so it would be unfair if they can not be attacked, yet they can attack... :-P
  10. Re: [mccode] Killing License Try this:   <?php /*----------------------------------------------------- -- sniko` -- killinglicence.php -----------------------------------------------------*/ require "globals.php"; print "<h3>Killing License</h3>"; switch($_GET['action']) { case 'buy': buy(); break; default: index(); break; } function index() { global $db,$ir,$userid; $price = 300; print "[<a href=killinglicence.php?action=buy'>Buy A Killing License</a>] [i]Killing Licenses Are So You Can Kill Others! It will cost $t".money_formatter($price)." to buy one.[/i]"; } function buy() { global $db,$ir,$userid; $price = 300; if($ir['money'] < $price) { die("You don't have enough money."); } else { print "You Successfully Bought One!"; $db->query("UPDATE users set hospital=hospital-1 WHERE hospital>0"); $db->query("UPDATE users SET killinglicense=1 WHERE userid=$userid"); $db->query("UPDATE users SET money = money - $price WHERE userid = $userid"); } } $h->endpage(); ?>   To edit the price, just change the $price = 300; to whatever you want. :)
  11. Re: [MCcodes All] Staff Members cannot be attacked. :) On my brother's game, we have it so myself and him can't be attacked, so we can test new mods, sort out player issues, etc. We've also made it so we get an event if someone tries to attack us. :-P lol
  12. Re: {Any Version} Staff Members cannot be attacked. I'm not sure if this would work, as your IF statement is basically saying that if the user's ID who's being attacked is less than 1, then they can't be attacked. I think something more on the lines of elseif($r['user_level'] >= 2) { print "You can't attack staff members. <a href = 'index.php' />Back</a>"; $h->endpage(); exit; }   would do the trick. ;) Or is the $r supposed to be $odata? I don't know, as I don't have the attack script open. :-P lol But good effort. :)
  13. Re: Black List - Remove Query error   Change the fl_ADDER to bl_ADDER. See if that works. :)
  14. Re: MailBox Problem You might get some help if you post the area of code that you're having trouble with. :)
  15. Re: [request] Userlist Ohhh. In which case, this is what you'd have:   $sql = $db->query("SELECT * FROM `users` WHERE `clubakbuyin` >= 1"); print "<table width = '75%' cellspacing = '1' class = 'table' /> <tr /> <th />User Name</th> <th />Level</th> </tr>"; while($r = $db->fetch_row($sql)) { print "<tr /> <td />{$r['username']}<td> <td />{$r['level']}</td> </tr> </table>"; }   or something on those lines. I've sent you a message with my email. ;)
  16. Re: [request] Userlist Well, I think you'd have it so that when a user does join, it will enter their name in the new 'user list' table. Then have a query selecting all data from that table to show who's in the club. :) $sql = $db->query("SELECT * FROM `tablename`") <table width = '75%' celllspacing = '1' class = 'table' /> <tr /> <th />User Name</th> <th />User Level</th> </tr>";   Then to output it while($r = $db->fetch_row($sql)) { print "<tr /> <td />{$r['clubuserNAME']}</td> <td />{$r['clubuserLEVEL']}</td> </table>"; } or something like that. :)
  17. Re: [V LITE] Killing License Try this:   <?php /*----------------------------------------------------- -- sniko` -- killinglicence.php -----------------------------------------------------*/ require "globals.php"; print "<h3>Killing License</h3>"; switch($_GET['action']) { case 'buy': buy(); break; default: index(); break; } function index() { global $db,$ir,$userid; print "[<a href=killinglicence.php?action=buy'>Buy A Killing License</a>] [i]Killing Licenses Are So You Can Kill Others![/i]"; } function buy() { global $db,$ir,$userid; print "You Successfully Bought One!"; $db->query("UPDATE users set hospital=hospital-1 WHERE hospital>0"); $db->query("UPDATE users ADD killinglicense=1 WHERE userid=$userid"); } $h->endpage(); ?>   This is for V2. :)
  18. Re: [MOD] V2 Freeze & Reactivate a Users Bank Account Great mod mate. :) As for why you'd freeze their bank account: possibly as a punishment? Say, if the user is constantly breaking the rules or something, they would have their bank account frozen so they can't access it. Then, once they learn, it would be unfrozen. Just an idea off the top of my head. :-P
  19. Re: Time What a complete idiot I am! :-P I went to approach it the hard way. I tend to do that. I'll use the code from the Hospital Time mod. :) I'll add in tomorrow, as it's late now. lol Thanks for the link ImMorTal X. :)
  20. In this mod that I'm making, a field in the users table is set really high, sometimes to over 4000 minutes. I'm having it so that the user can see how long left they have to wait for their gym to be constructed. However, I don't really want it to say "You have 3856 minutes left". :-P So, how would I have it so that it would output: "You have ? Days, ? Hours and ? Minutes left.". Would this involve UNIX timestamps? If so, I'm not much good with them. :-P Any help is highly appreciated.
  21. Re: Inventory help Lol. Thanks again. :) Now I can finally finish off this mod. :-D lol
  22. Re: Inventory help Thank you so very much!!! It works a treat. I just had to change a ivn to an inv and one other thing. :) Thank you very much for helping me out. I will remember and practice this for when I need it again.
  23. Re: Inventory help Thank you. Unfortunately, it still doesn't work. I get this: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /usr/home/*********/domains/*******/public_html/class/class_db_mysql.php on line 71 You have bricks, but you don't have enough. Go here to buy some. I'm still getting the DIE() statement. :( Why is this so hard!? :-P
  24. Re: Inventory help It's in a nested IF statement:   elseif($ir['gymsize'] == 32) { if($db->num_rows($query) <= 0) { die("You don't have any bricks to build your gym. Go <a href = 'buildgym.php?action=buybricks' />here</a> to buy some."); } elseif($r['inv_qty'] < $db_config['gym1bricks']) { die("You have bricks, but you don't have enough. Go <a href = 'buildgym.php?action=buybricks' />here</a> to buy some."); } elseif($db->num_rows($query2) <= 0) { die("You don't have any cement to build your gym. Go <a href = 'buildgym.php?action=buycement' />here</a> to buy some."); } elseif($m['inv_qty'] < $db_config['gym1cement']) { die("You have cement, but you don't have enough. Go <a href = 'buildgym.php?action=buycement' />here</a> to buy some."); } elseif(($db->num_rows($query) <= 0) AND ($db->num_rows($query2) <= 0)) { die("You don't have any bricks or cement to build your gym. Go <a href = 'buildgym.php?action=buybricks' />here</a> to buy bricks, and <a href = 'buildgym.php?action=buycement' />here</a> to buy cement."); } else { $build1 = sprintf("UPDATE `users` SET `buildtime` = '%d', `gymbuilt` = '%d' WHERE `userid` = ('%u')", $db_config['buildtime1'], 1, $userid); $db->query($build1); item_remove($userid, 107, $db_config['gym1bricks']); item_remove($userid, 108, $db_config['gym1cement']); print "You have now started work on your gym. It will be completed in {$db_config['buildtime1']} minutes. <font color = 'red' /><b />NOTE: You can <u />NOT</u> change anything now, or cancel the construction of your gym.[/b]</font> You will be able to access all other areas of Global Conflict 2250 during the construction of your gym. <a href = 'index.php' />Click Here</a> to go home."; } }   But I can't see anything wrong with that...so it may be my SELECT query.
  25. Re: Inventory help Thank you for your suggestion. Unfortunately, it still doesn't work. :( I've tried numerous things, but they haven't worked......
×
×
  • Create New...