erm.. i already said i couldn't fix it... so trying again when i spent a whole week on it wont help, hense why i asked after a week trying if anyone has a copy of this.
i've been working on a little addon so that it shows the last page the user is on.
i used this code
global $db,$ir;
$db->query("UPDATE users SET lastpage='Users Online' WHERE userid=$userid");
but this means i'll have to put it on every page :( which will take forever.
so with that in mind i decided to put this code below in header.php
global $db,$ir;
$db->query("UPDATE users SET lastpage='".$_SERVER['PHP_SELF']."' WHERE userid=$userid");
Which works might i say but there is a little snag with it,
the first code is displays like this "Users Online" but using the PHP self code it comes out like this "/game/usersonline.php".
Is there a way to use the PHP SELF code but not display the whole link, but instead just the page that the user is on,
Thanks for any replys or help on this.
hi,
I'm trying to add Weapon Power into a page but the code for some reason does not work,
as i'm still learning it could be tottally wrong,
heres the code
$p=$db->query("SELECT * FROM items WHERE itmid IN({$ir['weapon']})");
while($h=$db->fetch_row($p))
{
$equip[$r['itmid']]=$h;
}
the table is items and the query is called weapon,
thanks
and which lines to i need to remove so it dont require a code,
the config code thing stops fuctions from working :(
Reason is i've made the banking in the side menu,
you need the code for the page to work, but once it comes up it works, the problem is when you deposit or withdraw it uses a withdraw function,
I've tried to take the config code out but it didnt work, any help would be a great help
having the player info tabbed is alot better due to the fact it updates the info on the stats quicker, only problem is i dont know how to get the links in the iframe to load on the main page :s
i tried target='_blank' but that dont seem to work :s
oh, well that was the idea, cos i was wanting something like, go mining and get minerals like iron, copper, tin etc to be able upgrade the weapons,
but i cant do this, my knowledge of php aint that good yetm i'm still learning as of yet
and what would the database access for the Items be,
i'm trying to put weapon,secondary weapons and armour into a seprate page but i dont know the database access.
thanks
on attack php, you can change the attack units,
Default it /2 which is 50%
i've changed mine into /5 which is 20 Energy
, is there a way that it can only just use one attack
though something like this would work but i'm not sure now,
print "<table width=100%><tr><td colspan=2 align=center>";
if($_GET['wepid'])
{
if($_SESSION['attacking']==0 && $ir['attacking'] == 0)
{
if ($youdata['energy'] >= $youdata['maxenergy']/10000)
{
$db->query("UPDATE users SET energy=energy-1 WHERE userid=$userid");
$_SESSION['attacklog']="";
$_SESSION['attackdmg']=0;
}
else
{
print "You can only attack someone when you have 1 energy";
$h->endpage();
exit;
this wont work i beleive, but is it possible and how would i go about doing this?
that sucks, well i'll have to leave it to you anyway,
i've tried loads of ideas, the only one i got to work was include "globals.php" which is ovious lol.