Jump to content

Recommended Posts

Posted

Status:

<?php
    print'<table width="150">';
    $server  = "127.0.0.1";
    $portg   = "7777";
    $portl   = "9014";
    $timeout = "5";

    if ($server and $port and $timeout) {
        $game =  @fsockopen("$server", $portg, $errno, $errstr, $timeout);
        $login =  @fsockopen("$server", $portl, $errno, $errstr, $timeout);
    }
    print'<tr><td align="center"><strong>Server Status</strong></td></tr>';
    if($login) { print'<tr><td>Login:</td><td><font color="#00FF00"><strong> Online</strong></font><br><br></td></tr>'; }
    else { print'<tr><td>Login:</td><td><font color="#FF0000"><strong> Offline</strong></font><br><br></td></tr>'; }
    if($game) { print'<tr><td>Game:</td><td><font color="#00FF00"><strong> Online</strong></font></td></tr>'; }
    else { print'<tr><td>Game:</td><td"><font color="#FF0000"><strong> Offline</strong></td></tr>'; } 
    print'</table>';
?> 

 

Online:

<?php
//first you need to define db info
  define('mySQL_hostname', '127.0.0.1');  //database IP
  define('mySQL_database', 'Database');  //database name
  define('mySQL_username', 'User');  //database user
  define('mySQL_password', 'Pass');  //database password

//connects to mysql
  $db_link = mysql_pconnect( mySQL_hostname, mySQL_username, mySQL_password )
    or die( 'Error connecting to mysql<br><br>'.mysql_error() );

//connects to Database
  $db_select = mysql_select_db( mySQL_database, $db_link )
    or die( 'Error connecting to Database<br><br>'.mysql_error() );

//selects desired table
   $chars=mysql_query("SELECT * FROM characters");

//tells how much rows are there (will come helpfull with while loops)
   $rows =mysql_numrows($characters);

   $i=0;
   $x=0;

//while $i is smaller than number of rows repeat the code
   while ($i < $rows) {
    $online=mysql_result($chars,$i,"online"); //looks into characters table, under column online(if player is online its "0" else "1"), at row $i
    if ($online == 1) { $x++; } // if column online at row $i is "1", increase $x
    $i++; //increase $i
    }
   print 'Online players:<em>'.$x.'<em>'; //prints out the $x number of players online
?> 

 

Taken from Hopzone's forum in order to make your life easier.

Enjoy

Posted

Thx man, just mod the online code to see only normal players :

 

<?php
//first you need to define db info
  define('mySQL_hostname', '127.0.0.1');  //database IP
  define('mySQL_database', 'Database');  //database name
  define('mySQL_username', 'User');  //database user
  define('mySQL_password', 'Pass');  //database password

//connects to mysql
  $db_link = mysql_pconnect( mySQL_hostname, mySQL_username, mySQL_password )
    or die( 'Error connecting to mysql<br><br>'.mysql_error() );

//connects to Database
  $db_select = mysql_select_db( mySQL_database, $db_link )
    or die( 'Error connecting to Database<br><br>'.mysql_error() );

