13.03.2014, 12:56
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);