SA-MP Forums Archive
LOGIN - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: LOGIN (/showthread.php?tid=614173)



LOGIN - Loinal - 05.08.2016

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


Re: LOGIN - SyS - 05.08.2016

code?


Re: LOGIN - Loinal - 05.08.2016

PHP код:
CMD:login(playerid,params[])
{
    if (
pInfo[playerid][Logged] == 1) return SendClientMessage(playerid,lighterblue,"You are already logged in");
    
format(Jstring128ACCOUNTS_PATHGetName(playerid));
    if(!
fexist(Jstring))
    {
        
SendClientMessage(playerid,red,"Nick name isn't registered!");
        
SendClientMessage(playerid,lighterblue,"Please '/register' to create your account");
        return 
1;
    }
    
format(Jstringsizeof(Jstring),"Account \"%s\"\nPlease enter the password to login"GetName(playerid));
    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_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(playeridnamesizeof(name));
              
format(Jfile60ACCOUNTS_PATHGetName(playerid));
              
INI_ParseFile(Jfile"GetPassword", .bExtra true, .extra playerid);
              
WP_Hash(bufsizeof(buf),inputtext);
              if(
strcmp(pInfo[playerid][Password], buffalse) == 0)
              {
                   
format(Jfile100ACCOUNTS_PATHGetName(playerid));
                   
INI_ParseFile(Jfile"LoginPlayer", .bExtra true, .extra playerid);
                   
SendClientMessage(playerid,green,"You have been succesfully logged In!");
                   
SetPlayerScore(playeridpInfo[playerid][Score]);
                   
GivePlayerMoney(playeridpInfo[playerid][Cash]);
                   
pInfo[playerid][Logged] = 1;
                   
GetPlayerIp(playerid,pIP,16);
                   
format(Jfile100ACCOUNTS_PATHGetName(playerid));
                   new 
INI:ACCOUNT INI_Open(Jfile);
                   
INI_WriteString(ACCOUNT"LastLoggedIP"pIP);
                   
INI_Close(ACCOUNT);
                   
#if LoginTextDraw == true
                   
TextDrawHideForPlayer(playeridTEXT_PASSWORD);
                   
TextDrawHideForPlayer(playeridTEXT_REGISTER);
                   
TextDrawHideForPlayer(playeridTEXT_REGISTERED);
                   
CancelSelectTextDraw(playerid);
                   
#endif
                       
format(joinMsgsizeof(joinMsg), "02[%d] 038,2 %s Has Logged In As Level %d"playeridname,pInfo[playerid][pLevel]);
    
IRC_GroupSay(groupIDIRC_CHANNELjoinMsg);
              }
              else
              {
                  
pInfo[playerid][LoginAttempts]++;
                  if(
pInfo[playerid][LoginAttempts] >= MAX_LOGIN_ATTEMPTS)
                  {
                      
format(Jstringsizeof(Jstring),"%s has been automatically kicked | Reason: 'Incorrect password'"GetName(playerid));
                      
SendToAdmins(orange,Jstring);
                      
ShowPlayerDialog(playeridJDIALOGS+45DIALOG_STYLE_MSGBOX"WARRING","You have been automatically kicked | Reason: 'Incorrect password'""Ok""");
                      
SetTimerEx("KickPlayer",100,false,"d",playerid);
                      return 
1;
                  }
                  
format(Jstringsizeof(Jstring),"Account \"%s\"\nEnter your password to login\n{FF0000}*Incorrect password"GetName(playerid));
                  
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Account Login error",Jstring"Login""Quit");
              }
       } 



Re: LOGIN - Threshold - 05.08.2016

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


Re: LOGIN - Loinal - 05.08.2016

PHP код:
public GetPassword(playeridname[], value[])
{
    
INI_String("Password"pInfo[playerid][Password],130);
    return 
1;




Re: LOGIN - F1N4L - 05.08.2016

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



Re: LOGIN - Stinged - 05.08.2016

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.


Re: LOGIN - Loinal - 05.08.2016

Give me errors

PHP код:
public GetPassword(playeridname[], value[])
{
    
INI_String("Password"pInfo[playerid][Password],130);
return 
0;

That could work?


Re: LOGIN - F1N4L - 05.08.2016

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.


Re: LOGIN - Loinal - 05.08.2016

Help?