• 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!

Problems with website

thokk

New Member
Joined
Apr 7, 2014
Messages
4
Reaction score
0
Hello everybody, im working in a old school project (7.6)
I'm using Avesta. (Avesta 063) that i found here on the forum.
My problem is:

As you all can see in my website (http://138.117.218.67:8090), the counter always show '0 players online'; i saw a lot of solutions in google and otland but i can't found a good way to resolve it ):

This guy:
https://otland.net/threads/avesta-status-problem.210911/

Had the SAME PROBLEM.. But the answer from znote is not useful for me.. i really don't know what i have to do with this... I don't know how to create a globalaction in my OT 'cause i don't have the globalaction.xml in there.. btw i don't know about creaturescript.. i tried, but, without sucess

I can send for you all screenshots and any kind of material you need to help me

Really thanks for who can help me in this little issue!
And sorry for my bad english :)
 
Your website content should have an onlinelist.php file.
Can you post the contents here?
 
Sorry for taking too long to answer.. I'm still with the problem.. I was on duty and can't log in forum. Well.. this is my onlinelist.php.. I'll be glad if someone can help me :)
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>

<h1>Players Online</h1>
<?php
$array = online_list();
if ($array) {
   ?>
  
<?php if (user_count_online() == 1) {
   echo "<i><b>Total of "; echo user_count_online(); echo " player are currently playing at our server.</b></i><br>";
}
else {
   echo "<i><b>Total of "; echo user_count_online(); echo " players are currently playing at our server.</b></i><br>";
}
?>  
  
   <table id="onlinelistTable" class="table table-striped table-hover">
     <tr class="yellow">
       <th>Name:</th>
       <th>Level:</th>
       <th>Vocation:</th>
     </tr>
       <?php
       foreach ($array as $value) {
       echo '<tr>';
       echo '<td><a href="characterprofile.php?name='. $value['name'] .'">'. $value['name'] .'</a></td>';
       echo '<td>'. $value['level'] .'</td>';
       echo '<td>'. vocation_id_to_name($value['vocation']) .'</td>';
       echo '</tr>';
       }
       ?>
   </table>

   <?php
} else {
   echo '<i><b>There is no players online on Tibia World RPG OldSchool Server.</i></b>';
}
?>
<?php include 'layout/overall/footer.php'; ?>

P.s - I tried this:

"If you really want to use the official ZnoteAAC you can change the function to count online players (you will lose support for TFS_02 and TFS_03).

Open engine/function/users.php and find:
PHP:
PHP:
function user_count_online() {
if (config('TFSVersion') == 'TFS_10') {$online = mysql_select_single("SELECT COUNT(`player_id`) AS `value` FROM `players_online`;");
return ($online !== false) ? $online['value'] : 0;
} else {$data = mysql_select_single("SELECT COUNT(`id`) AS `count` from `players` WHERE `online` = 1;");
return ($data !== false) ? $data['count'] : 0;
}
}
Replace with:
PHP:
function user_count_online() {
if (config('TFSVersion') == 'TFS_10') {$online = mysql_select_single("SELECT COUNT(`player_id`) AS `value` FROM `players_online`;");
return ($online !== false) ? $online['value'] : 0;
} else {$data = mysql_select_single("SELECT COUNT(`id`) AS `count` from `players` WHERE `status` = 1;");
return ($data !== false) ? $data['count'] : 0;
}
}"

Then.. i can see the number of players online, but when i click to see the online list or when i search a player to see if he is online, he is offline, and the list says: "There is no players online on Tibia World RPG OldSchool Server."

P.S 2 - In SQL Tables, i have the columm named 'status' and the columm named 'online'. When a player log in, the number 'online' go 0 -> 1. But the number 'status' stay at 0. I f i change manually this number for 1, all works FINE! How can i change it? If 'status' change to 1 automatically, all problems is resolved!

Up!
 
Last edited by a moderator:
Back
Top