Login 1 Error
#1

1 login error.

Код:
error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Here Code:

Код:
// Process the login-dialog
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)
                }
                else
                {
                    SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
                    Kick(playerid);
                }
            }
            else
            {
            new strs[256];
            new string[128];
            FailLogin[playerid]++;
            format(string, sizeof(strs), "The password you have entered was incorrect. Attempts(%d)", FailLogin[playerid]);
            SendClientMessage(playerid, -1, strs);
            ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_INPUT,"Login",strs,"Login","Cancel");
            if(FailLogin[playerid] == MAX_FAIL_LOGINS)
            {
            format(string, sizeof(string), "has been kicked (Failed Logins)");
            SendClientMessageToAll(-1, string);
            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);
            // Kick the player
            Kick(playerid);
        }
    }

    return 1;
}
Reply
#2

can you show me the line ?
Reply
#3

All of dis.
Код:
new strs[256];
Код:
format(string, sizeof(strs), "The password you have entered was incorrect. Attempts(%d)", FailLogin[playerid]);
SendClientMessage(playerid, -1, strs);
Код:
ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_INPUT,"Login",strs,"Login","Cancel");
Reply
#4

try this
pawn Код:
format(strs, sizeof(strs), "The password you have entered was incorrect. Attempts(%d)", FailLogin[playerid]);
SendClientMessage(playerid, -1, strs);
pawn Код:
ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_INPUT,strs,"Login","Cancel");
Reply
#5

Код:
error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.

PHP код:
// Process the login-dialog
Dialog_Login(playeridresponseinputtext[])
{
    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], inputtextfalse) == 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)
                
}
                else
                {
                    
SendClientMessage(playerid0xFFFFFFFFTXT_WrongPassword);
                    
Kick(playerid);
                }
            }
            else
            {
            new 
strs[256];
            new 
string[128];
            
FailLogin[playerid]++;
            
format(strssizeof(string), "The password you have entered was incorrect. Attempts(%d)"FailLogin[playerid]);
            
SendClientMessage(playerid, -1string);
            
ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_INPUT,strs,"Login","Cancel");
            if(
FailLogin[playerid] == MAX_FAIL_LOGINS)
            {
            
format(stringsizeof(string), "has been kicked (Failed Logins)");
            
SendClientMessageToAll(-1string);
            
Kick(playerid);
            }
            }
        }
        case 
0// Player clicked "Cancel"
        
{
            
// Show a message that the player must be logged in to play on this server
            
SendClientMessage(playerid0xFFFFFFFFTXT_PlayerMustLogin);
            
// Kick the player
            
Kick(playerid);
        }
    }
    return 
1;

Reply
#6

/bump 2 days.still got error.
Reply
#7

pawn Код:
// Process the login-dialog
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)
                }
                else
                {
                    SendClientMessage(playerid, 0xFFFFFFFF, TXT_WrongPassword);
                    Kick(playerid);
                }
            }
            else
            {
            new string[256];
            FailLogin[playerid]++;
            format(string, sizeof(string), "The password you have entered was incorrect. Attempts(%d)", FailLogin[playerid]);
            SendClientMessage(playerid, -1, string);
            ShowPlayerDialog(playerid,Dialog_Login,DIALOG_STYLE_INPUT,string,"Login","Cancel");
            if(FailLogin[playerid] == MAX_FAIL_LOGINS)
            {
            format(string, sizeof(string), "has been kicked (Failed Logins)");
            SendClientMessageToAll(-1, string);
            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);
            // Kick the player
            Kick(playerid);
        }
    }

    return 1;
}
Reply
#8

Код:
error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Код:
error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
What is the exact line of that error?
Reply
#10

it's all with strs.gave me errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)