18.02.2015, 16:01
For some reason my stats are not saving?
Enum:
on player disc:
Enum:
Код:
enum PlayerInfo { Pass[129], Admin, VIP, Cash, Bank, Level, Kills, Deaths } new pInfo[MAX_PLAYERS][PlayerInfo];
Код:
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; }