Hello!
I’m working on a website script that will display server stats from the enemy territory game server.
Now bear with me i am a newbie at php coding and i was hoping to get some info.
This what i have:
<?php
$conne = fsockopen('udp://xxx.xxx.xxx.xxx','27960');
fwrite($conne, chr(255) . chr(255) . chr(255) . chr(255) . chr(0x02) . 'getstatus' . chr(0x00));
fread($conne, 4);
$status = socket_get_status($conne);
$data = fread($conne, $status['unread_bytes']);
fclose($conne);
echo $data;
?>
and it displays server data like this(messy)
\0\sv_minguidage\0\sv_maxRate\45000\sv_minPing\0\sv_maxPing\0\sv_floodProtect\0\g_friendlyFire\0\g_maxlives\0\g_antilag\1\g_heavyWeaponRestriction\100 5106 0 "^6Aimless" 5724 0 "^4Tarnen" 4198 0 "^6WhittlinMan" 5561 0 "^7Morgriff" 4670 0 "^8Ilikechocmilk" 6047 0 "^5Halfwit" 4844 0 "^4Noammo" 4621 0 "^4Beelz" 4424 0 "^8Flint" 5561 0 "^8Narice" 4018 0 "^3Merki" 5069 0 "^1Milius" 4350 0 "^9Garbok" 4955 0 "^7Fullmonty" 4278 0 "^9Newbie" 5073 0 "^5Malin"
etc…
Now is it possible to assign variables to that code so that nicknames, xp, ping, map,… and other stuff could be displayed seperatly and so that i could edit them with html and css.
All stats that i need are echoed out but i don’t know how to assign variables to them.
i hope you can understand what i mean english is not my first language
btw i used search too
Thanks!