Jump to content
MakeWebGames

Nuclearbomb.php help


Jesse60905

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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