2 Command Problem [+REP]
#1

PHP Code:
CMD:unban(playeridparams[])
{
    if(
pInfo[playerid][pLogged] == 1)
    {
        if(
pInfo[playerid][pAdminLevel] >= 2)
        {
            new 
Query[256],bname[24],rowsfields;
            if (
sscanf(params,"s[24]",bname)) return SendClientMessage(playerid,-1,""chat" /unban [name]"); // use sscanf not strlen
            
mysql_format(mysql,Querysizeof(Query), "SELECT `Name` FROM `banlog` WHERE Name = '%e' AND pAccountLock = 1 LIMIT 1"bname);
            
mysql_tquery(mysqlQuery,"","");
            
cache_get_data(rowsfieldsmysql);
            if(!
rows)
            {
                new 
string[200];
                
format(stringsizeof(string), ""chat" Nobody under the name of %s is banned!"bname);
                return 
SendClientMessage(playerid,-1,string);
            }
            else
            {
                
mysql_format(mysql,Querysizeof(Query), "UPDATE `banlog` SET `pAccountLock` = 0 WHERE Name = '%s'"bname);
                
mysql_tquery(mysqlQuery,"","");
                new 
string[200];
                
format(stringsizeof(string), ""chat" %s has been unbanned!"bname);
                
SendClientMessage(playerid0x66FF33string);
            }
        }
    }
    return 
1;

This say everytime Nobody under the .....................................


PHP Code:
CMD:searchip(playeridparams[])
{
    if(
pInfo[playerid][pLogged] != 1) return 0;
    new 
ip[16],rowsfields;
    if(
sscanf(params"s[16]"ip)) return SendClientMessage(playerid, -1""chat" /searchip [IP]");
    new 
query[70], string[75];
    
mysql_format(mysql,querysizeof(query), "SELECT `Username` FROM `users` WHERE `pIP`='%s'"ip); // READ NOTE
    
mysql_tquery(mysqlquery);
    
cache_get_data(rowsfieldsmysql);
    if(!
rows)
    {
        
format(stringsizeof(string), ""chat" Nobody account founded with %s IP!"ip);
        
SendClientMessage(playerid, -1string);
        return 
1;
    }
    else
    {
        
format(stringsizeof(string), ""chat" Names found with %s IP. :"ip);
        
SendClientMessage(playerid, -1string);
        new 
count 1foundname[MAX_PLAYER_NAME];
        while(
cache_get_row_count())
        {
            
cache_get_field_content(0"Username",foundname);
            
strmid(foundnamequery0strlen(query)); // READ NOTE
            
format(stringsizeof(string), ""chat" %d: %s"countfoundname);
            
SendClientMessage(playerid, -1string);
            
count count 1;
        }
    }
    return 
1;

This say nobody account foundet with this ip


Thanks
Reply


Messages In This Thread
2 Command Problem [+REP] - by arlindi - 16.05.2015, 15:39
Re: 2 Command Problem [+REP] - by [FMJ]PowerSurge - 16.05.2015, 15:50
Re: 2 Command Problem [+REP] - by arlindi - 16.05.2015, 19:11
Re: 2 Command Problem [+REP] - by Konstantinos - 16.05.2015, 19:13
Re: 2 Command Problem [+REP] - by arlindi - 16.05.2015, 19:14
Re: 2 Command Problem [+REP] - by Konstantinos - 16.05.2015, 19:23
Re: 2 Command Problem [+REP] - by arlindi - 16.05.2015, 19:54
Re: 2 Command Problem [+REP] - by arlindi - 16.05.2015, 22:00
Re: 2 Command Problem [+REP] - by justice96 - 17.05.2015, 02:26
Re: 2 Command Problem [+REP] - by arlindi - 17.05.2015, 09:22

Forum Jump:


Users browsing this thread: 4 Guest(s)