PDA

View Full Version : [Include] [INC] Server visit counter -- Good for making records


JonyAvati
13/11/2009, 05:46 PM
INCLUDE
_________________________________________________
Server visit counter
By JonyAvati
_________________________________________________

Description
It's a nice include that lets you make a visit counter, for making records, manage your visits, etc.

Functions

- AddVisits
o Syntax : AddVisits(visits to add);
o Example: If you wanna add 3 visits, use "AddVisits(3);", you can use AddVisits anywhere, like OnPlayerConnect, /login commands, etc.

- RemoveVisits
o Syntax : RemoveVisits(visits to remove);
o Example: If you wanna remove 4 visits, use "RemoveVisits(4);", you can use RemoveVisits anywhere, like in a /removevisits command.

- ResetVisits
o Syntax : ResetVisits();
o Example: To reset the visits, use "ResetVisits();" anywhere in your script, like in /resetvisits command

- GetVisits
o Syntax : GetVisits();
o Example : If you want to show how many visits your server has got, use this script anywhere, like in OnPlayerConnect:
format(string, sizeof(string), "The server has got a total of %d visits", GetVisits());
SendClientMessage(playerid, COLOR_WHITE, string);

- SaveVisits
o Syntax : SaveVisits();
o Example : If you want to save the visits, use "SaveVisits();" anywhere in your script, for example in a /savevisits command

- Rcon commands (Console commands)
o /savevisits
o /resetvisits
o /addvisit
o /removevisit

Installation

o Add this code at the top of your script #include <visits> // Or the name that you used for it
o Add this code inside "OnGameModeExit" SaveVisits();
o If you receive 1 error, you may delete your "OnRconCommand" that is in your GM if you dont use it, if you use it, just /* */ the "OnRconCommand" of the include (Last lines)
Ready to use now

_________________________________________________
Downloads

o Pastebin (http://jonyavati.pastebin.com/d42767b8c)

More stuff
/getvisits command (InGame)
if (strcmp("/getvisits", cmdtext, true) == 0)
{
format(string, sizeof(string), "The server has got %d visits", GetVisits());
SendClientMessage(playerid, COLOR_LITEBLUE, string);
return 1;
}

/resetvisits command (InGame)
if (strcmp("/resetvisits", cmdtext, true) == 0)
{
ResetVisits();
SaveVisits();
return 1;
}

/savevisits command (InGame)
if (strcmp("/savevisits", cmdtext, true) == 0)
{
SaveVisits();
return 1;
}

Please dont steal the credits and good luck ;)
Feel free to post any questions

jameskmonger
13/11/2009, 06:12 PM
Lol hurry up.

Virtual1ty
13/11/2009, 06:16 PM
contest for a most good looking topic ever?? LOL
EDIT: Not bad :-[
8)

smoker08
13/11/2009, 06:19 PM
Lmao

JonyAvati
13/11/2009, 06:37 PM
Lol hurry up.

Don't post this kind of things, it's just to get more post count -.-, and please don't reply this, enjoy the script! :)


contest for a most good looking topic ever?? LOL

You can now see the content, just read what I said "I'm making the post right now".


Lmao

Post counting too, admins may delete those posts ^^.