can i have a serverstatus script

Results 1 to 21 of 21
  1. #1

    can i have a serverstatus script

    ive searched all over and i cant seem to find a working serverstatus page with character,count account count and a ranking page... can someone help me? and players online
    Last edited by BaLeSsK1; 13-12-09 at 09:28 PM.


  2. #2
    Account Upgraded | Title Enabled! SHEEN[GB] is offline
    MemberRank
    Aug 2009 Join Date
    London, UKLocation
    263Posts

    Re: can i have a serverstatus script

    Ask legacycode or something, hes pro at php maybe he will tell you how to do that.

  3. #3
    Proficient Member V_o_o_d_o_o is offline
    MemberRank
    Jun 2008 Join Date
    152Posts

    Re: can i have a serverstatus script

    PHP Code:
    <?php
    $ip 
    "WAN IP";
    $serverport 6000;
    $locatorport 8900;
    $agentport 7777;
    $servercon = @fsockopen($ip$serverport$errno$errstr5);
    if(!
    $servercon)
    {
        
    $servermsg "Offline";
    }
    else
    {
        
    $servermsg "Online";
    }
    $locatorcon = @fsockopen($ip$locatorport$errno$errstr5);
    if(!
    $locatorcon)
    {
        
    $locatormsg "Offline";
    }
    else
    {
        
    $locatormsg "Online";
    }
    $agentcon = @fsockopen($ip$agentport$errno$errstr5);
    if(!
    $agentcon)
    {
        
    $agentmsg "Offline";
    }
    else
    {
        
    $agentmsg "Online";
    }
    echo 
    "Server: $servermsg";
    echo 
    "Locator: $locatormsg";
    echo 
    "Agent: $agentmsg";
    ?>
    Written from memory, give it a try.

    Edit: Oops, forgot, you need to add <br> at the end of the echoes or it will all be on the same line.

    Also, locator status doesn't show, I don't know if you can check that or not o.o

    PHP Code:
    <?php $ip "altf4network.com"$serverport 6000$locatorport 8900$agentport 7777;
    $servercon = @fsockopen($ip$serverport$errno$errstr5); if(!$servercon){$servermsg "Offline";}else{$servermsg "Online";}
    $locatorcon = @fsockopen($ip$locatorport$errno$errstr5); if(!$locatorcon){$locatormsg "Offline";}else{$locatormsg "Online";}
    $agentcon = @fsockopen($ip$agentport$errno$errstr5); if(!$agentcon){$agentmsg "Offline";}else{$agentmsg "Online";}
    echo 
    "Server: $servermsg<br>"; echo "Locator: $locatormsg<br>"; echo "Agent: $agentmsg"?>
    Last edited by V_o_o_d_o_o; 14-12-09 at 04:03 PM. Reason: Changing code tags to PHP tags.

  4. #4

    Re: can i have a serverstatus script

    legacy code doesnt work for me

    and this code says
    it says internal error

    i want something with number of players and stuff. all of that and not to count the admins and stuff. like not to show them in the ranks and stuff
    Last edited by BaLeSsK1; 14-12-09 at 05:25 PM.

  5. #5
    Proficient Member V_o_o_d_o_o is offline
    MemberRank
    Jun 2008 Join Date
    152Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by BaLeSsK1 View Post
    legacy code doesnt work for me

    and this code says
    it says internal error

    i want something with number of players and stuff. all of that and not to count the admins and stuff. like not to show them in the ranks and stuff
    PHP Code:
    <?php $con mssql_connect("SQLSERVER","","");
    if (!
    $con){die('Couldnt not connect: ' mssql_error());}
    mssql_select_db("GunzDB");
    $players mssql_query("SELECT CurrPlayer,MaxPlayer FROM ServerStatus");
    $players2 mssql_fetch_array($players);
    Echo 
    "Players online: "; echo $players2['CurrPlayer']; echo "/"; echo $players2['MaxPlayer'];
    ?>
    (Fixed problem on line 6, works now)

    This doesn't exclude admins/GMs.
    Last edited by V_o_o_d_o_o; 14-12-09 at 05:41 PM.

  6. #6

    Re: can i have a serverstatus script

    thank you, but i need a player count char count and account count, and a ranking page..

  7. #7
    Proficient Member V_o_o_d_o_o is offline
    MemberRank
    Jun 2008 Join Date
    152Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by BaLeSsK1 View Post
    thank you, but i need a player count char count and account count, and a ranking page..
    Ranks:
    Spoiler:
    PHP Code:
    <body leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px"> 
    <style type="text/css">
      TABLE.RANKS
      { 
         font-family:sans-serif;
         font-size:15;
         background-color:#000000;
         width:180;
         border-color:white;
         border-width:1;
      }
      TH.RANKS
      {
         font-size:7pt;
         background-color:#ffffff;
         color:black;
      }
      TD.RANKS
      {  
         font-size:7pt;
         background-color:#222222;
         color:white;
         border-style:solid;
         border-width:1px;
         text-align:center;
      }
      .RNX
      {
      scrollbar-face-color: #666666;
      scrollbar-highlight-color: #FFFFFF;
      scrollbar-3dlight-color: #999999;
      scrollbar-shadow-color: #333333;
      scrollbar-darkshadow-color: #000000;
      scrollbar-arrow-color: #CCCCCC;
      scrollbar-track-color: #CCCCCC;
      }
    </style>

    <?php 
    $con 
    mssql_connect("YOUR SQL SERVER","","");
    if (!
    $con){die('Couldnt not connect: ' mssql_error());}
    mssql_select_db("GunzDB");
    $result mssql_query("SELECT TOP 50* FROM Character WHERE Name != '' ORDER BY Level DESC, XP DESC");
    echo 
    "<div style='width: 201px; height: 100%; overflow: auto; background-color: #000000;' CLASS='RNX'>
    <table border='1' class='RANKS'>
    <tr CLASS='RANKS'>
    <th CLASS='RANKS'>Rank</th>
    <th CLASS='RANKS'>Player</th>
    <th CLASS='RANKS'>Level</th>
    </tr>"
    ;

     
    $x 1;
    while(
    $row mssql_fetch_array($result))
      {
      echo 
    "<tr CLASS='RANKS'>";
    echo 
    "<td CLASS='RANKS'>" $x "</td>";
      echo 
    "<td CLASS='RANKS'>" $row['Name'] . "</td>";
      echo 
    "<td CLASS='RANKS'>" $row['Level'] . "</td>";
      echo 
    "</tr></div>";
      
    $x++;
      }

    echo 
    "</table>";
    mssql_close($con);
    ?>


    Account/Character Count:
    Spoiler:
    PHP Code:
    <?php 
    $con 
    mssql_connect("SQL SERVER HERE","","");
    if (!
    $con){die('Couldnt not connect: ' mssql_error());}
    mssql_select_db("GunzDB");
    $acount mssql_query("SELECT * FROM Account");
    $ccount mssql_query("SELECT * FROM Character WHERE Name != ''");
    $acount2 mssql_num_rows($acount);
    $ccount2 mssql_num_rows($ccount);
    echo 
    "Accounts: $acount2<br>";
    echo 
    "Characters: $ccount2<br>";
    mssql_close($con);
    ?>
    Last edited by V_o_o_d_o_o; 14-12-09 at 08:29 PM.

  8. #8

    Re: can i have a serverstatus script

    i dont know why they dont work for me

    $con = mssql_connect("compname\sqlexpress","USER","PASSWORD");

    is that right thats how im doing it but all i see is a blank page

  9. #9
    Freelance GunZ Developer Touchwise is offline
    MemberRank
    Aug 2009 Join Date
    The NetherlandsLocation
    754Posts

    Re: can i have a serverstatus script

    Dude if you want to to start a gunz server please don't do it without basic php knowledge...

  10. #10
    Account Upgraded | Title Enabled! SHEEN[GB] is offline
    MemberRank
    Aug 2009 Join Date
    London, UKLocation
    263Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by Touchwise View Post
    Dude if you want to to start a gunz server please don't do it without basic php knowledge...
    Well, loads of people do that these days.

  11. #11
    F**KIN LEGEND! exclamatio is offline
    Old SchoolRank
    May 1986 Join Date
    Merry EnglandLocation
    22,149Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by Touchwise View Post
    Dude if you want to to start a gunz server please don't do it without basic php knowledge...
    why not learn as you go along?

    when the private server scene started years ago hardly anyone knew what they were doing

  12. #12
    Proficient Member V_o_o_d_o_o is offline
    MemberRank
    Jun 2008 Join Date
    152Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by BaLeSsK1 View Post
    i dont know why they dont work for me

    $con = mssql_connect("compname\sqlexpress","USER","PASSWORD");

    is that right thats how im doing it but all i see is a blank page
    $con = mssql_connect("COMPNAME\SSQLEXPRESS","","");

    Quote Originally Posted by Touchwise View Post
    Dude if you want to to start a gunz server please don't do it without basic php knowledge...
    I had no PHP knowledge before setting up a GunZ server and website.

    Quote Originally Posted by exclamatio View Post
    why not learn as you go along?

    when the private server scene started years ago hardly anyone knew what they were doing
    That's what I do :) I don't read PHP learning books all day, I just chop/edit/copy/paste what I already have, write what I already know, Google the rest. On errors, I just look at it on a web explorer, go to the line and fix it. I also have Notepad++ which is a good IDE for PHP (And others)

    Like SQL queries... I had basic queries in PHP that would echo the result, all I had to do was edit the query or result output to get what I wanted. Google for syntax.

  13. #13
    Animu Addicted Number12 is offline
    MemberRank
    Apr 2008 Join Date
    Old Sunny CALocation
    1,264Posts

    Re: can i have a serverstatus script

    If you search for Legacy Code (I believe that is how you spell it correctly) he released a great server status script. It has different bars for the different servers and goes up and down for the amount of players. Also shows how many and the max players.

  14. #14
    Account Upgraded | Title Enabled! Axium is offline
    MemberRank
    May 2008 Join Date
    Delhi, IndiaLocation
    604Posts

    Re: can i have a serverstatus script

    And it's pretty easy to remove/replace the images.

  15. #15
    Valued Member LegacyCode is offline
    MemberRank
    Aug 2009 Join Date
    HyruleLocation
    129Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by Touchwise View Post
    Dude if you want to to start a gunz server please don't do it without basic php knowledge...
    You don't need any knowledge of php... when i started with gunz
    back in 2007 i didn't know anything and still managed do do fine.


    Quote Originally Posted by number12 View Post
    If you search for Legacy Code (I believe that is how you spell it correctly) he released a great server status script. It has different bars for the different servers and goes up and down for the amount of players. Also shows how many and the max players.
    Nice to see ppl like it. The link to the thread can be found in my signature.

    Its "legacycode" without the space he he.
    Last edited by LegacyCode; 15-12-09 at 05:32 PM.

  16. #16

    Re: can i have a serverstatus script

    what do you put here?

    $database['driver'] = 'SQL Server';

  17. #17
    Proficient Member V_o_o_d_o_o is offline
    MemberRank
    Jun 2008 Join Date
    152Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by BaLeSsK1 View Post
    what do you put here?

    $database['driver'] = 'SQL Server';
    Pretty sure that's COMPNAME\SQLSERVER

    Not sure though ^^

    Show some more of the code so I can see where it's used :P

  18. #18
    Valued Member LegacyCode is offline
    MemberRank
    Aug 2009 Join Date
    HyruleLocation
    129Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by BaLeSsK1 View Post
    what do you put here?

    $database['driver'] = 'SQL Server';
    That's the driver used for the odbc connection
    when you created the odbc connection you had
    to pick a driver "SQL Server" or "SQL Native Client" (i hope that name is the right one.)
    It should be the same as the one you picked.
    Last edited by LegacyCode; 16-12-09 at 10:52 AM.

  19. #19

    Re: can i have a serverstatus script

    hmmm we have to make a new database for it? or r u talking about the gunzdb one?

  20. #20
    Valued Member LegacyCode is offline
    MemberRank
    Aug 2009 Join Date
    HyruleLocation
    129Posts

    Re: can i have a serverstatus script

    Quote Originally Posted by BaLeSsK1 View Post
    hmmm we have to make a new database for it? or r u talking about the gunzdb one?


    Look at the red box on the screenshot.

    When you created your odbc connection you had to select
    one of those to create it.

    The one you selected should be in the "$database['driver']"
    setting.

    Its "SQL Server" or "SQL Native Client" just depends on what you used.
    Last edited by LegacyCode; 16-12-09 at 10:42 PM.

  21. #21

    Re: can i have a serverstatus script

    what we used for the gunzdb right?



Advertisement