Show Login/Register OnPlayerRequestClass
#1

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?
Reply
#2

put in under
pawn Код:
public OnPlayerConnect
Reply
#3

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.
Reply
#4

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)