06.01.2017, 12:05
Hey,
i have a command for searching accounts trough database when I enter the IP, but its always saying "no matches found" (german clientmessage).
For example my Ip is :
46.**.***.**
And then i type /searchdb 46 (only 46), i want all accounts which had the last ip with beginning "46".
Its not working actually, can somebody help :
i have a command for searching accounts trough database when I enter the IP, but its always saying "no matches found" (german clientmessage).
For example my Ip is :
46.**.***.**
And then i type /searchdb 46 (only 46), i want all accounts which had the last ip with beginning "46".
Its not working actually, can somebody help :
Код:
ocmd:searchip(playerid, params[]) { if(!IsAdmin(playerid, 1))return noaccess if(sscanf(params,"s", iptofind))return SendClientMessage(playerid, WEIЯ, "Verwendung: /searchip (IP)"); new iptofind[16]; new query[256]; format(query, sizeof(query), "SELECT last_ip, name FROM spieler WHERE(last_ip LIKE '%s')", iptofind); mysql_query(query); new rows = mysql_num_rows(); new tmp[2][128], str[256]; new count=0; for(new i=0; i<rows; i++) { mysql_retrieve_row(); mysql_fetch_field_row(tmp[0], "last_ip"); mysql_fetch_field_row(tmp[1], "name"); format(str, sizeof(str),"[IP-SUCHE] Es wurde eine Ьbereinstimmung mit %s (%s) gefunden.", tmp[0],tmp[1]); SendClientMessage(playerid, ROT, str); count++; } mysql_free_result(); if(count==0) { SendClientMessage(playerid, GRAU, "[IP-SUCHE] Es wurden keine Ьbereinstmmungen gefunden."); } return 1; }