#1

Hello guys, i use JLadmin and when i login my password must be 132198 and when i typed lol it login any help?
Reply
#2

code?
Reply
#3

PHP код:
CMD:login(playerid,params[])
{
    if (
pInfo[playerid][Logged] == 1) return SendClientMessage(playerid,lighterblue,"You are already logged in");
    
format(Jstring, 128, ACCOUNTS_PATH, GetName(playerid));
    if(!
fexist(Jstring))
    {
        
SendClientMessage(playerid,red,"Nick name isn't registered!");
        
SendClientMessage(playerid,lighterblue,"Please '/register' to create your account");
        return 
1;
    }
    
format(Jstring, sizeof(Jstring),"Account \"%s\"\nPlease enter the password to login", GetName(playerid));
    
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Account Access", Jstring, "Login", "Quit");
    return 
1;
} 
Dialogs

PHP код:
    if(dialogid == DIALOG_LOGIN)
    {
       if(
response)
       {
              new 
Jfile[100],pIP[16],buf[145];
              new 
joinMsg[128], name[MAX_PLAYER_NAME];
              
GetPlayerName(playerid, name, sizeof(name));
              
format(Jfile, 60, ACCOUNTS_PATH, GetName(playerid));
              
INI_ParseFile(Jfile, "GetPassword", .bExtra = true, .extra = playerid);
              
WP_Hash(buf, sizeof(buf),inputtext);
              if(
strcmp(pInfo[playerid][Password], buf, false) == 0)
              {
                   
format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
                   
INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid);
                   
SendClientMessage(playerid,green,"You have been succesfully logged In!");
                   
SetPlayerScore(playerid, pInfo[playerid][Score]);
                   
GivePlayerMoney(playerid, pInfo[playerid][Cash]);
                   
pInfo[playerid][Logged] = 1;
                   
GetPlayerIp(playerid,pIP,16);
                   
format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
                   new 
INI:ACCOUNT = INI_Open(Jfile);
                   
INI_WriteString(ACCOUNT, "LastLoggedIP", pIP);
                   
INI_Close(ACCOUNT);
                   
#if LoginTextDraw == true
                   
TextDrawHideForPlayer(playerid, TEXT_PASSWORD);
                   
TextDrawHideForPlayer(playerid, TEXT_REGISTER);
                   
TextDrawHideForPlayer(playerid, TEXT_REGISTERED);
                   
CancelSelectTextDraw(playerid);
                   
#endif
                       
format(joinMsg, sizeof(joinMsg), "02[%d] 038,2 %s Has Logged In As Level %d", playerid, name,pInfo[playerid][pLevel]);
    
IRC_GroupSay(groupID, IRC_CHANNEL, joinMsg);
              }
              else
              {
                  
pInfo[playerid][LoginAttempts]++;
                  if(
pInfo[playerid][LoginAttempts] >= MAX_LOGIN_ATTEMPTS)
                  {
                      
format(Jstring, sizeof(Jstring),"%s has been automatically kicked | Reason: 'Incorrect password'", GetName(playerid));
                      
SendToAdmins(orange,Jstring);
                      
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX, "WARRING","You have been automatically kicked | Reason: 'Incorrect password'", "Ok", "");
                      
SetTimerEx("KickPlayer",100,false,"d",playerid);
                      return 
1;
                  }
                  
format(Jstring, sizeof(Jstring),"Account \"%s\"\nEnter your password to login\n{FF0000}*Incorrect password", GetName(playerid));
                  
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Account Login error",Jstring, "Login", "Quit");
              }
       } 
Reply
#4

Your password isn't being stored correctly, which means your 'GetPassword' function is being used incorrectly. Show us that function.
Reply
#5

PHP код:
public GetPassword(playerid, name[], value[])
{
    
INI_String("Password", pInfo[playerid][Password],130);
    return 
1;
} 
Reply
#6

Return the value...
Код:
public GetPassword(playerid, name[], value[])
{
    return INI_String("Password", pInfo[playerid][Password],130);
}
Reply
#7

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Return the value...
Код:
public GetPassword(playerid, name[], value[])
{
    return INI_String("Password", pInfo[playerid][Password],130);
}
INI_String saves the string inside of the destination (pInfo[playerid][Password])
It doesn't return the string.
Reply
#8

Give me errors

PHP код:
public GetPassword(playerid, name[], value[])
{
    
INI_String("Password", pInfo[playerid][Password],130);
return 
0;
} 
That could work?
Reply
#9

Quote:
Originally Posted by Stinged
Посмотреть сообщение
INI_String saves the string inside of the destination (pInfo[playerid][Password])
It doesn't return the string.
lol, sorry. I not use ini save.
Reply
#10

Help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)