19.05.2012, 08:47
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.
How can i fix this?
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;


