Volg de onderstaande video om te zien hoe je onze site als web-app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
ort (ie. server.php?server=213.189.21.11:12203)
ort <?
if(!$server)
{
$server = "195.130.132.155:12203"; // server ip en poort
}
$serveronline = 1; // 1=server is online / 0=server is tijdelijk offline
// Do NOT change anything below this line!
// Made by Ghostie (Peter Verboom)
if($serveronline == 1)
{
// Server ip and port:
if ($server)
{
$server = explode(":", $server);
$server_ip = $server[0];
$server_port = $server[1];
}
// Creating the URL for the connection:
$server_print = $server_ip . ":" . $server_port;
$server_ip = "udp://" . $server_ip;
// Open the connection:
$connect = fsockopen($server_ip, $server_port, $errno, $errstr, 30);
// Set the timeout:
socket_set_timeout ($connect, 1, 000000);
// Get the information from the server, and put it into the $output array:
$send = "ÿÿÿÿ" . chr (0x02) . "getstatus";
fputs($connect, $send);
fwrite ($connect, $send);
$output = fread ($connect, 1);
if (! empty ($output)) {
do {
$status_pre = socket_get_status ($connect);
$output = $output . fread ($connect, 1);
$status_post = socket_get_status ($connect);
} while ($status_pre[unread_bytes] != $status_post[unread_bytes]);
};
// Close the connection:
fclose($connect);
// Select the variables from the $output array:
$output = explode ("\\", $output);
$max_index = array_search ("sv_maxclients", $output);
$max_clients = $output[$max_index+1];
$max_index = array_search ("mapname", $output);
$mapname = $output[$max_index+1];
$max_index = array_search ("sv_hostname", $output);
$hostname = $output[$max_index+1];
$max_index = array_search ("g_gametypestring", $output);
$gametype = $output[$max_index+1];
$last_value = count($output) - 1;
$players_string = $output[$last_value];
$players_string = explode("\"", $players_string);
$get_first_ping = explode("\n", $players_string[0]);
$players_string[0] = $get_first_ping[1];
$i = 1;
$players = 0;
while (count($players_string) != $i) {
$i++;
$i++;
$players++;
}
// Create the image url:
if (substr($mapname, 0, 3) == "dm/") {
$picture_src = str_replace("dm/", "", $mapname);
} else {
$picture_src = str_replace("obj/", "", $mapname);
}
$picture_src = "images/" . $picture_src . ".jpg";
$hostname = str_replace("^1", "", $hostname);
$hostname = str_replace("^2", "", $hostname);
$hostname = str_replace("^3", "", $hostname);
$hostname = str_replace("^4", "", $hostname);
$hostname = str_replace("^5", "", $hostname);
$hostname = str_replace("^6", "", $hostname);
$hostname = str_replace("^7", "", $hostname);
$hostname = str_replace("^8", "", $hostname);
$hostname = str_replace("^9", "", $hostname);
$hostname = str_replace("^.", "", $hostname);
// Start the output:
?>
<table align=left border="0" align="center">
<tr><td width=200>
<table>
<tr><td>IP: <b><?=$server_print?></B></td></tr>
<tr><td>Naam: <?=$hostname?></td></tr>
<tr><td>Spelers: <?=$players?>/<?=$max_clients?> </td></tr>
<tr><td>Map: <?=$mapname?></td></tr>
</table>
</td><td>
<img width=100 height=75 src="<?=$picture_src?>">
</td></tr><tr><td colspan=2>
<table><tr><td width=200>Players on server:</td></tr>
<?
$i = 1;
while (count($players_string) != $i) {
// ^x colors delete
$players_string[$i] = str_replace("^1", "", $players_string[$i]);
$players_string[$i] = str_replace("^2", "", $players_string[$i]);
$players_string[$i] = str_replace("^3", "", $players_string[$i]);
$players_string[$i] = str_replace("^4", "", $players_string[$i]);
$players_string[$i] = str_replace("^5", "", $players_string[$i]);
$players_string[$i] = str_replace("^6", "", $players_string[$i]);
$players_string[$i] = str_replace("^7", "", $players_string[$i]);
$players_string[$i] = str_replace("^8", "", $players_string[$i]);
$players_string[$i] = str_replace("^9", "", $players_string[$i]);
$players_string[$i] = str_replace("^0", "", $players_string[$i]);
$j = $i -1;
?>
<tr><td><?=$players_string[$i]?></td></tr>
<?
$i = $i + 2;
}
?>
</table>
</td></tr></table>
<?
}
else
{
echo"Momenteel is de server tijdelijk offline.";
}
?>

.Nighthawk. zei:tam tam tam
sry ze mo atm weet ik ni eens of mne kop er nog aanhangt of ni, tis begin school, moe eel kot in orde krijge, mn zus aren trouw, sites & scripts etc![]()
http://www.klep2mania.be/telenet/serverstats/MoH/server_status.php
hier was ik dus aant werken, om +- hetzelfde te krijgen als dat codscriptje op de site. Maar aangezien zoooveel cmds nog niet gaan in moh, heb ik het atm wat opgegeven
