16.08.2018, 14:20
So i made a command /playerslist that gives with a dialog a list of registered players and their ip's. But it doesn't work, it gives instead of 172.0.0.10 it gives only "172".
PHP Code:
stock players(playerid)
{
new gString[2500], get_name[MAX_PLAYER_NAME], get_ip;
mysql_query(g_SQL, "SELECT * FROM players");
new rows = cache_num_rows();
if (rows)
{
format(gString, sizeof(gString), "Player Name\tIP\n", get_name, get_ip);
for (new i = 0; i < rows; i ++)
{
cache_get_value(i, "username", get_name, MAX_PLAYER_NAME);
cache_get_value_int(i, "ip", get_ip);
format(gString, sizeof(gString), "%s%s\t%d\n", gString, get_name, get_ip);
}
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_TABLIST_HEADERS, "Players", gString, "Back", "");
}
return 1;
}