Money & Skin Problem
#1

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?
Reply
#2

Are you sure you are using the correct directory?
Reply
#3

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

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?
Reply
#5

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
Reply
#6

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.
Reply
#7

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)
Reply
#8

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

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?
Reply
#10

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


Forum Jump:


Users browsing this thread: 4 Guest(s)