Y_INI not overwriting data.. - 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: Y_INI not overwriting data.. (
/showthread.php?tid=500465)
Y_INI not overwriting data.. -
SyntaxQ - 13.03.2014
pawn Код:
// .ini file
[Server Statistics]
Total Registered Users = 1
Total Registered Users = 1
pawn Код:
new gTotalRegisters;
#define ServerStats "stats/ServerStats.ini"
//OnGameModeInit
INI_ParseFile(ServerStats, "loadserverstats", .bExtra = false);
forward loadserverstats(name[], value[]);
public loadserverstats(name[], value[])
{
INI_Int("Total Registered Users", gTotalRegisters);
return 1;
}
// DIALOG_REGISTER
gTotalRegisters++;
format(str, sizeof(str), "{%06x}%s(%d) has registered, making the server have total %d players registered.", random_color >>> 8, GetName(playerid), playerid, gTotalRegisters);
SendClientMessageToAll(-1, str);
new INI:FILE_SERVER_STATS = INI_Open(ServerStats);
INI_SetTag(FILE_SERVER_STATS, "Server Statistics");
INI_WriteInt(FILE_SERVER_STATS, "Total Registered Users", gTotalRegisters);
INI_Close(FILE_SERVER_STATS);
Help..
Re: Y_INI not overwriting data.. -
SyntaxQ - 13.03.2014
Need help.
Re: Y_INI not overwriting data.. -
Chrillzen - 13.03.2014
You need to store gTotalRegisters somewhere, for example in an enum.
Re: Y_INI not overwriting data.. -
BroZeus - 13.03.2014
like in "Server Statistics" and "Total Registered Users" there should not be a space between it try doing this instead "Server_Statistics" and"Total_Registered_Users"