Login-attempts loop doesn't work!
#9

Код:
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(1744) : error 003: declaration of a local variable must appear in a compound block
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(1744) : error 017: undefined symbol "tname"
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(1744) : warning 215: expression has no effect
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(1744) : error 001: expected token: ";", but found "]"
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(1744) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
PHP код:
    public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) {
        switch(
dialogid)
        {
            case 
DIALOG_REGISTER:
            {
                if(!
response)
                    return 
Kick(playerid);
                if(
response)
                {
                    if(!
strlen(inputtext))
                        return 
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
                    if(
INI_Open(getINI(playerid)))
                    {
                        
INI_WriteString("Password",inputtext);
                        
INI_WriteInt("Cash"0);
                        
INI_WriteInt("Admin"0);
                        
INI_WriteInt("FirstTime"0);
                        
INI_WriteInt("Skin"0);
                        
INI_WriteInt("Score"0);
                        
INI_WriteInt("Kills"0);
                        
INI_WriteInt("Deaths"0);
                        
INI_Save();
                        
INI_Close();
                        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
                    }
                }
            } case 
DIALOG_LOGIN:
              {
                if(!
response)
                    return 
Kick playerid );
                if(
response)
                {
                    if(!
strlen(inputtext))
                        return 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
                    if(
INI_Open(getINI(playerid)))
                    {
                        
INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
                        if(
strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
               
                            
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
                            
TimesAttempted[playerid] += 1;
                            if(
TimesAttempted[playerid] == 1SendClientMessage(playerid,COLOR_RED,"Wrong password, 2 login-attempts left!");
                            else if(
TimesAttempted[playerid] == 2SendClientMessage(playerid,COLOR_RED,"Wrong password, 1 login-attempt left!");
                            else if(
TimesAttempted[playerid] == 3)
                            new 
tname[MAX_PLAYER_NAME], string[128];
                            
GetPlayerName(playeridtnamesizeof(tname));
                            
format(rstring,sizeof(rstring),"SYSTEM: Player %s has been kicked by the server (Exceeding login-attempts)!",tname);
                            
SendClientMessageToAll(COLOR_RED,rstring);
                             
Kick(playerid);
                        }
                        else  {
                        
SendClientMessage(playerid,BRIGHT_GREEN,"You have successfully logged in! Welcome back, homie!");
                        
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                        }
                        
                        
GivePlayerMoneyplayeridINI_ReadInt"Cash" ) );
                        
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
                        
PlayerInfo[playerid][pKills] = INI_ReadInt("Kills");
                        
PlayerInfo[playerid][pDeaths] = INI_ReadInt("Deaths");
                        
gFirstTimeHasJoined[playerid] = INI_ReadInt("FirstTime");
                        
gPlayerSkinForEver[playerid] = INI_ReadInt("Skin");
                        
SetPlayerScoreplayeridINI_ReadInt"Score" ) );
                        
INI_Close();
                    }
                }
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread
Login-attempts loop doesn't work! - by Twisted_Insane - 17.02.2012, 16:47
Re: Login-attempts loop doesn't work! - by Twisted_Insane - 17.02.2012, 17:01
Re: Login-attempts loop doesn't work! - by Twisted_Insane - 17.02.2012, 17:33
Re: Login-attempts loop doesn't work! - by Toreno - 17.02.2012, 17:40
Re: Login-attempts loop doesn't work! - by Twisted_Insane - 17.02.2012, 18:09
Re: Login-attempts loop doesn't work! - by Toreno - 17.02.2012, 18:14
Re: Login-attempts loop doesn't work! - by Twisted_Insane - 17.02.2012, 18:23
Re: Login-attempts loop doesn't work! - by Toreno - 17.02.2012, 18:35
Re: Login-attempts loop doesn't work! - by Twisted_Insane - 17.02.2012, 19:09
Re: Login-attempts loop doesn't work! - by Toreno - 17.02.2012, 19:12

Forum Jump:


Users browsing this thread: 1 Guest(s)