Pt pluginul countrykick
================================================================================
AMX Mod Plugin
http://amxmod.net--------------------------------------------------------------------------------
Name : CountryKick 0.1 [GeoIP][CS tested] (countrykick)
Author : ST4life
Forums :
http://djeyl.net/forum/index.php?showtopic=10312--------------------------------------------------------------------------------
At first:
This plugin is not developed in racist cases! It's only here beacause someone
asked to protect his server for highpinger of some countries!
I dissociate me of any racist intentions. Each of you have to decide in which
way you use it!
To the Plugin:
Kicks player from defined countrys on 2 ways.
Open your server.cfg or admin.cfg and a a new line:
amx_ckick "flag"
a - only player from defined countries are allowed to play
(amx_ckick_allow)
b - everyone can play exept the defined players (amx_ckick_deny)
amx_ckick_allow "land" "land 2"
the form for "land" and "land 2" are with 2 letters like de = germany:
example:
amx_ckick_allow "se" "dk" "us" "uk"
amx_ckick_deny "land" "land 2"
the form for "land" and "land 2" are with 2 letters like de = germany:
example:
amx_ckick_deny "de" "be" "no"
You need GeoIP module!
--------------------------------------------------------------------------------
Installation :
- Extract file countrykick.amx to directory addons/amx/plugins
- Open addons/amx/plugins/plugins.ini
- Add a line containing : countrykick.amx
================================================================================
Ink ceva
/*
* AMX Mod script.
*
* (c) Copyright 2003, ST4life
* This file is provided as is (no warranties).
*/
#include <amxmod>
#include <geoip>
/*
* "CountryKick" is a plugin to kick players how does not come from allowed countries.
*
* Define modus:
* Open your server.cfg or admin.cfg and a a new line:
*
* amx_ckick "flag"
*
* a - only player from defined countries are allowed to play (amx_ckick_allow)
* b - everyone can play exept the defined players (amx_ckick_deny)
*
* Define Countries:
* Open your server.cfg or admin.cfg and a a new line:
*
* amx_ckick_allow "land" "land 2"
*
* the form for "land" and "land 2" are with 2 letters like de = germany: example:
* amx_ckick_allow "se" "dk" "us" "uk"
*
*
* amx_ckick_deny "land" "land 2"
*
* the form for "land" and "land 2" are with 2 letters like de = germany: example:
* amx_ckick_deny "de" "be" "no"
*
*
* History:
*
* v0.1: - public release
*/
#define MAX_ALLOW 64
#define MAX_DENY 64
new ckick_allow[MAX_ALLOW][3]
new ckick_deny[MAX_DENY][3]
new ckick[2]
new ckicka_num = 0
new ckickd_num = 0
new pa_num = 1
new pd_num = 1
public ckickallow_cmd(){
if (ckicka_num >= MAX_ALLOW){
server_print("[AMX] Country limit reached!")
return PLUGIN_HANDLED
}
for(new i = 0; i < MAX_ALLOW; ++i) {
read_argv(pa_num,ckick_allow[ckicka_num],2)
ckicka_num++
pa_num++
}
return PLUGIN_HANDLED
}
public ckickdeny_cmd(){
if (ckickd_num >= MAX_DENY){
server_print("[AMX] Country limit reached!")
return PLUGIN_HANDLED
}
for(new i = 0; i < MAX_DENY; ++i) {
read_argv(pd_num,ckick_deny[ckickd_num],2)
ckickd_num++
pd_num++
}
return PLUGIN_HANDLED
}
public ckick_cmd(){
read_argv(1,ckick,1)
return PLUGIN_HANDLED
}
public client_connect(id){
new ip[32], country[3]
get_user_ip(id,ip,31)
geoip_code2(ip,country)
new index = -1
if(contain(ckick,"a") != -1) {
for(new i = 0; i < MAX_ALLOW; ++i) {
if (equali(country,ckick_allow[i])) {
index = -1
break
} else {
index = i
}
}
if (index != -1) {
client_cmd(id,"echo ^"[AMX] Sorry, but you're not allowed to play on this server!^"")
client_cmd(id,"echo ^"[AMX] Your country is not on the list of enabled countries^";disconnect")
}
}
if(contain(ckick,"b") != -1) {
for(new i = 0; i < MAX_DENY; ++i) {
if (equali(country,ckick_deny[i])) {
index = i
break
}
}
if (index != -1) {
client_cmd(id,"echo ^"[AMX] Sorry, but you're not allowed to play on this server!^"")
client_cmd(id,"echo ^"[AMX] Your country is not on the list of enabled countries^";disconnect")
}
}
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("CountryKick","0.1","ST4life")
register_srvcmd("amx_ckick_allow","ckickallow_cmd")
register_srvcmd("amx_ckick_deny","ckickdeny_cmd")
register_srvcmd("amx_ckick","ckick_cmd")
return PLUGIN_CONTINUE
}
Primul sigur va fi de folos dar al doilea :-?? nush .. l-am postat dak totusi aveti nevoie de el
GL & HF