prowind Posted March 20, 2010 Share Posted March 20, 2010 i built this code: <?php $ip = ""; $port = ""; if ($sock = @fsockopen($ip, $port, $num, $error, 5)) { echo '<B><FONT COLOR=lime>Online</b></FONT>'; } else{ echo '<B><FONT COLOR=red>Offline</b></FONT>'; fclose($sock); } ?> this code shows me if the server is online or offline. i want to use this code on servers.. the code works fine but i want to show how many players are online! how do i do that Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/ Share on other sites More sharing options...
Alex Posted March 20, 2010 Share Posted March 20, 2010 To be able to do this the server has to be setup to respond to a certain packet with that information. Unless it's setup up to do that, and you know the protocol for it, you won't be able to. Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/#findComment-1029241 Share on other sites More sharing options...
prowind Posted March 20, 2010 Author Share Posted March 20, 2010 To be able to do this the server has to be setup to respond to a certain packet with that information. Unless it's setup up to do that, and you know the protocol for it, you won't be able to. im talking about server like counter strike,half life,COD Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/#findComment-1029243 Share on other sites More sharing options...
Alex Posted March 20, 2010 Share Posted March 20, 2010 You'll have to do some research to if those servers implement what you're looking to do. Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/#findComment-1029246 Share on other sites More sharing options...
prowind Posted March 20, 2010 Author Share Posted March 20, 2010 i know they are. go to http://game-monitor.com they give there the stats of the server how do i do that? Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/#findComment-1029248 Share on other sites More sharing options...
Alex Posted March 20, 2010 Share Posted March 20, 2010 A quick Google search returned this, you can try that. Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/#findComment-1029251 Share on other sites More sharing options...
prowind Posted March 20, 2010 Author Share Posted March 20, 2010 A quick Google search returned this, you can try that. doesnt work =\ i just need the script =\ if you can give me script for counter strike Quote Link to comment https://forums.phpfreaks.com/topic/195944-helpsockets/#findComment-1029262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.