16.10.2009, 06:04
Hello, I got a little problem here with login dialog..
My script
Dialog will open very well when i start SA:MP
but if i wrote something in the dialog i just can't login
If i now press Cancel button, then server close connection (i have been kicked) - that's correct
But if i write correct password , then i got message it's wrong password
And if i don't write anything, just press spawn button , then i have logged in..
So i can get in without password
Sorry about my bad english..
My script
Код:
public OnPlayerRequestClass(playerid, classid) { if (gPlayerAccount[playerid] != 0) { new s[128],pName[24]; GetPlayerName(playerid, pName, 24); format(s,sizeof(s),"Welcome, %s!\n\nYou have to login for playing!\n\nPlease enter your password:",pName); ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Game login:",s,"Login","Cancel"); } return 1; }
but if i wrote something in the dialog i just can't login
Код:
if(dialogid == 2) { if(!response) { Kick(playerid); } else { if(strcmp(PlayerInfo[playerid][pKey],inputtext, true ) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "You have been logged in, Welcome !"); SendClientMessage(playerid, COLOR_GREEN, "Press 'Spawn' to continue "); gPlayerLogged[playerid] = 1;
But if i write correct password , then i got message it's wrong password
And if i don't write anything, just press spawn button , then i have logged in..
So i can get in without password
Sorry about my bad english..