Website Script of all online players. [Works with Cabal Toolz!]

Results 1 to 3 of 3
  1. #1
    Software Person TimeBomb is offline
    ModeratorRank
    May 2008 Join Date
    United StatesLocation
    1,252Posts

    Website Script of all online players. [Works with Cabal Toolz!]

    Hello all, I am here to release a simple script I wrote from scratch for a server I work on.
    It is just a list of names of all the current players online.
    Save the following code into a file called onlineplayers.php
    Code:
    <?PHP
    //--Credits to Untamed AKA TimeBomb & Cabal Frontier: \\
    $sql_server = "localhost"; //<-- MSSQL server address/ip
    $sql_user = "USER"; //<-- MSSQL username
    $sql_pass = "PASS"; //<-- MSSQL password
    $sql_data = "gamedb"; //<-- MSSQL database
    $conn=mssql_connect($sql_server,$sql_user,$sql_pass);
    $xadb = mssql_select_db($sql_data,$conn);
    $name1 = mssql_query("select [Name] from [dbo].[cabal_character_table] where login = 1");
    $nametest = mssql_num_rows($name1);
    if ($nametest > 0) {
    echo '<center><b>Players Online:</b><p><i>';
    do { while ($row = mssql_fetch_row($name1)) {
    echo $row[0].'<br>';
     } } while (mssql_next_result($name1));
    echo '</i></center>'; } else echo '<center><b>No players are currently online!</b></center>';
    mssql_free_result($name1);
    mssql_close($conn);
    ?>
    Set your mssql password and username and you are ready to go!

    To make this work with Cabal Toolz:
    Put this in your modules folder of your site.
    Then, put a link somewhere on your site to http://YOURSITE.com/onlineplayers.html.
    I put this link near the bottom of server check by editing the module mod.serverstats.php in the template folder.
    Last edited by cypher; 22-12-09 at 10:16 AM.


  2. #2
    ANTI emi is offline
    MemberRank
    Mar 2009 Join Date
    ZHLocation
    1,378Posts

    Re: Website Script of all online players. [Works with Cabal Toolz!]

    This is already released

  3. #3
    Software Person TimeBomb is offline
    ModeratorRank
    May 2008 Join Date
    United StatesLocation
    1,252Posts

    Re: Website Script of all online players. [Works with Cabal Toolz!]

    Just searched ;) There is nothing like this, unless you count CabalToolz online number of players. This is a full list of online players names. I did search these forums before I made this, and just now, and nothing like this showed up.
    This code personally was also never released, I just coded it today...



Advertisement