//selects desired table
   $chars=mysql_query("SELECT * FROM `characters` WHERE `accesslevel`=0);

//tells how much rows are there (will come helpfull with while loops)
   $rows =mysql_numrows($characters);

   $i=0;
   $x=0;

//while $i is smaller than number of rows repeat the code
   while ($i < $rows) {
    $online=mysql_result($chars,$i,"online"); //looks into characters table, under column online(if player is online its "1" else "0"), at row $i
    if ($online == 1) { $x++; } // if column online at row $i is "1", increase $x
    $i++; //increase $i
    }
   print 'Online players:<em>'.$x.'<em>'; //prints out the $x number of players online
?> 

  • 2 weeks later...
Posted

This is a php script. Make a new file *.php, upload it on your FTP, open some internet browser, enter your website address with the *.php file call, and look.

 

This is a tool for server webmaster who need to display the online player of a server. This is not a cheat, this is not a crap, this is just a php script.

 

More, I think the code is really simple and understable with all the comments, just need to read and not flood asking noob questions about that. If you don't know what this code is talking about, if you don't know what php is done to do, just look and close your flooding spamming fingers.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • Ave is trustworthy,fast  and reliable.His work is amazing!100% satisfied with his services!
    • SMMTOOL.ORG ТВОЙ ПРЯМОЙ ПОСТАВЩИК TG/YouTube/MAX ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ПОЧЕМУ МЫ? • Свой софт — работаем без посредников и переплат. • Скорость до 50.000.000 в сутки. • Минимальный **** — всего ~5%. ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Услуги Telegram ПРАЙС-ЛИСТ (ЗА 1000 ЕД.) ПОДПИСЧИКИ (LIFETIME) ➥ 1.2$ — RU База ➥ 1.2$ — Китай База ➥ 1$ — Ultra Fast Группа (~80₽) ➥ 1$ — Ultra Fast (~80₽) ➥ 0.99$ — Super Fast (~80₽) ➥ 0.8$ — Fast (~64₽) ➥ 0.55$ — Normal (~40₽) ➥ 0.44$ — 100K+ Only (~35₽) ПОДПИСЧИКИ (Дневные) ➥ 0.7$ — 60 дней РУ (~55₽) ➥ 0.5$ — 30 Дней РУ (~40₽) ➥ 0.7$ — 60 Дней Китай (~55₽) ➥ 0.5$ — 60 Дней Китай (~40₽) ОПТИМИЗАЦИЯ КАНАЛОВ И БОТОВ ➥ 1.5$ — Подписчики из Поиска Китай (~120₽) ➥ 1.5$ — Подписчики из Поиска РУ База (~120₽) ➥ 1$ — Подписчики из Поиска МИКС (~₽80) ➥ 0.8$ — Бот Старты из Поиска (~64₽) АКТИВНОСТЬ И БОТЫ ➥ 0.7$ — Реакции на Комменты (Позитивные) + Подписчики (Бонус) ➥ 0.7$ — Реакции на Комменты (Негативные) + Подписчики (Бонус) ➥ 0.08$ — Просмотры постов ➥ 0.08$ — Реакции (Любые) ➥ 0.18$ — Запуски ботов МИКС ➥ 0.4$ — Запуски ботов РУ ➥ 0.4$ — Запуски ботов Китай ➥ 0.18$ — Запуски ботов + сообщение (/settings) ➥ 0.5$ — Рефералы в боты ➥ 0.3$ — Репост Истории + просмотр ➥ 0.3$ — Лайк Истории + просмотр Услуги YouTube АКТИВНОСТЬ ➥ 8$ — Кастомные Комментарии Живые Юзеры ➥ 15$ — Кастом Позитивные Комментарии + Лайк + Просмотр Видео ➥ 10$ — Рандомные Позитивные Комментарии + Лайк + Просмотр Видео ➥ 0.55$ — Поделиться Видео Живые Юзеры ➥ 0.5$ — Зрители Эфира (15мин) Живые Юзеры ➥ 18$ — Живые Просмотры Видео 60мин+ Видео ➥ 5$ — Рандомные Позитивные Комментарии ➥ 0.5$ — Лайк под Видео ➥ 0.7$ — Просмотр Видео МИКС + Монетизация Услуги MAX ПОДПИСЧИКИ (LIFETIME) ➥ 22$ — Публичные Каналы ПОДПИСЧИКИ (Дневные) ➥ 15$ — 90 дней ➥ 12$ — 60 дней ➥ 8$ — 30 дней АКТИВНОСТЬ И БОТЫ ➥ 3.50$ — Просмотры на пост ➥ 7$ — Макс Репосты ➥ 8$ — Положительные Реакции ➥ 13$ — Реакция ➥ 13$ — Реакция ➥ 13$ — Реакция ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ БОНУСЫ И ОФФЕРЫ КЭШБЭК ДО 10% для крупных реселлеров API доступ для ваших панелей ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ОПЛАТА: Crypto | LOLZ Market САЙТ: SMMTOOL.ORG Telegram: SMMTOOL_ORG
    • L2jFrozen embossed my childhood. Sick to see it some what back to life again.   Thank you for all the work you've done back then!
    • As the tittle says.I need a working one,all the free shared do not work.Do not share 196p or the frankenstein 166p for lucera.Thanks
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..