kirbyweb Posted November 10, 2009 Report Share Posted November 10, 2009 In this header I am going to show you, how do I make it so I can equip a weapon or item. <?phpclass headers {function startheaders() {global $ir, $set;echo <<<EOF<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>{$set['game_name']}</title><style type="text/css"><!--body {background-color: #000000;background-image:url();margin-top: 0px;margin-bottom: 0px;font-family:Palatino Linotype;font-size:12px;color: white; scrollbar-base-color: white; scrollbar-arrow-color: black; scrollbar-DarkShadow-Color: black;}a:visited,a:active,a:link { color:#F5D04C;text-decoration: none; }a:hover { color: silver;text-decoration: overline underline;background: none; }table,tr,td { font-family:Palatino Linotype;font-size: 12px; }.button{font-family:Palatino Linotype;font-size:16;color:#000000;background-color: black;}input,textarea,dropdown{font-family:Palatino Linotype;font-size:12;color:#000000;background-color: white;}..submit{font-family:Palatino Linotype;font-size:12;color:#000000;background-color: white;}img { border:none; }textarea { font-family:Palatino Linotype;font-size:12px;color: black; }.table2 {}.lgrad {background-color:#000000background-repeat:repeat-y;width:19px;}.linegrad {background-color:#000000background-repeat:repeat-y;background-align: center;width:2px;}.rgrad {background-color:#000000background-repeat:repeat-y;width:19px;}.dgrad {background-color:#000000background-repeat:repeat-x;height:38px;}.dgradl {background-color:#000000background-repeat:no-repeat;height:38px;width:38px;}.dgradr {background-color:#000000background-repeat:no-repeat;height:38px;width:38px;}.center {width:932px;// background-color:#000000;background-color:#000000;vertical-align:top;text-align:center;}.table {background-color:#000000;}.table3 {background-color:#000000;}.table td {background-color:#000000;height:22px;}.table3 td {background-color:#000000;}td .alt {background-color:#000000;height:22px;}td .h {background-image:url();background-repeat:repeat-x;font-weight: bold;background-color: #000000;}.table th {background-image:url();background-repeat:repeat-x;font-weight: bold;background-color: #000000;}--></style></head><body><center><table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"><tr><td class="lgrad"></td><td class="center">EOF;}function userdata($ir,$lv,$fm,$cm,$dosessh=1){global $db,$c,$userid, $set;$IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];$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 help@{$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 src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; } $gn="";global $staffpage;$bgcolor = '#000000';print <<<OUT<img src="//Add your top banner url here" alt="Godfather" /><br /><size=12><u><a href='donator.php'>Donate To Game For Game Benefits</a></u></size><br /><!-- Begin Main Content --><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="20%" bgcolor="#030303" valign="top"><!-- Side Panel --><b>Name:</b> $gn{$u} [{$ir['userid']}] $d<br /><b>Money:</b> {$fm}<br /><b>Level:</b> {$ir['level']}<br /><b>Crystals:</b> {$ir['crystals']}<br />[<a href='logout.php'>Emergency Logout</a>][<a href='voting.php'>Vote</a>]<hr /><b>Energy:</b> {$enperc}%<br /><img src=greenbar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10><br /><b>Will:</b> {$wiperc}%<br /><img src=bluebar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10><br /><b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}<br /><img src=yellowbar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10><br /><b>EXP:</b> {$experc}%<br /><img src=navybar.png width=$experc height=10><img src=redbar.png width=$exopp height=10><br /><b>Health:</b> {$hpperc}%<br /><img src=greenbar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10><br /><hr /><!-- Links -->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).<br />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 = '#000000';print '</td><td width="2" class="linegrad" bgcolor="#B03060'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><br /><center>';if($ir['hospital']){ print "<b>NB:</b> You are currently in hospital for {$ir['hospital']} minutes.<br />";}if($ir['jail']){ print "<b>NB:</b> You are currently in jail for {$ir['jail']} minutes.<br />";}}function smenuarea(){include "smenu.php";global $ir,$c;$bgcolor ='#000000';print '</td><td width="2" class="linegrad" bgcolor="#000000'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>';}function endpage(){global $db;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"> </td><td class="dgradr"> </td></tr></table></td></tr></table>{$db->num_queries} queries</body></html>OUT;}}?> Please help thanks. Link to comment Share on other sites More sharing options...
Synook Posted November 10, 2009 Report Share Posted November 10, 2009 Err, do you have any specific problems? Link to comment Share on other sites More sharing options...
kirbyweb Posted November 10, 2009 Author Report Share Posted November 10, 2009 Just want to know how I can make it so someone can equip a weapon. Link to comment Share on other sites More sharing options...
Ingolme Posted November 10, 2009 Report Share Posted November 10, 2009 You're working with totally abstract concepts. Only you can decide how to make it work.You could add a weapon property, or some kind of addWeapon() method that puts some kind of weapon object into an array or private property.I order to understand object-oriented programming you first need to understand the concept of abstraction. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now