The gamespy2 service is showing that everyone in a server is on team 0. And, how long does it take for an update in server data? I have been trying to make my own php based server tracker, but couldn't get it to work. I have experience with html, php, javascript and the like, but haven't done much with sockets and don't really know the query myself.
It depends on the game if it returns proper team data or not. I think that gamespy2 service is realtime, so it querries the server at the time you make the service call. If you want to implement your own gamespy protocol, check this : http://int64.org/docs/gamestat-protocols/gamespy2.html