13.11.2011, 01:59
nStatistics v0.1
Functions:pawn Код:
NS_TotalUptime(&days, &hours, &minutes, &seconds); // Returns total uptime, days, hours, minutes and seconds.
NS_Uptime(&days, &hours, &minutes, &seconds); // Returns uptime, days, hours minutes and seconds.
NS_DateFromFirstUse(type); // Returns date when nstatistics first initialized.
NS_DateFromServerStart(type); // Save as above except when the server was started.
NS_TimeFromFirstUse(); // Returns time from first use, etc "5 minutes", "1 day" etc.
NS_UptimeString(); // Same as above function but for current uptime, not total.
NS_TotalUptimeString(); // Same as above but for total.
NS_SaveData(); // Saves the statistics to file, only to be used by the include.
NS_SaveData(); // Loads the statistics to file, only to be used by the include.
NS_AddToUptime(); // Total uptime timer, only to be used by the include.
NS_ReturnData(type); // Returns data based on type, types are listed below.
pawn Код:
#define NS_TYPE_STARTSTAMP 0
#define NS_TYPE_DEATHS 1
#define NS_TYPE_CONNECTIONS 2
#define NS_TYPE_WEAPONS 3
#define NS_TYPE_VEHICLES 4
#define NS_TYPE_PLAYERTEXT 5
#define NS_TYPE_TOTALUPTIME 6
#define NS_TYPE_KICKBANS 7
pawn Код:
type unset will print >> 09.07.2009-23:34:11
type 1 will print >> 09/07/2009, 23:34:11
type 2 will print >> July 09, 2009, 23:34:11
type 3 will print >> 9 Jul 2009, 23:34
Put
pawn Код:
#include <nstatistics>
Example Usage:
pawn Код:
new string[512];
format(string, sizeof(string), "Start Unix Stamp: %10d\nDeaths: %d\nConnections: %d\nWeapons Given: %d\nVehicles Created: %d\nPlayer Text: %d\nTotal Uptime: %d\nKicks/Bans: %d\nUptime String: %s\nTotal Uptime String: %s\n\nsince %s \n[ %s ago ]",
NS_ReturnData(NS_TYPE_STARTSTAMP),
NS_ReturnData(NS_TYPE_DEATHS),
NS_ReturnData(NS_TYPE_CONNECTIONS),
NS_ReturnData(NS_TYPE_WEAPONS),
NS_ReturnData(NS_TYPE_VEHICLES),
NS_ReturnData(NS_TYPE_PLAYERTEXT),
NS_ReturnData(NS_TYPE_TOTALUPTIME),
NS_ReturnData(NS_TYPE_KICKBANS),
NS_UptimeString(),
NS_TotalUptimeString(),
NS_DateFromFirstUse(1),
NS_TimeFromFirstUse());
ShowPlayerDialog(playerid,2562,DIALOG_STYLE_MSGBOX,"Server Statistics",string,"Close","");
- This won't work if you restart the server by closing the executable instead of using rcon gmx.
- If you want to restart the log just remove nstatistics.txt from your scriptfiles and reload your server.
- It won't log filterscript actions, only mode.
Download - Pastebin