DIALOG BUG - Help
#1

Hello, i've a dialog for Rcon Security.
its working fine if i type correct defined password. and working fine if i put wrong passowrd.
but it bugs when i leave empty. and press enter without entering any password, its give response. instead of kicking, or counting rconattemps.

here is my code.

On Top i've defined
PHP код:
#define SECOND_RCON_DIALOG 2018
#define SECOND_RCON_PASSWORD "mypassword" 
variable for counting attemps.
PHP код:
new SecondRconAttemps[MAX_PLAYERS]; 
OnRconLoginAttemp( ... )
PHP код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!
success)
    {
      for(new 
0MAX_PLAYERSi++)
      {
       if(
strcmp(ipPlayerIp(i), true) == 0)
       {
           
SendClientMessage(i,COLOR_DEAD,"You Have Been Kicked Due To Attempting Wrong Rcon Password.");
        
KickEx(i);
        break;
       }
      }
    }
    else
    {
      for(new 
0MAX_PLAYERSi++)
      {
       if(
strcmp(ipPlayerIp(i), true) == 0)
       {
       
SendClientMessage(iCOLOR_ADMIN"Please Enter Second Rcon Password.");
       new 
str1[120];
       
format(str1,sizeof(str1),"%s(%d) Has Been Logged In As First Rcon Admin."PlayerInfo[i][pName], i);
       
ShowPlayerDialog(,SECOND_RCON_DIALOG ,DIALOG_STYLE_PASSWORD,"{FFFFFF}Second Rcon Password","Admin MAXIMUM Security.\nPlease Enter Second Rcon Password To Become Complete Rcon Admin\nOtherwise Get Kicked","login","kick");
       break;
       }
      }
    }
    return 
1;

Under
OnDialogResponse
PHP код:
switch( dialogid )
{
        case 
SECOND_RCON_DIALOG:
        {
        if(!
response) return Kick(playerid);
        if(
response)
        {
        if(!
strcmp(inputtextSECOND_RCON_PASSWORDtrue))
        {
        new 
str[120];
        
format(str,sizeof(str),"[SUCCESS 2ndRcon Pass] %s (%d) Has Been Completely Logged In As Rcon Admin."PlayerInfo[playerid][pName], playerid);
        print(
str);
        
SendClientMessage(playeridCOLOR_ADMIN,"Logged In Completely As Rcon Admin.");
        }else{
        
SecondRconAttemps[playerid] ++;
        if(
SecondRconAttemps[playerid] == 1)
        {
        
SendClientMessage(playeridCOLOR_ERROR"Wrong Second Rcon Password - 1/3");
        
ShowPlayerDialog(playerid ,SECOND_RCON_DIALOG ,DIALOG_STYLE_PASSWORD,"{FFFFFF}Second Rcon Password","Admin MAXIMUM Security.\nPlease Enter Second Rcon Password To Become Complete Rcon Admin\nOtherwise Get Kicked","login","kick");
        }
        if(
SecondRconAttemps[playerid] == 2)
        {
        
SendClientMessage(playeridCOLOR_ERROR"Wrong Second Rcon Password - 2/3");
        
ShowPlayerDialog(playerid ,SECOND_RCON_DIALOG ,DIALOG_STYLE_PASSWORD,"{FFFFFF}Second Rcon Password","Admin MAXIMUM Security.\nPlease Enter Second Rcon Password To Become Complete Rcon Admin\nOtherwise Get Kicked","login","kick");
        }
        if(
SecondRconAttemps[playerid] == 3)
        {
        
SendClientMessage(playeridCOLOR_ERROR"Wrong Second Rcon Password - 3/3 - KICKED");
        
ShowPlayerDialog(playerid ,SECOND_RCON_DIALOG ,DIALOG_STYLE_PASSWORD,"{FFFFFF}Second Rcon Password","Admin MAXIMUM Security.\nPlease Enter Second Rcon Password To Become Complete Rcon Admin\nOtherwise Get Kicked","login","kick");
        
KickEx(playerid);
        }
        return 
1;
        }
        }
    }

Reply


Messages In This Thread
DIALOG BUG - Help - by danish007 - 26.12.2014, 20:08
Re: DIALOG BUG - Help - by danish007 - 27.12.2014, 09:14
Re: DIALOG BUG - Help - by Luicy. - 27.12.2014, 09:51
Re: DIALOG BUG - Help - by danish007 - 27.12.2014, 11:25
Re: DIALOG BUG - Help - by JaydenJason - 27.12.2014, 12:29
Re: DIALOG BUG - Help - by danish007 - 27.12.2014, 21:10
Re: DIALOG BUG - Help - by Ahmad45123 - 27.12.2014, 22:13
Re: DIALOG BUG - Help - by danish007 - 30.12.2014, 05:56

Forum Jump:


Users browsing this thread: 1 Guest(s)