SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 12/01/2011, 11:35 AM   #1
Haydz
Gangsta
 
Haydz's Avatar
 
Join Date: Jul 2010
Location: New Zealand
Posts: 752
Reputation: 44
Default Y_ini help.

I'v recently been trying to learn y_ini and have come across some problems.

Everything saves perfectly fine but when the player logs in he doesn't recieve his cash/score.
Heres the login dialog.
pawn Code:
case LOGIN:
        {
            if(!response) return Kick(playerid);
            if(response)
            {
                if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"Incorrect password.","Please enter your current password to login." ,"Login", "Disconnect");
                new PlayerFile[35], Password[21];
                format(PlayerFile, 35, "Users/%s.ini",Encode(pName(playerid)));
                INI_ParseFile(PlayerFile, "ParsePlayerPass", false, true, playerid);
                GetPVarString(playerid, "pPass", Password, sizeof Password);

                if(!strcmp(inputtext,Password,false))
                {
                    logged[playerid] = 1;
                    format(PlayerFile,35, "Users/%s.ini",Encode(pName(playerid)));
                    INI_ParseFile(PlayerFile, "LoadUser", false, true, playerid, true, false);
                    GivePlayerMoney(playerid, Money[playerid]);
                    SetPlayerScore(playerid, Score[playerid]);
                    SendClientMessage(playerid, COLOR_ORANGE,"Welcome, you have sucessfully logged in.");
                }
                else ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Incorrect password", "Enter the correct password below.", "Login", "Disconnect");
            }
        }
    }

forward ParsePlayerPass(playerid, name[], value[]);
public ParsePlayerPass(playerid, name[], value[])
{
    if(!strcmp(name, "PASSWORD"))
    {
        SetPVarString(playerid, "pPass", value);
    }
}

forward LoadUser(playerid, name[], value[]);
public LoadUser(playerid, name[], value[])
{
    if(!strcmp(name, "MONEYS"))SetPVarInt(playerid, "Moneys", strval(value));
    if(!strcmp(name, "SCORE"))SetPVarInt(playerid, "Score", strval(value));
}

I'v been editing Zh3r0's system - http://forum.sa-mp.com/showthread.php?t=206830

Cheers for any help.
Haydz 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
ZCMD & Y_INI help blackwave Help Archive 1 11/01/2011 07:37 PM
Y_INI related.. blackwave Help Archive 4 09/01/2011 03:54 PM
Y_Ini. Zh3r0 Help Archive 1 15/10/2010 09:00 PM


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


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