Jump to content

Recommended Posts

  • 3 weeks later...
  • 6 months 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.

dude it didn't work if i put the php file with the code inside the website show a white page with this :

'; //prints out the $x number of players online ?>

 

any solution ?

  • 3 weeks later...
  • 1 month later...
Posted

Parse error: syntax error, unexpected T_STRING in C:\Program Files\VertrigoServ\www\status\Map\map.php on line 27

what's wrong???

 

i use this code

 

 

<?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

?>

  • 3 weeks later...
Posted

My Server Status Script:

 

<?php

////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////// Created By Mentor www.teamsrv.net ////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////


$login_ip = "127.0.0.1";
$login_port = "2106";
$game_ip = "127.0.0.1";
$game_port = "7777";
$ventrilo_ip = "127.0.0.1";
$ventrilo_port = "3784";

$mysql_host = "127.0.0.1";
$mysql_user = "root";
$mysql_passwd = "root";
$mysql_db = "l2jdb";

///////////////////////////
////////Login Server///////
///////////////////////////
$ls = @fsockopen ($login_ip, $login_port, $errno, $errstr, 1);
if ( $ls ) 
    $ls = "<font color=green>Online</font>"; 
else 
    $ls = "<font color=red>Offline</font>"; 

///////////////////////////
////////Game Server ///////
///////////////////////////
$gs = @fsockopen ($game_ip, $game_port, $errno, $errstr, 1);
if ( $gs ) 
    $gs = "<font color=green>Online</font>"; 
else 
    $gs = "<font color=red>Offline</font>"; 

///////////////////////////
////////Vent Server ///////
///////////////////////////
$ve = @fsockopen ($ventrilo_ip, $ventrilo_port, $errno, $errstr, 1);
if ( $ve ) 
    $ve = "<font color=green>Online</font>"; 
else 
    $ve = "<font color=red>Offline</font>"; 


/////////////////////////////
////MySQL Login Server///////
/////////////////////////////

mysql_connect($mysql_host, $mysql_user, $mysql_passwd) or die ("Nem sikerült csatlakozni a MySQL szerverhez!");
mysql_select_db($mysql_db) or die("Nincs ilyen adatbázis: ".$mysql_db); 

// All Accounts
$accounts=mysql_numrows(mysql_query("SELECT * FROM accounts"));

// Online Players Num
$num=mysql_numrows(mysql_query("SELECT * FROM characters WHERE online=1 and accesslevel=0"));

// Online GMs Num
$gmnum=mysql_numrows(mysql_query("SELECT * FROM characters WHERE online=1 and accesslevel>0"));

// All Alliance Num
$alliance=mysql_numrows(mysql_query("SELECT * FROM clan_data WHERE ally_name!=\'\'"));

// All Characters
$char=mysql_numrows(mysql_query("SELECT * FROM characters WHERE accesslevel=0"));

// All GM Characters
$gmchar=mysql_numrows(mysql_query("SELECT * FROM characters Where accesslevel > 0"));

// All Clan
$clan=mysql_numrows(mysql_query("SELECT * FROM clan_data"));

$gmnamesql = mysql_query("SELECT char_name FROM characters WHERE accesslevel>=1 AND online=1 ORDER BY char_name ASC");    
while ($gmnam = mysql_fetch_object($gmnamesql)) {  
$gmname .= "<font color=green>$gmnam->char_name</font>, ";  
}

print "
<table width='100%' border='0'>
<tr><td width='80%'><b>Auth Server:</b></td><td>".$ls."</td></tr>
<tr><td width='80%'><b>Bartz Server:</b></td><td>".$gs."</td></tr>
<tr><td width='80%'>Accounts:</td><td>".$accounts."</td></tr>
<tr><td width='80%'>Online Players:</td><td>".$num."</td></tr>
<tr><td width='80%'>Online GM:</td><td>".$gmnum."</td></tr>
<tr><td width='80%'>Characters:</td><td>".$char."</td></tr>
<tr><td width='80%'>GM Characters:</td><td>".$gmchar."</td></tr>
<tr><td width='80%'>Clans:</td><td>".$clan."</td></tr>
<tr><td width='80%'>Alliances:</td><td>".$alliance."</td></tr>
<tr><td>Online GM: ".$gmname."</td></tr>
</table>
";
////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////// Created By Mentor www.teamsrv.net ////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////

