Jump to content

[Share]PHP Status/Acc creation/Online players Scripts For your Site!!!


Recommended Posts

I found this useful guide in RZ.I decided to repost it here to help newbies making their site and adding these scripts:

 

Server 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>';
?>

 

Acc Creation:

 

First create acc.php file in same directory as index.. and add this script to it:

 

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

  function l2j_encrypt($password) 
    {
        return base64_encode(pack("H*", sha1(utf8_encode($password))));
    }

  $str =  l2j_encrypt($_POST['pass']);

  $user = $_POST["name"];

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

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

  if ($user == '') { print'Incorrect UserID'; mysql_close(); }
  else {
  $db_add = mysql_query( "INSERT INTO `accounts` VALUES ('$user', '$str', '0', '0', '')" )
    or die( 'Error: '.mysql_error() );
  }
  print 'Account Created<br><br>Enjoy youre gameplay.';
  mysql_close();
?>

 

after that add this to index

 

<form action="acc.php" method=post>
                        UserID:<input type="text" name="name" size 20><br><br>
                        Password:<input type="password" name="pass" size 20><br><br>
                         <input type=submit name="submit" value="Login">
            </form>

 

Online Players:

 

This script connects to the database(that means you need to have php connected to sql.. if you need any help with it try searching with google for apache php mysql install guides and i bet first link will work). Ive explained some of the code.. so learning from it should be easy..

 

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

 

Ok that's all!

REMEMBER: It's just a reshare for a user in RZ.I think it's suitable for the forum.

 

Regards

nS-Blane

Link to comment
Share on other sites

1st wrong section..it should be --->Lineage II Develop [L2J]

2nd i think Anni already share them ...

 

1st: It's not says about l2JDeveloping...but website develop and its theme is L2...so it's in right section.

2nd: Surly no..I searched....wth?

Link to comment
Share on other sites

well if you wanna get technical about it, the only people who would need this are people who are running a private server website > running a private server > should be in the L2j Dev section.

Link to comment
Share on other sites

Already posted a same like this one here!

http://www.maxcheaters.com/forum/index.php?topic=16023.0

Search before post.

 

I searched...damn hell :P

I am really sorry you can delete my post if you want...It was just a repost...

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...
  • 10 months later...

Guys i know that i might piss you off but how the hell do i use these?Where put them?Give me any help in general if you can,someone answer me or post a link to a guide,thx in advance!

Link to comment
Share on other sites

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

    • to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • This is my first and last topic created on a Lineage Forum, because if there's one thing that causes headaches for a lot of people, it's the critical error, that's why I decided to share it...   I'm creating a server again and before starting configurations I started collecting dozens of customs, without realizing my system folder had 950MB of files, so I started to enter the game, every 1 to 2 hours my client was reaching the maximum limit of virtual memory of the game due to the absurd amount of customs inside the system folder, reaching the maximum limit of 2047MB virtual ram, automatically we get critical, regardless of the error that appears on your screen, "THE WORDS ARE IRRELEVANT, unless it is a critical error before the ram memory limit reaches its limit", if you are seeing "2047 MB", it means that the game's virtual memory has reached its limit, and this memory is not configurable due to the game being created on 32-bit architecture, so I significantly reduced the amount of customs within the system from 950MB to 625MB, so my client started to reach the maximum memory limit every 10 to 12h, a huge progress, but my goal was at least 24h before reaching the virtual memory limit (playing frantically), so I reduced the system's custom files from 625MB to 267MB, the result was a first virtual memory limit critical error appearing after 41h.   My client is H5, the only types of customs I added to the game were focused only on equipment, one of the main causes were these skins and cloaks, they consume a huge amount of MB's within the "system", the problem is not adding customs to the client, the problem is adapting a custom and adding it inside the system folder, the system folder was not created with the intention of storing a huge amount of files.   Adding customs to the system folder means significantly reducing the time your client can remain open before reaching the virtual ram limit and make no mistake, there are hundreds of different critical errors with a small summary of the cause of the error, but if the critical table shows 2047MB of RAM, the problem is only 1. Example: I can see 3, 5, 9 critical error with different messages, but if this table is showing 2047MB ram, the reason was the virtual memory limit, an important detail is that this 2047MB ram is not a "fixed message or information from your computer", this 2047MB only appear when the cause is the virtual ram limit, it means that when you get a critical error with random numbers of ram memory appearing, such as 358MB ram, 715MB ram, it means that the cause of this error has no connection with ram virtual memory.
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products  https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...