26.03.2013, 02:18
I'm using LuxAdmin, when i restart the server (My host control panel) then the register dialog appears, even when the player is already registered, and this dialog doesn't work anyway.
But, if i just /q, or if i was a new player, then it would Login/register fine.
This is my code in OnPlayerConnect.
This is how they register/login.
But, if i just /q, or if i was a new player, then it would Login/register fine.
This is my code in OnPlayerConnect.
pawn Код:
public OnPlayerConnect(playerid)
{
//==============================================================================
// Request Register
//==============================================================================
if(AccInfo[playerid][Registered] == 0 && ServerInfo[MustRegister] == 1)
{
#if USE_DIALOGS == true
new rstring[256];
format(rstring,256,"{15FF00}Welcome to {FF0000}%s\n{15FF00}\n{15FF00}Account '%s' is not registred!\n{FFFFFF}\n{FFFFFF}Enter the password to Register your Account:",GetServerHostName(),pName(playerid));
ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE_INPUT,"Register Account",rstring,"Register","Quit");
#endif
return 1;
}
//==============================================================================
// Request Login
//==============================================================================
if(ServerInfo[MustLogin] == 1 && AccInfo[playerid][Registered] == 1 && AccInfo[playerid][LoggedIn] == 0)
{
#if USE_DIALOGS == true
new lstring[256];
format(lstring,green,"{15FF00}That account '%s 'is Registered!\n{15FF00}\n{FFFFFF} Login to access your Account:",pName(playerid));
ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE_INPUT, "Login Account",lstring,"Login","Quit");
#endif
return 1;
}
This is how they register/login.
pawn Код:
if(strlen(dini_Get("LuxAdmin/Config/aka.txt", tmp3)) == 0)
dini_Set("LuxAdmin/Config/aka.txt", tmp3, PlayerName);
else
{
if( strfind( dini_Get("LuxAdmin/Config/aka.txt", tmp3), PlayerName, true) == -1 )
{
format(string,sizeof(string),"%s,%s", dini_Get("LuxAdmin/Config/aka.txt",tmp3), PlayerName);
dini_Set("LuxAdmin/Config/aka.txt", tmp3, string);
}
}
if(!udb_Exists(PlayerName2(playerid)))
SendClientMessage(playerid,orange, "SERVER: Your account isn't registered. Please register (/"#RegisterCommand")");
else
{
AccInfo[playerid][Registered] = 1;
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName));
new tmp2[256]; tmp2 = dini_Get(file,"Ip");
if( (!strcmp(tmp3,tmp2,true)) && (ServerInfo[AutoLogin] == 1))
{
LoginPlayer(playerid);
if(AccInfo[playerid][Level] > 0)
{
switch(AccInfo[playerid][Level])
{
case 1: AdmRank = "Starter Administrator";
case 2: AdmRank = "Junior Administrator";
case 3: AdmRank = "Intermediate Administrator";
case 4: AdmRank = "Head Administrator";
case 5: AdmRank = "Executive Admin";
case 6: AdmRank = "Co-Owner";
case 7: AdmRank = "Owner";
}
if(AccInfo[playerid][Level] > 6)
{
AdmRank = "Co-Owner";
}
if(AccInfo[playerid][Level] > 7)
{
AdmRank = "Server Owner";
}