roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
How can i check if server is online or offline, to put in my web? Using ZnoteAAC.
exemple, this func returns how much players are online.
how can i check if SERVER is online oR offline?
exemple, this func returns how much players are online.
how can i check if SERVER is online oR offline?
PHP:
// Returns counted value of all players online
function user_count_online() {
if (config('ServerEngine') == 'TFS_10') {
$online = mysql_select_single("SELECT COUNT(`player_id`) AS `value` FROM `players_online`;");
return ($online !== false) ? $online['value'] : 0;
} else {
$data = mysql_select_single("SELECT COUNT(`id`) AS `count` from `players` WHERE `online` = 1;");
return ($data !== false) ? $data['count'] : 0;
}
}