Login errors
#1

error come from here.

Код:
warning 204: symbol is assigned a value that is never used: "string"
error 035: argument type mismatch (argument 2)
error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Код:
if (PlayerFile_Load(playerid) == 1)
	{
		// Check if the player is still banned
		if (APlayerData[playerid][BanTime] < gettime()) // Player ban-time is passed
		ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_INPUT, TXT_DialogLoginTitle, TXT_DialogLoginMsg, TXT_DialogLoginButton1, TXT_DialogButtonCancel);
		ShowPlayerDialog(playerid, "The password you have entered was incorrect. Attempts(%d)", FailLogin[playerid]);
		else // Player is still banned
		{
			ShowRemainingBanTime(playerid); // Show the remaining ban-time to the player is days, hours, minutes, seconds
			Kick(playerid); // Kick the player
		}
	}
	else
		ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_INPUT, TXT_DialogRegisterTitle, TXT_DialogRegisterMsg, TXT_DialogRegisterButton1, TXT_DialogButtonCancel);
Код:
// Process the login-dialog
#define MAX_FAIL_LOGINS 3
new FailLogin[MAX_PLAYERS];
Dialog_Login(playerid, response, inputtext[])
{
    switch (response) // Check which button was clicked
    {
        case 1: // Player clicked "Login"
        {
            // Check if the player entered a password
            if (strlen(inputtext) > 0)
            {
                // Check if the entered password is the same as the password saved in the player's account
                if (strcmp(APlayerData[playerid][PlayerPassword], inputtext, false) == 0)
                {
                    APlayerData[playerid][LoggedIn] = true; // The player has logged in properly
                    BankFile_Load(playerid); // Load your bank account (if it exists, the player will be notified about this)
                    SendClientMessage(playerid, 0xFFFFFFFF, TXT_LoggedIn); // Send a message to the client to inform him that he logged in properly
                }
                else
                {
                    SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
                    Kick(playerid);
                }
            }
            else
            {
            new string[128];
            FailLogin[playerid]++;
            if(FailLogin[playerid] == MAX_FAIL_LOGINS)
            {
            FailLogin[playerid]++;
            Kick(playerid);
            }
            }
        }
        case 0: // Player clicked "Cancel"
        {
            // Show a message that the player must be logged in to play on this server
            SendClientMessage(playerid, 0xFFFFFFFF, TXT_PlayerMustLogin);
        }
    }

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)