SA-MP Forums Archive
Money & Skin Problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Money & Skin Problem (/showthread.php?tid=263460)



Money & Skin Problem - Tachibana - 22.06.2011

Well now I have made a skins that are buyable by a cmd (/buyclothes) and it takes $100, when player registers he gets 2500 however money and skin does not save on next restart... but money should Im not sure about skins since money is stored in user files

Quote:

Password=[MD5 Password]
Level=0
Money=0
Admin=10
Vip=0
Spawn=0

money doesnt save at all.

Anyone knows how can I fix it to store the money in userfiles as well as the skin?


Re: Money & Skin Problem - Deskoft - 22.06.2011

Are you sure you are using the correct directory?


Re: Money & Skin Problem - Wesley221 - 22.06.2011

Give us a piece of the code, can't help you without it


Re: Money & Skin Problem - Tachibana - 22.06.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Give us a piece of the code, can't help you without it
Sure which one? which piece of code you need?


Re: Money & Skin Problem - Wesley221 - 22.06.2011

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
money doesnt save at all.
Anyone knows how can I fix it to store the money in userfiles as well as the skin?
Show us the piece of code where it should save the player's money


Re: Money & Skin Problem - PCheriyan007 - 22.06.2011

pawn Код:
Money[playerid] = GetPlayerMoney(playerid); // this is dudb
Then make 'Money[playerid]' represent the data that is going to be written to the player file on disconnect.


Re: Money & Skin Problem - Tachibana - 22.06.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Show us the piece of code where it should save the player's money
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[128];
    new plname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, plname, sizeof(plname));
        PlayerInfo[playerid][Level] = 0;
        PlayerInfo[playerid][Money] = 0;
        PlayerInfo[playerid][Vip] = 0;
        PlayerInfo[playerid][Admin] = 0;
        PlayerInfo[playerid][Spawn] = 0;
    format(string, sizeof(string), "/Users/%s.ini", plname);
    if(dini_Exists(string))
        {
                gPlayerAccount[playerid] = 1;
        }
        else
        {
                gPlayerAccount[playerid] = 0;
        }
        return 1;
}
Not sure if thats should be correct one...

pawn Код:
new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new string[512];
                format(string, sizeof(string),""ALB"Nume: "LIGHTBLUE"%s\n"ALB"Pass: "LIGHTBLUE"%s,\n"ALB"Money: "LIGHTBLUE"2500\n"ALB"Score: "LIGHTBLUE"500",sendername,inputtext);
                ShowPlayerDialog(playerid, 1242, DIALOG_STYLE_MSGBOX, ""LIGHTBLUE"Account succesfully registred",string,"Ok","");
                GivePlayerMoney(playerid, 2500);
                SetPlayerScore(playerid, 0);
                OnPlayerRegister(playerid, inputtext);
                }
                else
                {
This shows that it gives 2500$ when player registers in stats dialog. (As well the dialog for stats does not show up well, it does than it dissapears and player spawns or it gives him login one)


Re: Money & Skin Problem - PCheriyan007 - 22.06.2011

Use this for money,
pawn Код:
dini_IntSet(file, "Money",GetPlayerMoney(playerid));



Re: Money & Skin Problem - Tachibana - 22.06.2011

Quote:
Originally Posted by PCheriyan007
Посмотреть сообщение
Use this for money,
pawn Код:
dini_IntSet(file, "Money",GetPlayerMoney(playerid));
could you please tell me where should I shove it in?

as well anyone know how to get skins saved?


Re: Money & Skin Problem - PCheriyan007 - 22.06.2011

pawn Код:
dini_IntSet(file, "Skin",GetPlayerSkin(playerid));
stick this somewhere under OnPlayerDisconnect