Login Dialog
#1

Hello, I got a little problem here with login dialog..


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;
}
Dialog will open very well when i start SA:MP

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;
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..
Reply


Messages In This Thread
Login Dialog - by Kohva - 16.10.2009, 06:04
Re: Login Dialog - by Abhishek - 16.10.2009, 06:17
Re: Login Dialog - by Kohva - 16.10.2009, 06:22
Re: Login Dialog - by Abhishek - 16.10.2009, 07:04
Re: Login Dialog - by Kohva - 16.10.2009, 08:04

Forum Jump:


Users browsing this thread: 2 Guest(s)