-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
42 lines (35 loc) · 913 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require_once 'lib/squadserver.php';
// Configuration parameters
define('SQUAD_SERVER_HOST', '');
define('SQUAD_SERVER_PASSWORD', '');
define('SQUAD_SERVER_PORT', 21113);
$server = new SquadServer(SQUAD_SERVER_HOST, SQUAD_SERVER_PORT, SQUAD_SERVER_PASSWORD);
// Get currently active players
$players = $server->currentPlayers();
/*
RETURNS:
array(
array(
'id' => 0,
'steam_id' => '772321313123',
'name' => 'John Doe'
),
...
)
*/
// Get current and next map
$maps = $server->currentMaps();
/*
RETURNS:
array(
'current' => 'Sumari AAS v2',
'next' => 'Kohat AAS v1'
)
*/
// Broadcast message to all players on the server, returns BOOLEAN
if($server->broadcastMessage('Hello from the other side')) {...}
// Change map, returns BOOLEAN
if($server->changeMap('Sumari AAS v1')) {...}
// Set next map, returns BOOLEAN
if($server->nextMap('Gorodok')) {...}