Jump to content
MakeWebGames

Header and Mission mod


Oo-Savage-oO

Recommended Posts

I added this bit of code snippet to the header to make missions mod but now it isnt working I tried everything but it doesnt work

Here is my header

<?php
header('X-UA-Compatible: IE=EmulateIE8');
ob_start ("ob_gzhandler");
header("Cache-Control: must-revalidate");

$count = 3;
$x = -1;
while($x < $count)
{
$security = array("ID","viewforum","viewtopic");
$x++;
$_GET[$security[$x]] = abs(@intval($_GET[$security[$x]]));
}

class headers {
function startheaders() {
global $ir, $set;
echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{$set['game_name']}</title>
<meta http-equiv="content-language" content="en"/>
<meta name="Distribution" content="Global"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> 
<link rel="stylesheet" type="text/css" href="custom.css" />
</head>
<body>
<center>
<table width="970" border="0" cellpadding="0" cellspacing="0" class="table2">
<tr>
<td class="lgrad"></td>
<td class="center">
<style type="text/css">
img { border: none; } 
</style>
EOF;
}
function userdata($ir,$lv,$fm,$cm,$dosessh=1)
{
global $db,$c,$userid, $set;
$IP = $_SERVER['REMOTE_ADDR'];
$IP = mysql_real_escape_string($IP);
$IP = $db->escape($IP);

$db->query("UPDATE users 
SET laston=unix_timestamp(),
lastip='$IP' WHERE userid=$userid");

if(!$ir['email'])
{
global $domain;
die (" <body>
Your account may be broken. 
Please mail support@{$domain} 
stating your username and player ID.");
}
if($dosessh && ($_SESSION['attacking'] || $ir['attacking']))
{

print "
You lost all your EXP for running from the fight.";

$db->query("UPDATE users 
SET exp=0,
attacking=0 
WHERE userid=$userid");

$_SESSION['attacking']=0;
}
$enperc=(int) ($ir['energy']/$ir['maxenergy']*100);
$wiperc=(int) ($ir['will']/$ir['maxwill']*100);
$experc=(int) ( $ir['exp']/$ir['exp_needed']*100);
$brperc=(int) ($ir['brave']/$ir['maxbrave']*100);
$hpperc=(int) ($ir['hp']/$ir['maxhp']*100);
$enopp=100-$enperc;
$wiopp=100-$wiperc;
$exopp=100-$experc;
$bropp=100-$brperc;
$hpopp=100-$hpperc;
$d="";
$u=$ir['username'];
if($ir['donatordays']) { $u = "
<font color=red>{$ir['username']}</font>
";$d="[img=donator.gif]"; 
}

$gn=""; 
global $staffpage;
$bgcolor = '999999';
if($ir['mission'] != 0)
{
$mq=mysql_query("SELECT * FROM missions WHERE id=".$ir['mission']."",$c);
if(mysql_num_rows($mq)== 0)
{
mysql_query("UPDATE users SET mission=0 WHERE userid=".$userid."",$c);
}
$rm=mysql_fetch_array($mq);
if($rm['location_on']== 1)
{
if($rm['location_value'] != $ir['location'])
{ mysql_query("UPDATE users SET mission=0 WHERE userid=".$userid."",$c);
event_add($ir['userid'],"Your mission has been ended because you have moved city.",$c);
}
}
if($rm['item_on']== 1 && $rm['attack_on']== 0)
{
$invq=mysql_query("SELECT * FROM inventory WHERE inv_userid=".$userid." AND inv_itemid=".$rm['item_value']."",$c);
if(mysql_num_rows($invq))
{ 
$exp=rand($ir['level'],$ir['level']*5);
mysql_query("UPDATE users SET mission=0, money=money+".$rm['money'].", crystals=crystals+".$rm['crystals'].", exp=exp+".$exp.", mission_counter=mission_counter+'1' WHERE userid=".$userid."",$c);
$mission=($ir['mission']);
mysql_query("INSERT INTO missdone VALUES ($userid,$mission);",$c);
mysql_query("DELETE FROM inventory WHERE inv_userid=$userid AND inv_itemid=".$rm['item_value']."",$c);
event_add($ir['userid'],"You have completed the mission and you was credited your reward.",$c);
}
}
if($rm['item_on']== 0 && $rm['attack_on']== 0)
{
mysql_query("UPDATE users SET mission=0 WHERE userid=".$userid."",$c);
$owner=1;
event_add($owner,"The mission $rm[name] mission ($rm[id]) is not set to a mission, Please do so.",$c);
}
if($rm['item_on']== 0 && $rm['attack_on']== 1)
{

$usa=$_SESSION['mission_attack'];
$aa=mysql_query("SELECT * FROM missions WHERE id=".$ir['mission']." AND attack_value=".$_SESSION['mission_attack']."",$c);
if(mysql_num_rows($aa))
?{
?$exp=rand($ir['level'],$ir['level']*10);
mysql_query("UPDATE users SET mission=0, money=money+".$rm['money'].", crystals=crystals+".$rm['crystals'].", exp=exp+".$exp.", mission_counter=mission_counter+'1' WHERE userid=".$userid."",$c);
$mission=($ir['mission']);
mysql_query("INSERT INTO missdone VALUES ($userid,$mission);",$c);
event_add($ir['userid'],"You have completed the mission and you was credited your reward.",$c);
}
}



//Display Pic 

$display_pic = $ir['display_pic'];
if(!$display_pic) {
$display_pic="/images/noav.png";
}
print <<<OUT



<div id="hd">
<div class="hd_displaypic">[img=$display_pic]</div>
<div class="hd_username">
[b]Name:[/b]
[url="viewuser.php?u={$ir['userid']}"] $gn{$u} [{$ir['userid']}] $d[/url]
</div></div>
<ul id="menu">
[*][url="index.php"]Home[/url]
[*][url="inventory.php"]Inventory[/url]
[*][url="explore.php"]City[/url]
[*][url="viewuser.php?u={$ir['userid']}"]Profile[/url]
[*][url="bank.php"]Bank[/url]
[*][url="gym.php"]Gym[/url]
[*][url="bank.php"]Test[/url]
[*][url="gym.php"]Test[/url]
[*][url="logout.php"]Logout[/url]
[/list]

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%" bgcolor="#$bgcolor" valign="top" align="left" style="padding-left:10px;">

<span class='icons1' style='padding-left:24px;'></span>[b]Money:[/b] {$fm}

<span class='icons2' style='padding-left:24px;'></span>[b]Level:[/b] {$ir['level']}

<span class='icons3' style='padding-left:24px;'></span>[b]Crystals:[/b] {$ir['crystals']}
<hr />
<div class="stat_bars">
<div>[b]Energy:[/b]</div> 
<a href="#" class="Tooltip"><span>Current Energy:{$enperc}%</span>
<img src=images/bar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10></a>

</div>
<div class="stat_bars">
<div>[b]Will:[/b]</div> 
[url="#"]<span>Current Will: {$wiperc}%</span><img src=images/bar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10>[/url]

</div>
<div class="stat_bars">
<div>[b]Brave:[/b]</div> 
[url="#"]<span>Current Brave: {$ir['brave']}/{$ir['maxbrave']}</span><img src=images/bar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10>[/url]

</div>
<div class="stat_bars">
<div>[b]EXP:[/b]</div>
[url="#"]<span>Current EXP: {$experc}%</span><img src=images/bar.png width=$experc height=10><img src=redbar.png width=$exopp height=10>[/url]

</div>
<div class="stat_bars">
<div>[b]Health:[/b]</div> 
[url="#"]<span>Current Health: {$hpperc}%</span><img src=images/bar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10>[/url]

</div>
<hr />

OUT;
if($ir['fedjail'])
{
$q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid");
$r=$db->fetch_row($q);
die("
[b] <font color=red size=+1>
You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).

Reason: {$r['fed_reason']}</font>[/b]</body></html>");
}
if(file_exists('ipbans/'.$IP))
{
die(" [b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, 
there is no way around this.</font>[/b]</body></html>");
}
}
function menuarea()
{
include "mainmenu.php";
global $ir,$c;
$bgcolor = '999999';
print ' 
</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td>
<td width="80%" bgcolor="#'.$bgcolor.'" valign="top">
<center>';
if($ir['hospital'])
{
print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes.
";
}
if($ir['jail'])
{
print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes.
";
}
print "[url='donator.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url]
";
}
function smenuarea()
{
include "smenu.php";
global $ir,$c;
$bgcolor = 'FFFFFF';
print ' 
</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td>
<td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>';
}
function endpage()
{
global $db;

//Shows useronline & Total Users

$q=$db->query(" SELECT userid FROM users 
WHERE laston>unix_timestamp()-100*60 
ORDER BY laston DESC");
$r1=$db->num_rows($q);
$q=$db->query("SELECT userid FROM users");
$r2=$db->num_rows($q);

print <<<OUT
</center>

</td></tr></table>
</td><td class="rgrad"></td>
</tr><tr><td colspan="3">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="dgradl"></td>
<td class="dgrad" align="center">Total Users [url="userlist.php"]$r2[/url] | Users Online [url="usersonline.php"]$r1[/url] </td>
<td class="dgradr"></td>
</tr></table>
</td></tr></table>
</body>
</html>
OUT;
}
}
?>

 

This is the error

 

Parse error:  syntax error, unexpected '{' in /home/mafiacou/public_html/header.php on line 133

 

Please help!!!!

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