SA-MP Forums Archive
[Include] nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] nStatistics v0.1 [ UPTIME - SERVER MONITOR ] (/showthread.php?tid=296790)



nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - Norn - 13.11.2011

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.
ReturnData types:
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
NS_DateFromFirstUse/NS_DateFromServerStart - types:
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
How do I use this in my script?
Put
pawn Код:
#include <nstatistics>
at the top of your script and the include will start immediately.

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","");
Note Download
Download - Pastebin


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - Kar - 13.11.2011

Yes, great this just gave me ideas ! nice job


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - Steven82 - 13.11.2011

Thank you...
I was just about to spend some time and script this for my script. You sir, are amazing


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - [LaTinb0y]...$ag3R - 13.11.2011

yea he is amazing


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - Chrillzen - 13.11.2011

Another nice release by you.


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - Norn - 13.11.2011

Quote:
Originally Posted by Chrillzen
Посмотреть сообщение
Another nice release by you.
Thank you sir.


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - HyperZ - 20.11.2011

Nice work Norn.


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - K4P3L_KUM4R - 20.11.2011

Nice Job Mate


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - Astralis - 20.11.2011

Now can see server stats. Good. 5/5


Re: nStatistics v0.1 [ UPTIME - SERVER MONITOR ] - shamortiy - 27.08.2012

Nice release!