?>

  • 2 months later...
  • 2 weeks later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • most eggciting post in 2025 for sure!!!!
    • https://github.com/JulioPradoL2j/L2JDreamV2/commit/8f788b03c40404b72d7a321ef24e113f91a619ac     Descrição Este é um sistema de Reset de Personagem Personalizado criado para servidores L2J, inspirado em mecânicas clássicas de MMORPGs com foco em progressão PvP. Totalmente configurável via XML, este sistema permite criar um ciclo de evolução contínuo, recompensando jogadores que atingem o ápice com benefícios e novas metas.  Principais Funcionalidades Reset ativado ao atingir nível máximo, com requisitos de: Itens específicos Quantidade mínima de PvP Custo em moedas/itens Configuração via arquivo XML: Recompensas personalizáveis (itens, moedas, skills, etc) Redução de EXP ou retorno ao nível inicial Condições específicas para liberar o reset Sistema de Ranking: Rankings de Reset Diário e Mensal Premiação automática para os Top players Rankings reiniciam automaticamente no final do período Suporte a jogadores offline: Reset pode remover skills e aplicar recompensas direto no banco de dados Requisitos Técnicos Baseado em L2J DreamV2 / aCis 409 Compatível com bancos de dados MySQL Leitura de configuração via XML (resetData.xml)    Explicação das Configurações  Requisitos levelMax="80" → o jogador precisa atingir o nível 80. requiredPvps="0" → não exige PvP para resetar. expPenalty="0.8" → perde 20% da EXP total ao resetar. <item required="57-10000000;" /> → exige 10kk Adena.  Recompensas Recompensa fixa por reset: 57-15000 → 15k Adena 6392-3 → 3 unidades de item com ID 6392 Recompensa por skill (exemplo): 3135-4 (até nível 4) 3130-2 (até nível 2) 3131-10 (até nível 10)    Comandos para Administradores (Admin Commands) O sistema conta com comandos dedicados para encerrar manualmente os rankings de reset (diário ou mensal), forçando a distribuição imediata dos prêmios para os jogadores que se destacaram.  Comandos Disponíveis Comando Descrição //reset_end_daily Finaliza manualmente o ranking diário e distribui os prêmios configurados. //reset_end_monthly Finaliza manualmente o ranking mensal e distribui os prêmios configurados.   <?xml version="1.0" encoding="UTF-8"?> <list> <reset levelMax="80" requiredPvps="0" expPenalty="0.8"> <set rankingDisplayLimit="3" /> <set dailyPoints="2" /> <set monthlyPoints="1" /> <set removeResetSkills="true" /> <set logger="false" /> <requiredItems> <item required="57-10000000;" /> </requiredItems> <rewardItems> <item reward="57-15000;6392-3" skill="3135-4;3130-2;3131-10" /> </rewardItems> <prizes enable="true" type="DAILY" time="13:00"> <prize position="1" reward="57-15000;6392-3" /> <prize position="2" reward="57-10000;6392-2" /> <prize position="3" reward="57-5000;6392-1" /> </prizes> <prizes enable="true" type="MONTH" time="00:00"> <prize position="1" reward="57-15000;6392-3" /> <prize position="2" reward="57-10000;6392-2" /> <prize position="3" reward="57-5000;6392-1" /> </prizes> </reset> </list>  
    • This topic reminds me a bit of the old glory days! 😂 
    • Funny part is, i wouldnt make the effort of downvoting you if you weren't constantly sniping my profile to downvote me, and then when i downvote back you cry about it LOL
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock