SII dont saving Stats - 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)
+--- Thread: SII dont saving Stats (
/showthread.php?tid=487079)
SII dont saving Stats -
MatriXgaMer - 11.01.2014
|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.
Re: SII dont saving Stats -
Jimmy0wns - 11.01.2014
Have you got a folder in your scriptfiles called users ?
Re: SII dont saving Stats -
MatriXgaMer - 11.01.2014
Quote:
Originally Posted by Jimmy0wns
Have you got a folder in your scriptfiles called users ?
|
Yes its called "Users"
Re: SII dont saving Stats -
Hansrutger - 11.01.2014
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:
EDIT: My apology! I didn't know this was SII xD