• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Bounty hunters.php

Kurre Kurrson

New Member
Joined
Aug 11, 2010
Messages
125
Reaction score
3
Hello as I am not that good in dealing with php and websites overall I got a question for you guys. The server I downloaded had an "working" bounty system already but now I wanted to add a page on my website so I can see all the "offers". So I am running znote aac 1,4. Does this code work with this aac and if so could you see what is wrong with it?
Code:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>

<?php
@mysql_connect("localhost","user","password");
@mysql_select_db("name");

$main_content .= '<P ALIGN=CENTER>
    <br>
    <FONT SIZE=5 COLOR=#CFF00C>
        How to use...
    </FONT>
    <br>
    <br>
    <FONT SIZE=2 COLOR=#CFF00C>
    * !hunt [prize],[nick] :
        <FONT SIZE=1 COLOR=#FCC33F>
            Wysyla ogloszenie o huncie dla postaci. Cena w tysiacach.<br>
            Przyklad: !hunt 100,Infinity
        </FONT><br>
    </FONT>
</P>
<br>
<br>
    <center>
        <h1>
            Bounty Hunters
        </h1>
    </center>
        <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
            <TR BGCOLOR="#505050">
                <TD CLASS=white width=30%>
                    <center><B>Zlecil</B></center>
                </TD>
                <TD CLASS=white width=30%>
                    <center><B>Nagroda</B></center>
                </TD>
                <TD CLASS=white width=30%>
                    <center><B>Ofiara</B></center>
                </TD>
                <TD CLASS=white width=10%>
                    <center><B>Zabity przez</B></center>
                </TD>
            </TR>';
$inv = @mysql_query("SELECT * FROM `bounty_hunters` ORDER BY `added` DESC");
$num = 0;
$color=$config['site']['darkborder'];
while($tab = @mysql_fetch_array($inv)){
if($num%2 == 0){$color=$config['site']['darkborder'];}else{$color=$config['site']['lightborder'];}
$pid = $tab['fp_id'];
$sid = $tab['sp_id'];
$kid = $tab['k_id'];
$killed = $tab['killed'];
$prize = $tab['prize']*1000;
if($killed == 0){
$kill = '<font color="red">Nobody!</font>';
}else{
$k = @mysql_query("SELECT * FROM `players` WHERE `id` = ".$kid."");
$k1 = @mysql_fetch_array($k);
$kill_name = $k1['name'];
$kill = '<a href="index.php?subtopic=characters&name='.$kill_name.'">'.$kill_name.'</a>';
}
$f = @mysql_query("SELECT * FROM `players` WHERE `id` = ".$pid."");
$f1 = @mysql_fetch_array($f);
$s = @mysql_query("SELECT * FROM `players` WHERE `id` = ".$sid."");
$s1 = @mysql_fetch_array($s);
$fn = $f1['name'];
$sn = $s1['name'];

$main_content .= '
        <TR BGCOLOR="'.$color.'">
            <TD>
                <center>
                    <b>
                        <a href="index.php?subtopic=characters&name='.$fn.'">'.$fn.'</a>
                    </b>
                </center>
            </TD>
            <TD>
                <center>
                    <b>
                        '.$prize.' gp
                    </b>
                </center>
            </TD>
            <TD>
                <center>
                    <b>
                        <a href="index.php?subtopic=characters&name='.$sn.'">'.$sn.'</a>
                    </b>
                </center>
            </TD>
            <TD>
                <center>
                    <b>
                        '.$kill.'
                    </b>
                </center>
            </TD>
        </TR>';
$num++;
}
if($num == 0){
        $main_content.='<TR BGCOLOR="'.$color.'">
            <TD colspan=4>
                <center>
                    Currently there are not any bounty hunter offer.
                </center>
            </TD>
        </TR>';
}
        $main_content .='</TABLE><div align="right">Copyright &copy; <a href="http://otibia.net">oTibia.net</a>.</div>';
?>

<?php include 'layout/overall/footer.php'; ?>


Yes I have changed the things in the top of the code to my login to my database etc but the page shows nothing. Go here to see : http://infernus.servegame.com/bounty-hunters.php

Thanks in advance/ Simon
 
Last edited:
Where did you get this from? did it come with the server? It looks like it should work. There are some MySQL queries in there, do you have the tables in your DB?
 
Well I already have an "working" bounty hunter system in-game, I just needed some code for my website to see every1 being "hunted". I just searched for bounty hunters and found this code with some querys which I did execute so they are in my database, I think its something wrong with the code as I just get a white page, which means theres something wrong in the php code if I am not wrong.
 
Well this was published in 2009 and Znote's AAC is a lot newer. There probably is something missing, did you do everything mentioned in the thread?
 
Not sure what you mean with that, but Ive copied one of my other -php files, erased everything in the middle (to make sure it looks like the rest of the pages,header etc)

SOLVED - PM ME IF U NEED HELP
 
Yeah thats exactly what I did from the beginning. Found another piece of code and it works now, I think ill share my edited code later on for people to use :)
 
Did you have any luck at all?

I am using the same piece of code, but receive this error;

Notice: Undefined variable: main_content in C:\xampp\htdocs\bounty-hunters.php on line 41

Notice: Undefined variable: config in C:\xampp\htdocs\bounty-hunters.php on line 44

Any help is much appreciated! Also using Znote
 
Did you have any luck at all?

I am using the same piece of code, but receive this error;

Notice: Undefined variable: main_content in C:\xampp\htdocs\bounty-hunters.php on line 41

Notice: Undefined variable: config in C:\xampp\htdocs\bounty-hunters.php on line 44

Any help is much appreciated! Also using Znote

Same here, please help us / me. I want that bounty hunter system for my website so much!

Thank you Guys ;)
 
Back
Top Bottom