JonyAvati
13/11/2009, 04: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
_________________________________________________
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