Problem show dialog!
#7

Check! i have return 1.. and no i not add register/login in the bancheck. Check i paste my code!! In OnPlayer connect i have before Bancheck fuction and after my normal register / login

PHP код:
public OnPlayerConnect(playerid)
{
    
SendDeathMessage(INVALID_PLAYER_IDplayerid200);
    for( new 
i_PlayerInfo; ++pInfoplayerid ][ PlayerInfo] = 0;
    
//------------------[ANTI-BOTS]------------------
    
new ConnIP[16];
    
GetPlayerIp(playerid,ConnIP,16);
    new 
compare_IP[16];
    new 
number_IP 0;
    for(new 
i=GetPlayerPoolSize(); != -1i--) {
        if(
IsPlayerConnected(i)) {
            
GetPlayerIp(i,compare_IP,16);
            if(!
strcmp(compare_IP,ConnIP)) number_IP++;
        }
    }
    if((
GetTickCount() - Join_Stamp) < Time_Limit)
        
exceed=1;
    else
        
exceed=0;
     if(
strcmp(ban_sConnIPfalse) == && exceed == )
     {
         
Same_IP++;
         if(
Same_IP SAME_IP_CONNECT)
         {
               
BanEx(playerid"BOTS");
             
Same_IP=0;
         }
     }
     else
     {
         
Same_IP=0;
    }
    if(
number_IP IP_LIMIT)
        
Kick(playerid);
    
GetStampIP(playerid);
    if(
IsPlayerNPC(playerid))
    {
        new 
server_IP[16];
        
format(server_IP16"127.0.0.1");
        if(
strcmp(ConnIP,server_IP,true) != 0)
        {
            
BanEx(playerid"BOTS"); // Ban is the safest thing here, as if you kick, they can still flood you with endless connections
            
return 0;
        }
    }
    
//----------------------------------------------
    //-------------[CHECK BAN]--------------
        
BanCheck(playerid);
    
//----------------------------------------------
    //-------------[Login-Register]--------------
    
new
        
Query256 
    ;
    
pInfo[playerid][USER_LOGGED_IN] = false
   
    
format(Querysizeof(Query), "SELECT `Username` FROM `users` WHERE `Username` = '%s' COLLATE NOCASE"DB_Escape(GetPlayerName(playerid)));
  
    
queryresult db_query(DatabaseQuery);
   
    if(
db_num_rows(queryresult))
    {
        
        
format(Querysizeof(Query), ""COL_WHITE"Welcome, this account ("COL_BLUE"%s)"COL_WHITE" is registered\nPlease enter the password to login\n\n"COL_GRIS"If you are not the owner of this account, leave and rejoin with a different nickname"GetPlayerName(playerid), playerid);
        
        
ShowPlayerDialog(playeriddloginDIALOG_STYLE_PASSWORD""COL_BLUE"Login Panel"Query"Login""Leave");
    }
    else
    {
    
        
format(Querysizeof(Query), ""COL_WHITE"Welcome, this account ("COL_RED"%s)"COL_WHITE" is not registered\nPlease enter your desired password for this account\n\n"COL_GRIS"Once you are registered, do not share your password with anyone besides yourself!"GetPlayerName(playerid), playerid);
        
ShowPlayerDialog(playeriddregisterDIALOG_STYLE_PASSWORD""COL_BLUE"Register Panel"Query"Register""Leave");
    }
    
db_free_result(queryresult);
return 
1;

Reply


Messages In This Thread
Problem show dialog! - by Cerealguy - 01.12.2016, 05:14
Re: Problem show dialog! - by Alpay0098 - 01.12.2016, 10:48
Respuesta: Re: Problem show dialog! - by Cerealguy - 02.12.2016, 03:18
Re: Problem show dialog! - by ImVictor - 02.12.2016, 03:23
Respuesta: Problem show dialog! - by Cerealguy - 02.12.2016, 03:32
Re: Problem show dialog! - by Logic_ - 02.12.2016, 03:35
Respuesta: Problem show dialog! - by Cerealguy - 02.12.2016, 03:41
Respuesta: Problem show dialog! - by Cerealguy - 02.12.2016, 04:47
Respuesta: Problem show dialog! - by Cerealguy - 04.12.2016, 15:36

Forum Jump:


Users browsing this thread: 1 Guest(s)