SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 09/03/2011, 08:08 PM   #11
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

Okey.. i fixed saving player password:
Code:
Password = 45046CDE2CB147890DC563A8A112A4A3BA20D9B27BAD4AB810BD341C59922991175AC6FAEB9E0BF7C71C7A971A643A5C8586F40FC8E69082361672A4DC7FB3D
I need now reading this password.
Riddick94 is offline  
Old 09/03/2011, 08:12 PM   #12
Zh3r0
High-roller
 
Join Date: Mar 2008
Posts: 4,513
Reputation: 398
Default Re: Y_Ini - Let's do it!

pawn Code:
forward ParsePass( playerid, name[ ], value[ ] );
public ParsePass( playerid, name[ ], value[ ] )
{
    if ( ! strcmp( name, "Password" ) ) SetPVarString( playerid, "pPass", value ) ;
}


//Where you want to read.

INI_ParseFile( "PlayerFile.ini", "ParsePass", .bExtra = true,  .extra = playerid );
new Str[ 129 ],
    PlayerPass[ 129 ];
GetPVarString( playerid, "pPass", PlayerPass, 129 );
foprmat( Str, 129, "%s", PlayerPass );
SendClientMessage( playerid, -1, Str );

//Change "PlayerFile.ini" with the player's formated file.
__________________
Zh3r0 is offline  
Old 09/03/2011, 08:26 PM   #13
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

pawn Code:
stock OnPlayerLogin(playerid, password[])
{
    if(GetPlayerPassword(playerid, PlayerName(playerid), password))
    {
        new INI:Account;
        Account = INI_Open(PlayerFile(playerid));

        INI_Close(Account);

        PlayerInfo[playerid][pLogged] = true;
        TogglePlayerClock(playerid, true);

        SendDeathMessage(INVALID_PLAYER_ID, playerid, ICON_CONNECT);
        SendFormattedMessageToAll(COLOR_WHITE, "***  %s [{FF003F}ID{FFFFFF}: {FF003F}%d{FFFFFF}] dołączył do serwera.", PlayerName(playerid), playerid);
        SendFormattedMessage(playerid, COLOR_LIMON, "{1BE03F}* Zalogowany jako {EDBC6D}%s {FFFFFF}[{FF003F}ID{FFFFFF}: {FF003F}%d{FFFFFF}]{1BE03F}. Witamy spowrotem na Polskim eXtra Serwerze!", PlayerName(playerid), playerid);
        }else{
        new string[128];
        format(string,sizeof(string),"{9EB8E8}Witamy ponownie {F2EE0C}%s{9EB8E8}. Proszę wpisać poniżej swoje hasło, aby zalogować się i grać:", PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGOWANIE, DIALOG_STYLE_INPUT, "Logowanie", string, "Zaloguj", "Wyjdź");
        GameTextForPlayer(playerid, " ~n~ ~n~ ~n~ ~n~ ~n~ ~r~Nieprawidlowe haslo!", SECONDS(3), 3);
    }
    return true;
}

When i type bad password it's not sending me a GameTextForPlayer but logging in. Why?

edit://
I don't understand it:
pawn Code:
INI_ParseFile( "PlayerFile.ini", "ParsePass", .bExtra = true,  .extra = playerid );
new Str[ 129 ],
    PlayerPass[ 129 ];
GetPVarString( playerid, "pPass", PlayerPass, 129 );
foprmat( Str, 129, "%s", PlayerPass );
SendClientMessage( playerid, -1, Str );
I need to use this in OnPlayerLogin? if yes.. how?
Riddick94 is offline  
Old 09/03/2011, 08:35 PM   #14
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

I need this fast so sorry for this double.
Riddick94 is offline  
Old 09/03/2011, 08:56 PM   #15
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

Anybody?
Riddick94 is offline  
Old 09/03/2011, 09:19 PM   #16
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

Again..
Riddick94 is offline  
Old 10/03/2011, 01:04 AM   #17
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

Bump.
Riddick94 is offline  
Old 10/03/2011, 11:01 AM   #18
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

But.. you mean like this:
pawn Code:
stock OnPlayerLogin(playerid, password[])
{
    INI_ParseFile(PlayerFile(playerid), "GetPlayerPassword");
    new PlayerPass[129];
    GetPVarString(playerid, "pPass", PlayerPass, 129);
    if(GetPlayerPassword(playerid, PlayerFile(playerid), password))
    {
        new INI:Account;
        Account = INI_Open(PlayerFile(playerid));

        INI_Close(Account);

        PlayerInfo[playerid][pLogged] = true;
        TogglePlayerClock(playerid, true);

        SendDeathMessage(INVALID_PLAYER_ID, playerid, ICON_CONNECT);
        SendFormattedMessageToAll(COLOR_WHITE, "***  %s [{FF003F}ID{FFFFFF}: {FF003F}%d{FFFFFF}] dołączył do serwera.", PlayerName(playerid), playerid);
        SendFormattedMessage(playerid, COLOR_LIMON, "{1BE03F}* Zalogowany jako {EDBC6D}%s {FFFFFF}[{FF003F}ID{FFFFFF}: {FF003F}%d{FFFFFF}]{1BE03F}. Witamy spowrotem na Polskim eXtra Serwerze!", PlayerName(playerid), playerid);
        }else{
        new string[128];
        format(string,sizeof(string),"{9EB8E8}Witamy ponownie {F2EE0C}%s{9EB8E8}. Proszę wpisać poniżej swoje hasło, aby zalogować się i grać:", PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGOWANIE, DIALOG_STYLE_INPUT, "Logowanie", string, "Zaloguj", "Wyjdź");
        GameTextForPlayer(playerid, " ~n~ ~n~ ~n~ ~n~ ~n~ ~r~Nieprawidlowe haslo!", SECONDS(3), 3);
    }
    return true;
}
Yes? and when i type a bad password GameTextForPlayer not showing up. Just logging me in.
Riddick94 is offline  
Old 10/03/2011, 11:24 AM   #19
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

Oh.. and maybe i need to do something with loading Hashed password? i used Whirpool.

edit://
This time.. i was won't to do this double : d
Riddick94 is offline  
Old 10/03/2011, 12:14 PM   #20
Riddick94
Banned
 
Join Date: Mar 2010
Location: Poland
Posts: 1,767
Reputation: 223
Default Re: Y_Ini - Let's do it!

Can you tell me where i need to put it? in OnDialogResponse when player have a dialog login?

pawn Code:
case DIALOG_LOGOWANIE:
        {
            if(!response)Kick(playerid);
            if(response)
            {
                INI_ParseFile(PlayerFile(playerid), "GetPlayerPassword");
                new PlayerPass[129];
                GetPVarString(playerid, "pPass", PlayerPass, 129);
            if(!inputtext[0])
                {
                    SendClientMessage(playerid, COLOR_RED, "* You need to insert your password here.");
                    }else{
                    OnPlayerLogin(playerid, inputtext);
                }
Riddick94 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Y_ini Stefans94 Help Archive 4 07/03/2011 08:57 PM
y_ini Help Linus- Help Archive 6 22/01/2011 02:09 PM
Y_INI [HELP] park4bmx Help Archive 14 15/01/2011 04:18 PM
Y_ini help. Haydz Help Archive 0 12/01/2011 12:35 PM


All times are GMT. The time now is 09:54 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.