27.02.2015, 22:27
PHP код:
CMD:searchip(playerid, params[])
{
if(pInfo[playerid][pLogged] == 1)
{
new Query[256];
if (!strlen(params)) return SendClientMessage(playerid,-1,""chat" /searchip [IP]");
format(Query, sizeof(Query), "SELECT * FROM `users` WHERE pIP = '%s'", escstring(params));
mysql_query(Query);
mysql_store_result();
if(!mysql_num_rows())
{
new string[200];
format(string, sizeof(string), ""chat" Nobody account founded with %s IP!", params);
mysql_free_result();
return SendClientMessage(playerid,-1,string);
}
else if(mysql_num_rows() != 0)
{
format(Query, sizeof(Query), "UPDATE `banlog` SET `pAccountLock` = 0 WHERE Name = '%s'", escstring(params));
mysql_query(Query);
mysql_store_result();
new string[200];
format(string, sizeof(string), ""chat" %s Is founded", params);
SendClientMessage(playerid, 0x66FF33, string);
}
}
return 1;
}
It work when the ip dont exist
But i want to show accounts with dhat ip