Jump to content

Recommended Posts

Posted

Ive decided to make this thread cuz theres allot of good servers out there with pages looking like something frontpage would spit out.. besides it was time to give something back to the mxc community  ;D

 

I could post all scripts from castle sieges to clan hall owners lol.. but i will just post this 3 for example.. and ofcourse learning purposes..

 

Server Status:

 

anyway status script is the easyest thing to do with php.. and i wont even try to explain it since its mostly obvious..

 

 

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

 

I wasted allot of time to get to know what encryption l2 uses for passwords.. anyway i wanted to spare you some time..

 

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

?>

sometimes you will only get for example clan id.. not the name of it.. and in that case i suggest you use 2 whiles (one inside the other) to check other tables for names...

 

hope it was helpful.. enjoy :)

  • 2 months later...
  • 3 weeks later...
Posted

good but already posted many times.

 

another: im searching this forum about a php code, that can tell me online players by an ip:port.

there was a webpage (l2.evermore.ru or i dont remember correctly) what could do this.

Can anyone help me about this?

  • 7 months later...
  • 4 months later...
Posted

For me account creation doesn't work..

Error :

 

Error: Column count doesn't match value count at row 1

 

Because you have another database, check the code tables and the database, the problem can be the database tables dont have the same name who the code's have, so check it.

You use Freya or Interlude? and what pack did you use?

Posted

Because you have another database, check the code tables and the database, the problem can be the database tables dont have the same name who the code's have, so check it.

You use Freya or Interlude? and what pack did you use?

 

I use datapack of l2j with freya.

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

    • New Season Koofs Vs Noobs Get ready for the return of the epic Lineage II experience! L2KvN is coming back stronger than ever, featuring thrilling PvP, powerful factions, and unforgettable gameplay! Whether you're new to the world of L2KvN or returning to conquer it once more, there’s something for everyone:   Global Launch Times Mark your calendars! The server will launch at the following times around the world 20:00 Greece (Athens) GMT +2  20:00 Russia (Moscow) GMT +3 00:00 Russia (Novosibirsk) GMT +7 05:00 Russia (Vladivostok) GMT +10 14:00 Brazil GMT -3 13:00 Argentina GMT -3 20:00 Lithuania GMT +2 18:00 United Kingdom GMT 0 13:00 USA (Eastern Time) GMT -5 10:00 USA (Pacific Time) GMT -8   L2KvN server is with high rates and custom features. Offers fast progression and an exciting experience. Perfect for fans of intense gameplay.   Server Chronicles Interlude Rates: PvP(High) Adena: x1(Custom) Drop Rate: x1(Custom) 1 PvP = 2 Adena(4 For Premium Users)   Premium Account can be activated by purchasing Premium Account Coupon from L2Store and double-clicking the coupon. Premium Account provides the following: 1 PvP: 4 Adena   General Rates Start up Player System Instant LvL 80 Choose For What Faction You Love To Fight [Koofs - Noobs] Koofs Base: Dark Elf Village Noobs Base: Elven Village Prepare You Character Scheme Buff Or Choose Auto Buff PrePare Your Character Equipment From KvN Shop Killing spree systems Full GM shop. Free class change and Subclass All NPCs available in town. Custom Items Balanced. Community Board BugReport/RaidInfo/TopPvP-Online 1 PvP = 1 Adena (2 If Premium)   Enchant Rates Safe Enchant +6 Max Enchant +21 Normal Scroll Chance: 100% (+0 to +6) Blessed Scroll Chance: 85% (+6 to +21) Ex: If +14 failed for +15, return +14   LifeStone Rates High Lifestone Chance: 5% Top Lifestone Chance: 10%   Grand Bosses Queen Ant 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Baium 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Zaken 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Antharas 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS Valakas 8H +1Random (there is a chance to spawn in 7H or 9H) Drops RB Ring/LS/BOGS   Elo Ranking System start unranked and ranks is Unranked-Iron-Bronze-Silver-Gold-Platinum-Diamond All ranks have 3 rank example Iron III Iron II iron I (iron iii is first and iron i is last. you need iron 1 to upgrade to silver.) unranked to iron need 50 points. and all ranks need 100 points to up a rank 5 points per kill if you die you lose 3 points. if you demote (have 4 points and die and you silver i you will demote to bronze iii 20 points.) if you bronze i 99 points and got 1 kill (+5 points) you uprank to silver iii 20 points. every rank have berets. see in video berets in ranks Iron/Bronze/Silver/Gold/Platinum/Diamond (only visual no extra buffs)   PvP Zone System maps change every 1 hour Orc Village Gludin Town   Event System Events every 1 hour TeamVsTeam => 12:00 14:00 16:00 18:00 20:00 22:00 23:59 02:00 04:00 06:00 08:00 10:00 12:00 Capture The Flag => 13:00 15:00 17:00 19:00 21:00 23:00 01:00 03:00 05:00 07:00 09:00 11:00 Rewards = MvP 5 Events | Winner Team 10 Events | Looser 5 Events   🌐 Website: https://l2kvn.com/ 🌐 Website: https://discord.gg/unn2XBhwef
    • looking for someone who could do something similiar, with my own additions to it pack: l2jeternity (h5)   if someone is interested add me on dc and tell me your price.   dc: eXPllo#8222
    • Our website: https://l2evo.net is ready! Beta is on till 20.01.2025. (Every day from 10 am till 10pm the server will be online). You can join the server to review it. You can find the Starlight Shop in the main town to get free Items! For any questions feel free to ask in discord!
    • Lmfao stop reviving this shit, it's not gonna be like 2007
  • Topics

×
×
  • Create New...