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

Gesior status online

545658

Member
Joined
Nov 6, 2016
Messages
24
Reaction score
5
Is anyone able to rewrite this code for me to count all online players who are on the server active and those afk, exit? currently it only takes those players who are active.

PHP:
<?PHP
                if($config['status']['serverStatus_online'] == 1)
                    echo'<img class="Online" src="https://xxx.eu/layouts/xxx/images/online.png" alt="" style="display: block;">
                
                <div class="Players">
                    '.$config['status']['serverStatus_players'].' / '.$config['status']['serverStatus_playersMax'].'
                </div>
                <div class="Uptime">
                    '.$config['status']['serverStatus_uptime'].'
                </div>';
                else
                    echo '
                    <img class="Offline" src="https://xxx.eu/layouts/xxx/images/offline.png" alt="" style="display: block;">
                <div class="Players">
                    0
                </div>
                <div class="Uptime">
                    0h 0m
                </div>';
                ?>
 

Attachments

You must ensure that $config['status']['serverStatus_players'] and $config['status']['serverStatus_playersMax'] are getting the correct values. To do this, you can temporarily add the following code right before the if:
Lua:
<?php
    var_dump($config);
?>
 
You must ensure that $config['status']['serverStatus_players'] and $config['status']['serverStatus_playersMax'] are getting the correct values. To do this, you can temporarily add the following code right before the if:
Lua:
<?php
    var_dump($config);
?>
im done
 
Last edited:
Back
Top