[PHP] KOSP Website Player Online Script

Results 1 to 8 of 8
  1. #1
    Account Upgraded | Title Enabled! NarutaruTR is offline
    MemberRank
    Jun 2007 Join Date
    803Posts

    [PHP] KOSP Website Player Online Script

    I am not sure if anybody released it before but here youcan get my php script. It is running with KOSP, meaning you need to edit something in config.properties and install KOSP on your Mainserver.exe

    Code:
    <?php
        function Send_KOSP_command($cmd)
        {
            $host = "127.0.0.1";
            $port = XXXXX;
    
            $user = "YYYYY";
            $pass = "ZZZZZ";
    
    
            $fp = @fsockopen($host, $port);
    
    
            if($fp)
            {            
    
                // Send login
                fwrite($fp,"login $user $pass\r");
    
                // Set mode
                fwrite($fp,"mode web\r");
    
                // Send command
                fwrite($fp, "$cmd\r");
    
                while(!feof($fp))
                    $result .= fread ($fp, 1024);
    
                fclose($fp);
    
                return $result;
             }
    
            return NULL;
        }
    
        $Status = Send_KOSP_command("status");
    
        if($Status)
        {
            $PlayerOnline = Send_KOSP_command("player_online");
    
            echo "<div align=center><font color=#ffffff>Player Online : <color='red'>$PlayerOnline</font><br></div>";
        }
    ?>
    *Port in Config.properties
    *Username in Config.properties
    *Password in config.properties


    Now enjoy.

    Kind Regards NarutaruTR


  2. #2
    Account Upgraded | Title Enabled! 2Kxx is offline
    MemberRank
    Feb 2008 Join Date
    Sweden..Location
    1,194Posts

    Re: [PHP] KOSP Website Player Online Script

    nice :D

  3. #3
    Alpha Member Flohle is offline
    MemberRank
    Oct 2006 Join Date
    GermanyLocation
    1,942Posts

    Re: [PHP] KOSP Website Player Online Script

    it's the Example from KOSP or :P well, just a little modification and it's a realy helpfull script ;)

    (in the Example is also GM status list)
    Code:
    PHP Status Server Example:
    <?php
     function Send_KOSP_command($cmd)
     {
      $host = "127.0.0.1";
      $port = xxxxxx;
      $user = "yyyyyy";
      $pass = "zzzzzzzz";
     
      $fp = @fsockopen($host, $port);
     
      if($fp)
      {   
       // Send login
       fwrite($fp,"login $user $pass\r");
       // Set mode
       fwrite($fp,"mode web\r");
       // Send command
       fwrite($fp, "$cmd\r");
       while(!feof($fp))
        $result .= fread ($fp, 1024);
       fclose($fp);
       return $result;
       }
      return NULL;
     }
     $Status = Send_KOSP_command("status");
     if($Status)
     {
      $PlayerOnline = Send_KOSP_command("player_online");
      $GMOnline = Send_KOSP_command("gm_online");
      $PlayerList = Send_KOSP_command("player_list");
      $GMList = Send_KOSP_command("gm_list");
      echo "Player Online: $PlayerOnline<br>";
      echo "Player List: $PlayerList<br><br>";
      echo "GM Online: $GMOnline<br>";
      echo "GM List: $GMList";
     }
     else
     {
      echo "<font color=red>Offline</font>";
     }
    ?>
    Quote Originally Posted by pangkan92 View Post
    lol thats from one of the first versions of kosp.........
    true
    Last edited by Flohle; 27-04-08 at 01:49 PM. Reason: answer to pangkan92

  4. #4
    Account Upgraded | Title Enabled! pangkan92 is offline
    MemberRank
    Jan 2007 Join Date
    SwedenLocation
    400Posts

    Re: [PHP] KOSP Website Player Online Script

    lol thats from one of the first versions of kosp.........

  5. #5
    http://kalserverace.com Ace-SG1- is offline
    MemberRank
    Sep 2006 Join Date
    HawaiiLocation
    1,711Posts

    Re: [PHP] KOSP Website Player Online Script

    lol... i have one released, and you dont need KOSP installed... just PHP and MSSQL ^^.

  6. #6
    Member KalFusion is offline
    MemberRank
    Feb 2008 Join Date
    C:\Billy\Website Design\Home\xD\index.htmlLocation
    76Posts

    Re: [PHP] KOSP Website Player Online Script

    y dont release it us here then or can u give me a link for it if it already has been released?

  7. #7
    LordJustice crosenblum is offline
    MemberRank
    Apr 2007 Join Date
    Burnsville, MNLocation
    417Posts

    Re: [PHP] KOSP Website Player Online Script

    Is there a list anywhere of more kosp commands?

  8. #8
    Account Upgraded | Title Enabled! samsam is offline
    MemberRank
    Mar 2007 Join Date
    RussianLocation
    359Posts

    Re: [PHP] KOSP Website Player Online Script

    i think released before but thanks anyway :D



Advertisement