SA-MP Forums Archive
MySQL error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL error (/showthread.php?tid=659419)



MySQL error - Score - 02.10.2018

What's wrong here? And if someone knows the solution, can you please post the code?

PHP код:
CMD:listip(playeridparams[])
{
    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(playeridCOLOR_LIGHTBLUE"[USAGE]: {FFFFFF}/listip [ip address]");
    
mysql_format(Databasequerysizeof query"SELECT * FROM `players` WHERE IP LIKE '%e'"ip);  
    
mysql_tquery(Databasequery"IPAddressQuery""s"ip);
    return 
1;
}
forward IPAddressQuery(playeridip);
public 
IPAddressQuery(playeridip)
{
    if(!
cache_num_rows()) return SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Accounts with that IP Address were not found.");
    new 
string[128], Name[32];
     
    for(new 
icache_num_rows(); i++)
    { 
        
cache_get_value_name(i"Username"Name);
        
format(stringsizeof(string), "Found '%s' with the same IP Address"Name);
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    }
    return 
1;

The command does not work, it just doesn't send a message when i do /listip 127.0.0.1