Trying to make an aka command in mysql but not working
#1

PHP Code:
CMD:aka(playerid,params[])   
{   
    if(
pInfo[playerid][AdminLvl] >= 2)
    {
        new 
minfo[500],pID,ip[16];
        if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"USAGE: /aka [playerid]");
        
pID strval(params);
        if(!
IsPlayerConnected(pID)) return SendClientMessage(playerid,-1,"Invalid playerid");  
        new 
str[128], Cache:reuslt
        
GetPlayerIp(pIDipsizeof(ip));
        
mysql_format(gSQLstrsizeof(str), "SELECT * FROM `Users` WHERE `IP`= %s",ip); 
        
reuslt mysql_query(gSQLstrtrue); 
        new 
count cache_num_rows(); 
        new 
string[1024];
        if(
count 0
        { 
            new 
i
            new 
Id,Name[150],Scores,Ip[16],Reg_Date[24]; 
            for(
0counti++) 
            { 
                
cache_get_value_int(i"Id"Id); 
                
cache_get_value_name(i"Name"Name); 
                
cache_get_value_int(i"Score"Scores); 
                
cache_get_value_name(i,"IP",Ip);
                
cache_get_value_name(i,"Reg",Reg_Date);
                
format(minfo,sizeof(minfo),"\n%d\t%s\t%d\t%s\t%s",Id,Name,Scores,Ip,Reg_Date);
                
strcat(stringminfo);
            }
            new 
string2[1024];
            
format(string2sizeof string2"Id\tName\tScore\tIp\tReg_Date\n%s"string);
            
ShowPlayerDialog(playerid123DIALOG_STYLE_TABLIST_HEADERS," {FFFFFF}-{00FF00}Accounts On Player Ip",string2"Okay""Close"); 
        } 
        
cache_delete(reuslt); 
    }
    else
    {
        return -
1;
    }
    return 
1

when player id is provide nothing shown
Reply


Messages In This Thread
Trying to make an aka command in mysql but not working - by Jokers98s - 17.02.2018, 09:33
Re: Trying to make an aka command in mysql but not working - by PepsiCola23 - 17.02.2018, 09:40
Re: Trying to make an aka command in mysql but not working - by Mugala - 17.02.2018, 09:42

Forum Jump:


Users browsing this thread: 1 Guest(s)