[Help] LuxAdmin Script error
#1

Hello , i just downloaded Lux Admin System but when i added it (according to the instructions) and i enter the server . I try to register by entering my password but my account can't be register . Any one will tell me the solution please . I can't register when i type my password and click on register the dialog box disappear.
Reply
#2

somebody please help me i can't register . No Dialog Box Appears after Clicking on Register
Following is the code :

PHP код:
public OnPlayerRequestSpawn(playerid)
{
    
// Request Register
    #if USE_DIALOGS == false
    
if(AccInfo[playerid][Registered] == && ServerInfo[MustRegister] == && (!IsPlayerNPC(playerid))){
    
SendClientMessage(playerid,lightred,"SERVER: Your account isn't registered. Please Register! | /"#RegisterCommand" [Password]");
    
return 0;
    }
    
// Request Login
    
if(ServerInfo[MustLogin] == && AccInfo[playerid][Registered] == && AccInfo[playerid][LoggedIn] == && (!IsPlayerNPC(playerid))){
     
SendClientMessage(playerid,lightred,"SERVER: Your account is registered. Please Login! | /"#LoginCommand" [Password]");
    
return 0;
    }
    
#endif
    
return 1;
    }
//==============================================================================
//-------------------------------------------------
// Player Spawn
//-------------------------------------------------
//==============================================================================
public OnPlayerSpawn(playerid)
{
//==============================================================================
// Request Register
//==============================================================================
/*
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        new string[256];
        ShowPlayerDialog(playerid,DIALOGID+66,DIALOG_STYLE_INPUT,"Register Account",rstring,"Register","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
    */
        
if(AccInfo[playerid][Registered] == && ServerInfo[MustRegister] == 1)
    {
        
#if USE_DIALOGS == true
        
new rstring[256];
        
format(rstring,256,"Welcome to the '%s'\n\nAccount '%s' is not registred!\n\nEnter 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] == && AccInfo[playerid][Registered] == && AccInfo[playerid][LoggedIn] == 0)
    {
        
#if USE_DIALOGS == true
        
new lstring[256];
        
format(lstring,256,"That account '%s 'is Registered!\n\n Login to access your Account:",pName(playerid));
        
ShowPlayerDialog(playerid,DIALOGID+67,DIALOG_STYLE_INPUT,"Login Account",lstring,"Login","Quit");
        
#endif
        
return 1;
    } 
Here is the DialogResponse Code :

PHP код:
/==============================================================================
//---------------
// Dialog - REGISTER
//---------------
//==============================================================================
    
if (dialogid == DIALOGID+66)
    {
         if(
response == && ServerInfo[MustRegister] == 1)
        {
            
Kick(playerid);
        }
         if(
response)
        {
            if (
strlen(inputtext) < || strlen(inputtext) > 20)
            {
                new 
rstring[256];
                
format(rstring,256,"Sorry %s\n\nThe length of your password should contain more \nthan 3 characters and less than 20 characters! \n\n Please, re-enter the Password:",pName(playerid));
                return 
ShowPlayerDialog(playerid,DIALOGID+68,DIALOG_STYLE_INPUT,"Register Error!",rstring,"Register","Quit");
            }
             if (
udb_Create(PlayerName2(playerid)))
            {
                
ShowPlayerDialog(playerid,DIALOG_TYPE_QUESTION,DIALOG_STYLE_INPUT,"LuxAdmin - Account Safety Question","Type a security question, for when you forget\n your password, you just answer this Question.","Next","End");
                new 
file[256],name[MAX_PLAYER_NAME], buf[145],tmp3[100];
                 new 
strdate[20], year,month,day;
                
getdate(yearmonthday);
                  
WP_Hash(bufsizeof(buf), inputtext);
                
GetPlayerName(playerid,name,sizeof(name));
                
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(name));
                
GetPlayerIp(playerid,tmp3,100);
                
dini_Set(file,"Password",buf);
                
dini_Set(file,"Ip",tmp3);
                
dUserSetINT(PlayerName2(playerid)).("Registered",1);
                
format(strdatesizeof(strdate), "%d/%d/%d",day,month,year);
                
dini_Set(file,"RegisteredDate",strdate);
                
dUserSetINT(PlayerName2(playerid)).("Loggedin",1);
                
dUserSetINT(PlayerName2(playerid)).("Banned",0);
                
dUserSetINT(PlayerName2(playerid)).("Level",0);
                
dUserSetINT(PlayerName2(playerid)).("AccountType",0);
                
dUserSetINT(PlayerName2(playerid)).("LastOn",0);
                
dUserSetINT(PlayerName2(playerid)).("Money",0);
                
dUserSetINT(PlayerName2(playerid)).("Kills",0);
                
dUserSetINT(PlayerName2(playerid)).("Deaths",0);
                
dUserSetINT(PlayerName2(playerid)).("WantedLevel",0);
                
#if SaveScore == true
                
dUserSetINT(PlayerName2(playerid)).("Score",0);
                
#endif
                
dUserSetINT(PlayerName2(playerid)).("Hours",0);
                
dUserSetINT(PlayerName2(playerid)).("Minutes",0);
                
dUserSetINT(PlayerName2(playerid)).("Seconds",0);
                
AccInfo[playerid][LoggedIn] = 1;
                
AccInfo[playerid][Registered] = 1;
                
SendClientMessage(playeridgreen"|- You are now Registered, and have been automaticaly Logged in! -|");
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                return 
1;
            }
        }
        return 
1;
    }
//==============================================================================
//---------------
// Dialog - LOGIN
//---------------
//==============================================================================
    
if (dialogid == DIALOGID+67)
    {
         if(
response == && ServerInfo[MustLogin] == 1)
        {
            
Kick(playerid);
        }
         if(
response)
        {
            new 
lstring[256];
            new 
file[128], Pass[256];
            
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)));
            
Pass dini_Get(file"Password");
             new 
buf[145];
             
WP_Hash(bufsizeof(buf), inputtext);
             
             
AccInfo[playerid][NoQuestion] = dUserINT(PlayerName2(playerid)).("NoQuestion");
            if(
strcmp(Passbuffalse) == 0)
            {
                new 
tmp3[100], string[128];
                   
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)));
                
GetPlayerIp(playerid,tmp3,100);
                
dini_Set(file,"Ip",tmp3);
                
LoginPlayer(playerid);
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                if(
AccInfo[playerid][Level] > 0)
                {
                    switch(
AccInfo[playerid][Level])
                    {
                    case 
1AdmRank "Basic Moderator";
                    case 
2AdmRank "Moderator";
                    case 
3AdmRank "Master Moderator";
                    case 
4AdmRank "Administrator";
                    case 
5AdmRank "Master Administrator";
                    }
                    if(
AccInfo[playerid][Level] > 5)
                    {
                        
AdmRank "Professional Admin";
                    }
                    if(
AccInfo[playerid][pVip] > 0)
                    {
                        switch(
AccInfo[playerid][pVip])
                        {
                        case 
1AccType "Silver";
                        case 
2AccType "Gold";
                        case 
3AccType "Premium";
                        }
                        
format(string,sizeof(string),"|- You have Successfully Logged! | Account: %s | Level %d - %s -|"AccTypeAccInfo[playerid][Level], AdmRank);
                        return 
SendClientMessage(playerid,0x00C378AA,string);
                    }
                    else
                    {
                        
format(string,sizeof(string),"|- You have Successfully Logged! | Level %d - %s -|"AccInfo[playerid][Level], AdmRank);
                        return 
SendClientMessage(playerid,green,string);
                    }
                }
                else
                {
                    if(
AccInfo[playerid][pVip] > 0)
                    {
                        switch(
AccInfo[playerid][pVip])
                        {
                        case 
1AccType "Silver";
                        case 
2AccType "Gold";
                        case 
3AccType "Premium";
                        }
                        
format(string,sizeof(string),"|- You have Successfully logged! | Account: %s -|"AccType);
                        return 
SendClientMessage(playerid,0x00C896AA,string);
                    }
                    else return 
SendClientMessage(playerid,green,"|- You have Successfully logged! -|");
                }
            }
            else
            {
                
AccInfo[playerid][FailLogin]++;
                
printf("LOGIN: Failed Login: %s. Wrong password (%s) (%d)"PlayerName2(playerid), inputtextAccInfo[playerid][FailLogin] );
                if(
AccInfo[playerid][FailLogin] == MAX_FAIL_LOGINS)
                {
                    new 
string[128]; format(stringsizeof(string), "|- Player %s has been automatically kicked (Reason: Many attempts Incorrect Passwords) -|"PlayerName2(playerid) );
                    
SendClientMessageToAll(redstring);
                    print(string);
                    
Kick(playerid);
                }
                if(
AccInfo[playerid][NoQuestion] == 1)
                {
                    
format(lstring,256,"Sorry '%s'\n\nYour entered password is Incorrect!\nPlease, re-enter the Correct Password:",pName(playerid));
                    return 
ShowPlayerDialog(playerid,DIALOGID+69,DIALOG_STYLE_INPUT,"Login Error",lstring,"Login","Quit");
                }
                 if(
AccInfo[playerid][NoQuestion] == 0)
                {
                    
format(lstring,256,"Sorry '%s'\n\nYour entered password is Incorrect!\nPlease, re-enter the Correct Password:\n\nOr type the response of your security question:\n\n \"%s\"",pName(playerid),dini_Get(file"Question"));
                    return  
ShowPlayerDialog(playerid,DIALOGID+69,DIALOG_STYLE_INPUT,"Login Error",lstring,"Login","Quit");
                }
            } 
I don't get an error but it don't work
Reply
#3

In your server.cfg did you put the Whirlpool plugin. Just show it
Reply
#4

echo Executing Server Config...
lanmode 0
rcon_password changem
maxplayers 50
port 7777
hostname Test Server
gamemode0 grandlarc 1
filterscripts maps LuxAdmin
plugins mysql streamer sscanf Whirlpool
announce 0
query 1
chatlogging 0
weburl mfe.comxa.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat [%H:%M:%S]
Reply
#5

If you are using a windows computer put .dll at the end of the plugins line, if you using linux put .so
Reply
#6

in server.cfg ?
Reply
#7

make sure this path is exist in script files folder

pawn Код:
/LuxAdmin/Accounts/%s.sav
Reply
#8

Quote:
Originally Posted by Arxalan
Посмотреть сообщение
in server.cfg ?
Yes an make sure you have the place where you save the accounts too as he say above
Reply
#9

Well, be sure you don't have others filescripts or gamemodes loaded with same ID but different filescripts.
Reply
#10

OK , i followed you guyz and it works but now when i add another FS the registration system again stop working .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)