SII dont saving Stats
#1

|Hey guys i want to make and register and login system and its working but i got this problem its not saving it to "Users/%.ini"
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(INI_Open(getINI(playerid))) {

    INI_WriteInt("Level",GetPlayerScore(playerid));
    INI_WriteInt("Novac",GetPlayerMoney(playerid));
    INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt("Organizacija",PlayerInfo[playerid][pOrganizacija]);
    INI_WriteInt("Suporter",PlayerInfo[playerid][pSuporter]);
    INI_WriteInt("Kuca",PlayerInfo[playerid][pKuca]);
    INI_WriteInt("Vozilo",PlayerInfo[playerid][pVozilo]);
    INI_WriteInt("Bankovni",PlayerInfo[playerid][pBankRacun]);
    INI_WriteInt("Posao",PlayerInfo[playerid][pPosao]);
    INI_WriteInt("Upozorenja",PlayerInfo[playerid][pUpozorenja]);
    INI_WriteInt("Mutovan",PlayerInfo[playerid][pMutovan]);
    INI_WriteInt("Banovan",PlayerInfo[playerid][pBanovan]);
   
    INI_Save();
    INI_Close();
    }
    return 1;
}
btw here is the tutorial: Click me.
Reply
#2

Have you got a folder in your scriptfiles called users ?
Reply
#3

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
Have you got a folder in your scriptfiles called users ?
Yes its called "Users"
Reply
#4

Not sure what INI_Save is as I never use it, however when closing a file you need to specify which you're closing:

new INI:asdf = INI_Open("/Users/Awesome_Hansrutger");
INI_Close(asdf);

Not sure actually what "if(INI_Open(getINI(playerid)))", if you have that opened? What if you don't have that opened? I'm just confused here man. :P

To write in a file you need to do three things:
1. Open file.
2. Write in file.
3. Close file.

Opening:
pawn Код:
new INI:file;
file = INI_Open("/Direction...");

//or

new INI:file = INI_Open("/Direction...");
If you wonder with the "INI:" it's like with floats: "Float:" it specifies what kind of variable it will be.


Writing, just like you wrote above:
pawn Код:
INI_WriteString(file, "Name", "Awesome");
INI_WriteInt(file, "Age", 50);
INI_WriteFloat(file, "Alcohol", 3.0);
Closing:
pawn Код:
INI_Close(file);
EDIT: My apology! I didn't know this was SII xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)