[FilterScript] Country Blocker 1.0
#1

CountryBlocker 1.1
What is this?
CountryBlocker is a fliterscript/include used for blocking a country from your server.It uses the GeoIP_Plugin for SA-MP and the GeoIP country database.

How can I use it?
There are two ways of using this feature:
1.As a filterscript(cblock_fs_package.rar)
2.As an include(cblock_inc_package.rar)

What functions are available?
In the include version you have to add this function in your OnPlayerConnect/OnPlayerRequestSpawn/or wherever you need it.
pawn Код:
public CheckPlayerCountryBlocked(playerid);
If the function returns 1 it means that the player's country is blocked,0 means that the country is not blocked.
Example of script:
pawn Код:
public OnPlayerConnect(playerid)
{
    if( CheckPlayerCountryBlocked(playerid) == 1 )
   {
        Kick(playerid);
   }
    return 1;
}
How can I add/remove countries from the blocked list?
Simply by editing the BlockedCountries string:
pawn Код:
new BlockedCountries[256] = "Unknown, Country1, Country2, etc. ";
How do I install this?
Simply copy the files from the folders of the package to the folders of your server and edit:
Filterscript version:
server.cfg
Код:
filterscripts cblock
plugins GeoIP_Plugin
Include version:
server.cfg
Код:
plugins GeoIP_Plugin
script
pawn Код:
#include <cblock>
Where can I download this?
V1.0(Not supported by actual tutorial)
Filterscript version package: http://www.taviss.net/downloads/cblocker_fs_package.rar
Include version package: http://www.taviss.net/downloads/cblo...nc_package.rar
V1.1
Filterscript version package:http://www.taviss.net/downloads/cblo...package1.1.rar
Include version package:http://www.taviss.net/downloads/cblo...package1.1.rar
*all packages include the GeoIP files

Changelog
V1.0
[code]
Release
[CODE]
V1.1
Код:
Simpler and faster
No repetitive functions
Credits
Tavi(author)
Creator of GeoIP_Plugin for SA-MP

PS:A MySQL version might be also available soon
Reply
#2

First

Good job man, that awesome idea
Reply
#3

Rassist
Reply
#4

Quote:
Originally Posted by Awesome™
Посмотреть сообщение
Rassist
*Racist, this isn't a German forum.

@Topic:
Racist!
Reply
#5

This is not racist, you can use it, for example, if you only want to create a server for some country and you don't want foreign players causing lag or you can only block countries that are too far from the server location or anything like that.

@kiss Thanks
Reply
#6

An xenophobic filterscript, ...
Reply
#7

They're joking :P Good job anyways.
Reply
#8

smth like:
pawn Код:
new skincolor = GetPlayerSkinColor(playerid);
switch(skincolor)
{
case YELLOW: Kick(playerid);
case BLACK: Kick(playerid);
case RED: Kick(playerid);
case WHITE: Kick(playerid);
}
No rasism
Reply
#9

Quote:
Originally Posted by Yvax
Посмотреть сообщение
This is not racist, you can use it, for example, if you only want to create a server for some country and you don't want foreign players causing lag or you can only block countries that are too far from the server location or anything like that.

@kiss Thanks
Well, then CheckPlayerCountryAllowed would be 100x better, instead of writing hundreds of other countries
Reply
#10

Quote:
Originally Posted by wups
Посмотреть сообщение
Well, then CheckPlayerCountryAllowed would be 100x better, instead of writing hundreds of other countries
Indeed. Just needed Geo_Ip plugin and checking if a player is of a nation.
Anyway if I'm italian and want to join a Italian server while I'm in vacancy out of Italy? I don't see any use for this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)