[Include] [INC] Server visit counter -- Good for making records
#1

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);
- 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
pawn Code:
#include <visits> // Or the name that you used for it
o Add this code inside "OnGameModeExit"
pawn Code:
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

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;
    }
/resetvisits command (InGame)
pawn Code:
if (strcmp("/resetvisits", cmdtext, true) == 0)
    {
        ResetVisits();
        SaveVisits();
        return 1;
    }
/savevisits command (InGame)
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
Reply


Messages In This Thread
[INC] Server visit counter -- Good for making records - by JonyAvati - 13.11.2009, 16:46
Re: [INC] Server visit counter -- Good for making records - by jameskmonger - 13.11.2009, 17:12
Re: [INC] Server visit counter -- Good for making records - by Virtual1ty - 13.11.2009, 17:16
Re: [INC] Server visit counter -- Good for making records - by smoker08 - 13.11.2009, 17:19
Re: [INC] Server visit counter -- Good for making records - by JonyAvati - 13.11.2009, 17:37

Forum Jump:


Users browsing this thread: 4 Guest(s)