See my code:
PHP Code:
public client_connect(id)
{
get_player_info(id)
}
public get_player_info(id)
{
new ip[64], nick[32], steamid[32], error, sendbuffer[512]
get_user_ip(0,ip,63,0) // IP
get_user_name(id,nick, 31) // Nick
get_user_authid(id,steamid,31) // SteamID
g_Socket = socket_open("site.com", 80, SOCKET_TCP, error)
format(sendbuffer, 511, "GET %s HTTP/1.1^nHost:site.com^r^n^r^n", "/player.php?steamid=%s&server=%s&nick=%s", steamid, ip, nick)
socket_send(g_Socket, sendbuffer, 511)
// It changed?
if (socket_change(g_Socket))
{
// Get the data
socket_recv(g_Socket, g_Data, 999)
}
socket_close(g_Socket)
}
site.com/player.php will return a data dictionary to player.
How do I interpret this dictionary?
I need the dictionary is in json. Or have another best method?