What's wrong here? And if someone knows the solution, can you please post the code?
PHP код:
CMD:listip(playerid, params[])
{
new query[200], ip[30];
if(PlayerInfo[playerid][Admin] < 3) return SendErrorMessage(playerid, "You are not authorized to use that command.");
if(sscanf(params, "s[30]", ip)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "[USAGE]: {FFFFFF}/listip [ip address]");
mysql_format(Database, query, sizeof query, "SELECT * FROM `players` WHERE IP LIKE '%e'", ip);
mysql_tquery(Database, query, "IPAddressQuery", "s", ip);
return 1;
}
forward IPAddressQuery(playerid, ip);
public IPAddressQuery(playerid, ip)
{
if(!cache_num_rows()) return SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Accounts with that IP Address were not found.");
new string[128], Name[32];
for(new i; i < cache_num_rows(); i++)
{
cache_get_value_name(i, "Username", Name);
format(string, sizeof(string), "Found '%s' with the same IP Address", Name);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
return 1;
}
The command does not work, it just doesn't send a message when i do /listip 127.0.0.1