I need help to check if player exist MYSQL
#9

PHP код:
else if(dialogid == 28)
{
    new 
nlocalreffer[30];
    if(!
response)
    {
        
SendClientMessage(playerid, -1"YOU SELECT NO... SO NO ONE REFFER YOU!");
        
nlocalreffer "Empty";
        
reffer[playerid] = nlocalreffer;
        
firstlogin[playerid] = false;
        
ChangeClass(playerid);
    }
    else if(
response)
    {
        if(!
strlen(inputtext))
        {
            
SendClientMessage(playerid, -1"YOU DONT WRITE A NAME... SO NO ONE REFFER YOU!");
            
nlocalreffer "Empty";
            
reffer[playerid] = nlocalreffer;
            
firstlogin[playerid] = false;
            
ChangeClass(playerid);
        }
        else
        {
            
format(nlocalreffersizeof nlocalrefferinputtext);
            if(!
strcmp(nlocalrefferPlayerName(playerid), true))
            {
                
SendClientMessage(playeridCOLOR_LIGHTRED"YOU CAN NOT PUT YOUR OWN NAME!");
                
QuemReferenciou(playerid);
                return 
1;
            }
            else
            { 
// sucesso
            
                
new query[160], refferername[MAX_PLAYER_NAME+1];
                
format(refferername,sizeof(refferername),"%s",inputtext);
                
mysql_format(ConnectMYSQLquerysizeof(query), "SELECT Username FROM `accounts` WHERE `Username` = '%s'"refferername ); //SELECT * FROM accounts WHERE Name = %s TROQUE PELA QUAL ESTA NO SEU BANCO DE DADOS
                
mysql_function_query(ConnectMYSQLquerytrue"CheckRefferExist","is",playerid,refferername);
            }
        }
    }

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)