13.11.2009, 16:46
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:
pawn Code:
format(string, sizeof(string), "The server has got a total of %d visits", GetVisits());
SendClientMessage(playerid, COLOR_WHITE, string);
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
pawn Code:
#include <visits> // Or the name that you used for it
pawn Code:
SaveVisits();
Ready to use now
_________________________________________________
Downloads
o Pastebin
More stuff
/getvisits command (InGame)
pawn Code:
if (strcmp("/getvisits", cmdtext, true) == 0)
{
format(string, sizeof(string), "The server has got %d visits", GetVisits());
SendClientMessage(playerid, COLOR_LITEBLUE, string);
return 1;
}
pawn Code:
if (strcmp("/resetvisits", cmdtext, true) == 0)
{
ResetVisits();
SaveVisits();
return 1;
}
pawn Code:
if (strcmp("/savevisits", cmdtext, true) == 0)
{
SaveVisits();
return 1;
}
Please dont steal the credits and good luck
Feel free to post any questions