09.10.2016, 16:32
i got this in my script:
and call the function once player has logged in.
PHP код:
public recentlyUsedNicks(playerid)
{
new query[200], ip[16], pName[24],pName1[10][24], playerName[24];
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerName(playerid, playerName, sizeof(playerName));
mysql_format(1, query, sizeof(query),"SELECT playerName FROM `playerdata` WHERE `playerIP`='%s' LIMIT 10", ip);
new Cache:cacheid = mysql_query(1, query);
new rows = cache_num_rows();
new string[128];//, string1[128];
if(rows > 1)
{
format(string, sizeof(string),"Player %s has previously connected with following %d names:", playerName, rows);
// adminchat(COLOR_GREEN, string);
for(new i = 0; i < rows; i++)
{
cache_get_field_content(i, "playerName", pName, 1, 50);
pName1[i] = pName;
format(string, sizeof(string),"%s \n%s",string, pName1[i]);
}
adminchat(COLOR_GREEN, string);
IRC_GroupSay(gGroupID, IRC_CHANNEL, string);
}
cache_delete(cacheid);
}