12.03.2010, 19:14
I have a problem with my login system, if I click Login to log in my server it kicks me and if I click cancel it kicks me, too sending: You must be logged in!
Here's the code:
Here's the code:
pawn Код:
if(dialogid == DIALOG_BANK+1 || dialogid == DIALOG_BANK+2)
{
if(!response) SendClientMessage(playerid, COLOR_WHITE, "You must be logged in!");Kick(playerid);
{
if(strlen(inputtext))
{
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"Welcome %s ! \n\nThe password is wrong!\n\n\n\n\nWarHaze - The GodFather",loginname);
ShowPlayerDialog(playerid,DIALOG_BANK+2,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { BanEx(playerid,"Wrong password"); PlayerInfo[playerid][pLocked] = 1; }
}
}
if(dialogid == DIALOG_BANK+3)
{
if(strlen(inputtext))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "That nick is already taken, chose another.");
fclose(hFile);
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
else
{
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Welcome %s !\n\nYou don't have an account ! Plase write your password in the Login Box !\n\n\n\n\nWarHaze - The GodFather",regname);
ShowPlayerDialog(playerid,DIALOG_BANK+3,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
}
}
}