Raised This Month: $51 Target: $400
 12% 

REQ: CountryKick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Little Chang
Junior Member
Join Date: May 2004
Location: Denmark
Old 05-30-2004 , 20:19   REQ: CountryKick
Reply With Quote #1

Will someone plz convert CountryKick to AMX MOD x, need this plugin to make my sponsor server run. Here are the old AMX source code

TIA. LIttle Chang

/*
* AMX Mod script.
*
* (c) Copyright 2003, ST4life
* This file is provided as is (no warranties).
* 24/11/2003 - modified by LaMersSs (see History)
*/

#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"
*
* If you want to add a user which is allowed to connect to the server even if he is
* from one of the countries in the deny list add the following line to your users.ini
* "STEAM_ID" "" "m" "ce"
* Of course this line can be modified to suit your tastes
* To disable the CountryKick Plugin type: amx_countrykick 0
* To reenable type: amx_countrykick 1
*
* History:
*
* v0.1: - public release
* v0.2: - added amx_countrykick
* - added the user flag "m" to allow to connect even if his country is on the denied list
*/

#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_authorized(id){

if (!(get_cvar_num("amx_countrykick")))
{
return PLUGIN_CONTINUE
}

if((get_user_flags(id) & ADMIN_LEVEL_A)) {
return PLUGIN_CONTINUE
}
new ip[32]
new 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.2","ST4life modified by LaMersSs")
register_srvcmd("amx_ckick_allow","ckickallow _cmd")
register_srvcmd("amx_ckick_deny","ckickdeny_c md")
register_srvcmd("amx_ckick","ckick_cmd")
register_cvar("amx_countrykick","1")
return PLUGIN_CONTINUE
}
Little Chang is offline
uF2k
Member
Join Date: May 2004
Location: NRW, Germany
Old 06-23-2004 , 13:52  
Reply With Quote #2

hat schon jemand eine lösung für amxmodx ?
uF2k is offline
Send a message via AIM to uF2k Send a message via Yahoo to uF2k Send a message via Skype™ to uF2k
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 06-23-2004 , 14:08  
Reply With Quote #3

there is no geoIP module for amxx, well there is but it doesnt work, So no go on this or any geoip dependent plugin.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
clutch9
Junior Member
Join Date: Feb 2005
Old 02-23-2005 , 17:39  
Reply With Quote #4

i would like to vote for this! can somebody please fix this plugin so i can only accept people from NO, SE, DK and FI on my server?

i have installed geoip (modules\geoip_amxx.dll) on my server, and it's all ready for somebody to fix this plugin.
clutch9 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode