Jesse60905 Posted June 29, 2007 Share Posted June 29, 2007 I am having a bit of trouble. When I use a nuclear bomb ll that happens is everyone gets an event. They don't lose health or anything... Nuclearbomb.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); if($ir['user_level'] != 2) { die(""); } print "You have launched the bomb. [b]Jesse60905[/b] is impervious! "; $q=mysql_query("SELECT * FROM users WHERE userid != 1 ORDER BY userid ASC",$c); while($r=mysql_fetch_array($q)) { event_add($r['userid'],"{$ir['username']} has just bombed the entire MC population",$c); print "[b]{$r['username']}[/b] was hit! "; } print "Bomb is successful!"; $h->endpage(); ?> I know I need a query for health but I don't konw where or what query to put in. Quote Link to comment Share on other sites More sharing options...
Jesse60905 Posted July 2, 2007 Author Share Posted July 2, 2007 Re: Nuclearbomb.php help Can someone help me...? I really want to find out how =/ Quote Link to comment Share on other sites More sharing options...
UCC Posted July 2, 2007 Share Posted July 2, 2007 Re: Nuclearbomb.php help If you can't get past the basics, maybe you should give up now. Here's a hint, if you dont know something, look at another piece of code that doesn something similar, and figure it out while($r=mysql_fetch_array($q)) { event_add($r['userid'],"{$ir['username']} has just bombed the entire MC population",$c); $db->query("UPDATE users SET hp = 0, hosp_reason = 'Nuclear Bomb' , hospital = 30"); print "[b]{$r['username']}[/b] was hit! "; } Of course it all depends on exactly you want to happen Quote Link to comment Share on other sites More sharing options...
Jesse60905 Posted July 2, 2007 Author Share Posted July 2, 2007 Re: Nuclearbomb.php help If you can't get past the basics, maybe you should give up now. Here's a hint, if you dont know something, look at another piece of code that doesn something similar, and figure it out while($r=mysql_fetch_array($q)) { event_add($r['userid'],"{$ir['username']} has just bombed the entire MC population",$c); $db->query("UPDATE users SET hp = 0, hosp_reason = 'Nuclear Bomb' , hospital = 30"); print "[b]{$r['username']}[/b] was hit! "; } I already did get past the basics. I am not a great coder but I am currently working on my 3rd minor mod. After that i will be adding more. I have already fixed many bugs but if you want to be a ... then have fun. Of course it all depends on exactly you want to happen 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.