Login problem
#1

Hi,

Here is problem, when player type incorrect password, he can't type again, immediately showing request class.
Logical is, player must first be logged, and then request class.
Код:
public OnPlayerRequestClass(playerid, classid)
{
       Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
       Update3DTextLabelText(Duty[playerid], 0xFFFFFFFF, " ");
       Update3DTextLabelText(DM[playerid], 0xFFFFFFFF, " ");
       {PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);}
	new String[200];
	new team1count = GetTeamCount(TEAM_EURASIA);
        new team2count = GetTeamCount(TEAM_USA);
        new team3count = GetTeamCount(TEAM_ARAB);
        new team4count = GetTeamCount(TEAM_SOVIET);
        new team5count = GetTeamCount(TEAM_AUS);
       new team7count = GetTeamCount(TEAM_MERC);
	format(String, sizeof(String),""cblue"Usa [P:%d]\n"cgreen"Eurasia [P:%d]\n"cyellow"Arabica [P:%d]\n"cred"Soviet [P:%d]\n"cpurple"Austraillia [P:%d]\nMercenary [P:%d]",team2count, team1count, team3count, team4count, team5count, team7count);
	if(PlayerInfo[playerid][LoggedIn] == 0)
	{
		ShowPlayerDialog(playerid, 1432, DIALOG_STYLE_LIST, "Select Team",String,"Select","Back");
	}
	else
	{
	    SendClientMessage(playerid, RED,"You must be logged.");
	}
	return 1;
	
}
Thanks.
Reply
#2

Am... I think you did not make a if function when the player types an incorrect password.
If the password is wrong, just show the dialog again.
Reply
#3

I'm change cods, now show again login, but after this, not showing request class.
Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, RED,"You must be logged.");

    Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
    Update3DTextLabelText(Duty[playerid], 0xFFFFFFFF, " ");
    Update3DTextLabelText(DM[playerid], 0xFFFFFFFF, " ");
	{PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);}
	new String[200];
	new team1count = GetTeamCount(TEAM_EURASIA);
    new team2count = GetTeamCount(TEAM_USA);
    new team3count = GetTeamCount(TEAM_ARAB);
    new team4count = GetTeamCount(TEAM_SOVIET);
    new team5count = GetTeamCount(TEAM_AUS);
    new team7count = GetTeamCount(TEAM_MERC);
	format(String, sizeof(String),""cblue"Usa [P:%d]\n"cgreen"Eurasia [P:%d]\n"cyellow"Arabica [P:%d]\n"cred"Soviet [P:%d]\n"cpurple"Austraillia [P:%d]\nMercenary [P:%d]",team2count, team1count, team3count, team4count, team5count, team7count);
	ShowPlayerDialog(playerid, 1432, DIALOG_STYLE_LIST, "Select Team",String,"Select","Back");
	return 1;
}
Reply
#4

The code doesn't have errors... Maybe you used SpawnPlayer somewhere. Look in OnDialogResponse.

@edit

Try this.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid, RED,"You must be logged.");
    else
    {
    Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF, " ");
    Update3DTextLabelText(Duty[playerid], 0xFFFFFFFF, " ");
    Update3DTextLabelText(DM[playerid], 0xFFFFFFFF, " ");
    {PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);}
    new String[200];
    new team1count = GetTeamCount(TEAM_EURASIA);
    new team2count = GetTeamCount(TEAM_USA);
    new team3count = GetTeamCount(TEAM_ARAB);
    new team4count = GetTeamCount(TEAM_SOVIET);
    new team5count = GetTeamCount(TEAM_AUS);
    new team7count = GetTeamCount(TEAM_MERC);
    format(String, sizeof(String),""cblue"Usa [P:%d]\n"cgreen"Eurasia [P:%d]\n"cyellow"Arabica [P:%d]\n"cred"Soviet [P:%d]\n"cpurple"Austraillia [P:%d]\nMercenary [P:%d]",team2count, team1count, team3count, team4count, team5count, team7count);
    ShowPlayerDialog(playerid, 1432, DIALOG_STYLE_LIST, "Select Team",String,"Select","Back");
    return 1;
}
    }
Reply
#5

Problem is still.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)