SA-MP Forums Archive
Show Login/Register OnPlayerRequestClass - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Show Login/Register OnPlayerRequestClass (/showthread.php?tid=343882)



Show Login/Register OnPlayerRequestClass - Admigo - 19.05.2012

Heey all,

I have a problem with my login/register system.
I made the dialog on OnPlayerRequestClass but when the server crash or i disconnect cause of lost connection next time when i join the login screen dont shows.
Код:
//onplayerrequestclass
if(PlayerInfo[playerid][LoggedIn] == 0)//if login screen dont work in onplayerconnect then remove the //
	{
		new PlayerName[MAX_PLAYER_NAME], file[256]; //file[256];
		GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
		new tmp3[50]; GetPlayerIp(playerid,tmp3,50);


		if(udb_Exists(PlayerName2(playerid)))
	    {
	        PlayerInfo[playerid][Registered] = 1;
			format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName));
			new tmp2[256]; tmp2 = dini_Get(file,"ip");
	        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFF00}Login to Admigo's Cops And Robbers!","Type your password below to login.","Login","Quit");
	    }        //ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_RED"Login to Admigo's Cops And Robbers!",""COL_WHITE"Welcome to Admigo's Cops And Robbers","Login","Quit");
	    else
	    {
	        //ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
	        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{FFFF00}Register to Admigo's Cops And Robbers!","Type your password below to register a new account.","Register","Quit");
		}
	}
	if(PlayerInfo[playerid][LoggedIn] == 1)
	{
		return 1;
	}
//onplayerconnect
PlayerInfo[playerid][LoggedIn] =0;
//onplayerdisconnect
PlayerInfo[playerid][LoggedIn] =0;
How can i fix this?


Re: Show Login/Register OnPlayerRequestClass - Flake. - 19.05.2012

put in under
pawn Код:
public OnPlayerConnect



Re: Show Login/Register OnPlayerRequestClass - Admigo - 19.05.2012

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
put in under
pawn Код:
public OnPlayerConnect
U mean the login/register screen? I saw some servers who got the screen OnPlayerRequestClass.


Re: Show Login/Register OnPlayerRequestClass - JaKe Elite - 19.05.2012

You have to toggle player spectating when using Login/Register screen.
I don't need login/register screen since its useless.


Re: Show Login/Register OnPlayerRequestClass - Admigo - 19.05.2012

What do you mean with togglePlayerSpectating? I want the login/register on OnPlayerRequestClass so i can make a welcome screen at OnPlayerLogin.


Re: Show Login/Register OnPlayerRequestClass - Twisted_Insane - 19.05.2012

Show the login / register - dialog simply under "OnPlayerConnect"...