Stats are not saving (y ini)
#1

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;
}
Reply
#2

https://sampforum.blast.hk/showthread.php?pid=1138420#pid1138420 take a look around this.
Reply
#3

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
It was copied from a tutorial so I have no idea what I did wrong
Reply
#4

Did you make the PATH ? IF yes did you define it ?
Reply
#5

Is it creating the files?
Reply
#6

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

Bumping this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)