Files

> > CS2D > Misc. > PHP: Viewing server data
Files overviewCS2D overviewMisc. overview

English PHP: Viewing server data >

21 comments4 kb, 916 Downloads

old PHP: Viewing server data

Apache uwu
User Off Offline

Updated for CS2D 1.0.0.6 and PHP >= 5.4.

Methods

> CS2D::getInfo($ip, $port);

Returns an associative array with the format

1
2
3
4
5
6
7
8
9
10
11
Array (
    [Name] => Server Name
    [Map] => de_dust
    [Players] => 14 / 32 (Bots: 0)
    [Password] => None
    [U.S.G.N. only] => Off
    [Fog of War] => Off
    [Friendly Fire] => Off
    [Lua] => Uses Lua Scripts!
    [Game Mode] => Deathmatch
)

> CS2D::getPlayers($ip, $port)

Returns an associative array with the format

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Array (
    [3] => Array
        (
            [name] => Player
            [score] => 7
            [deaths] => 0
            [team] => Counter-Terrorist
        )

    [another_id] => Array
        (
            [name] => Player 2
            [score] => 9
            [deaths] => 8
            [team] => Terrorist (or Spectator)
        )
    ...
)
edited 8×, last 29.01.18 05:44:17 pm
Approved by Seekay

Download Download

4 kb, 916 Downloads

Comments

21 comments
Page
To the start Previous 1 2 Next To the start

Log in!

You need to log in to be able to write comments!Log in

old

Surplus
User Off Offline

Now make a possibility to use rcon cmds if you enter a rcon pass.

5/5
I like it!
To the start Previous 1 2 Next To the start