[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
#2

Lol hurry up.
Reply
#3

contest for a most good looking topic ever?? LOL
EDIT: Not bad
Reply
#4

Lmao
Reply
#5

Quote:
Originally Posted by jameskmonger
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!

Quote:
Originally Posted by Virtual1ty
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".

Quote:
Originally Posted by AF1-4-LIFE
Lmao
Post counting too, admins may delete those posts ^^.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)