Stats are not saving (y ini) - 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: Stats are not saving (y ini) (
/showthread.php?tid=563967)
Stats are not saving (y ini) -
Sellize - 18.02.2015
For some reason my stats are not saving?
Enum:
Код:
enum PlayerInfo
{
Pass[129],
Admin,
VIP,
Cash,
Bank,
Level,
Kills,
Deaths
}
new pInfo[MAX_PLAYERS][PlayerInfo];
on player disc:
Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:file = INI_Open(Path(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteInt(file,"Admin",pInfo[playerid][Admin]);
INI_WriteInt(file,"VIP",pInfo[playerid][VIP]);
INI_WriteInt(file,"Cash",pInfo[playerid][Cash]);
INI_WriteInt(file,"Bank",pInfo[playerid][Bank]);
INI_WriteInt(file,"Level",pInfo[playerid][Level]);
INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
INI_Close(file);
return 1;
}
Код:
forward loadaccount_user(playerid, name[], value[]);
public loadaccount_user(playerid, name[], value[])
{
INI_String("Password", pInfo[playerid][Pass],129);
INI_Int("Admin",pInfo[playerid][Admin]);
INI_Int("VIP",pInfo[playerid][VIP]);
INI_Int("Cash",pInfo[playerid][Cash]);
INI_Int("Bank",pInfo[playerid][Bank]);
INI_Int("Level",pInfo[playerid][Level]);
INI_Int("Kills",pInfo[playerid][Kills]);
INI_Int("Deaths",pInfo[playerid][Deaths]);
return 1;
}
Re: Stats are not saving (y ini) -
GGRoleplay - 18.02.2015
https://sampforum.blast.hk/showthread.php?pid=1138420#pid1138420 take a look around this.
Re: Stats are not saving (y ini) -
Sellize - 18.02.2015
Quote:
Originally Posted by GGRoleplay
|
It was copied from a tutorial so I have no idea what I did wrong
Re: Stats are not saving (y ini) -
rockhopper - 18.02.2015
Did you make the PATH ? IF yes did you define it ?
Re: Stats are not saving (y ini) -
Beckett - 18.02.2015
Is it creating the files?
Re: Stats are not saving (y ini) -
Sellize - 18.02.2015
Quote:
Originally Posted by DaniceMcHarley
Is it creating the files?
|
Yes and the password is saving fine.
Quote:
Originally Posted by rockhopper
Did you make the PATH ? IF yes did you define it ?
|
Yes, the files are being created fine & pass is saving
Re: Stats are not saving (y ini) -
Sellize - 19.02.2015
Bumping this.