eM` Posted June 24, 2007 Report Share Posted June 24, 2007 Lieta tada, ka man serverim stav plugins country_kicker ( kiko arzemniekus ) Vai ir iespejams uzlikt vienai atseviskai IP adresei, lai vinu nekiko? ( Speletajs ir no krievijas ) Ja ir kads zinoss saja lieta, tad rakstat. Ja vajag atsutisu vina ip privataja. Rekur pievienoju plugina kodu. /* Country kicker About: This plugin is used if you only want ppl from spesfic countrys on your server, or wanna prevent ppl from a spesfic countrys from entering Forum topic: http://www.amxmodx.org/forums/viewtopic.php?t=12063 Modules required: geoip Credits: Ops in #AMXmod @ Quakenet for alot of help ( + AssKicker & CheesyPeteza ) xeroblood Explode string func Setting up plugin: sv_country 1 Only allow ppl from this country 2 Everyone exect from this country sv_country_name use commas to seperate country names like: sv_country_name "NOR,DEN" Latvija - LVA Changelog 1.0.0( 18.12.2004 ) - First public release */ #include <amxmodx> #include <geoip> #define MAX_COUNTRYS 15 new g_Mode new g_CC[MAX_COUNTRYS+1][4] new g_Countries new CountyList[128] public plugin_init() { register_plugin("Country kicker","1.0.0","EKS") register_cvar("sv_country_name","LVA") register_cvar("sv_country","1") } public plugin_cfg() { g_Mode = get_cvar_num("sv_country") new CvarInfo[MAX_COUNTRYS*3+MAX_COUNTRYS+2] get_cvar_string("sv_country_name",CvarInfo,MAX_COUNTRYS*3+MAX_COUNTRYS+2) g_Countries = ExplodeString( g_CC, MAX_COUNTRYS, 3, CvarInfo, ',' ) for(new i=0;i<=g_Countries;i++) format(CountyList,127,"%s %s",CountyList,g_CC[i]) } stock ExplodeString( p_szOutput[][], p_nMax, p_nSize, p_szInput[], p_szDelimiter ) { new nIdx = 0, l = strlen(p_szInput) new nLen = (1 + copyc( p_szOutput[nIdx], p_nSize, p_szInput, p_szDelimiter )) while( (nLen < l) && (++nIdx < p_nMax) ) nLen += (1 + copyc( p_szOutput[nIdx], p_nSize, p_szInput[nLen], p_szDelimiter )) return nIdx } stock IsConInArray(Con[4]) { for(new i=0;i<=g_Countries;i++) { if(equal(Con,g_CC[i])) return 1 } return 0 } stock IsLocalIp(IP[32]) { new tIP[32] copy(tIP,3,IP) if(equal(tIP,"10.") || equal(tIP,"127")) return 1 copy(tIP,7,IP) if(equal(tIP,"192.168")) return 1 return 0 } public client_connect(id) { new userip[32] new CC[4] get_user_ip(id,userip,31,1) geoip_code3(userip,CC) if(strlen(userip) == 0) { get_user_ip(id,userip,31,1) if(!IsLocalIp(userip)) log_amx("%s made a error when passed though geoip",userip) return PLUGIN_HANDLED } if(g_Mode == 1 && !IsConInArray(CC)) { server_cmd("kick #%d Only ppl from %s are allowed",get_user_userid(id),CountyList) } else if(g_Mode == 2 && IsConInArray(CC)) { server_cmd("kick #%d No %s are allowed on this server",get_user_userid(id),CC) new Name[32] get_user_name(id,Name,31) client_print(0,print_chat,"%s was kicked because he is from %s",Name,CC) } return PLUGIN_HANDLED } Link to comment Share on other sites More sharing options...
Lecter Posted June 24, 2007 Report Share Posted June 24, 2007 esi mēģinājis spēlētājam uzlikt imunity ? mo6 tā var... Tikai tad ban ary neiedarbosies... Link to comment Share on other sites More sharing options...
eM` Posted June 24, 2007 Author Report Share Posted June 24, 2007 Speletaju ja vins nav no Lv izkiko uzreiz pie konekta. imunity saja gadijuma neko nedotu :/ Link to comment Share on other sites More sharing options...
Lecter Posted June 24, 2007 Report Share Posted June 24, 2007 mo6 paprasi amxmodx forumos zem šī plugina kāto var izdarīt 100% palidzes Link to comment Share on other sites More sharing options...
eM` Posted June 24, 2007 Author Report Share Posted June 24, 2007 Gan jau, ka kads no savejiem zinas. Link to comment Share on other sites More sharing options...
10BaseT Posted June 24, 2007 Report Share Posted June 24, 2007 copy(tIP,7,IP) if(equal(tIP,"192.168") || equal(tIP,"xxx.xxx.xxx.xxx")) /* Pamēģini ievadīt te to IP */ return 1 ..... Link to comment Share on other sites More sharing options...
Dark13 Posted June 24, 2007 Report Share Posted June 24, 2007 (edited) pamegini sita /* Country kicker About: This plugin is used if you only want ppl from spesfic countrys on your server, or wanna prevent ppl from a spesfic countrys from entering Forum topic: http://www.amxmodx.org/forums/viewtopic.php?t=12063 Modules required: geoip Credits: Ops in #AMXmod @ Quakenet for alot of help ( + AssKicker & CheesyPeteza ) xeroblood Explode string func Setting up plugin: sv_country 1 Only allow ppl from this country 2 Everyone exect from this country sv_country_name use commas to seperate country names like: sv_country_name "NOR,DEN" Latvija - LVA Krievija - RUS Changelog 1.0.0( 18.12.2004 ) - First public release */ #include <amxmodx> #include <geoip> #define MAX_COUNTRYS 15 new g_Mode new g_CC[MAX_COUNTRYS+1][4] new g_Countries new CountyList[128] public plugin_init() { register_plugin("Country kicker","1.0.0","EKS") register_cvar("sv_country_name","LVA,RUS") register_cvar("sv_country","2") } public plugin_cfg() { g_Mode = get_cvar_num("sv_country") new CvarInfo[MAX_COUNTRYS*3+MAX_COUNTRYS+2] get_cvar_string("sv_country_name",CvarInfo,MAX_COUNTRYS*3+MAX_COUNTRYS+2) g_Countries = ExplodeString( g_CC, MAX_COUNTRYS, 3, CvarInfo, ',' ) for(new i=0;i<=g_Countries;i++) format(CountyList,127,"%s %s",CountyList,g_CC[i]) } stock ExplodeString( p_szOutput[][], p_nMax, p_nSize, p_szInput[], p_szDelimiter ) { new nIdx = 0, l = strlen(p_szInput) new nLen = (1 + copyc( p_szOutput[nIdx], p_nSize, p_szInput, p_szDelimiter )) while( (nLen < l) && (++nIdx < p_nMax) ) nLen += (1 + copyc( p_szOutput[nIdx], p_nSize, p_szInput[nLen], p_szDelimiter )) return nIdx } stock IsConInArray(Con[4]) { for(new i=0;i<=g_Countries;i++) { if(equal(Con,g_CC[i])) return 1 } return 0 } stock IsLocalIp(IP[32]) { new tIP[32] copy(tIP,3,IP) if(equal(tIP,"10.") || equal(tIP,"127")) return 1 copy(tIP,7,IP) if(equal(tIP,"192.168")) return 1 return 0 } public client_connect(id) { new userip[32] new CC[4] get_user_ip(id,userip,31,1) geoip_code3(userip,CC) if(strlen(userip) == 0) { get_user_ip(id,userip,31,1) if(!IsLocalIp(userip)) log_amx("%s made a error when passed though geoip",userip) return PLUGIN_HANDLED } if(g_Mode == 1 && !IsConInArray(CC)) { server_cmd("kick #%d Only ppl from %s are allowed",get_user_userid(id),CountyList) } else if(g_Mode == 2 && IsConInArray(CC)) { server_cmd("kick #%d No %s are allowed on this server",get_user_userid(id),CC) new Name[32] get_user_name(id,Name,31) client_print(0,print_chat,"%s was kicked because he is from %s",Name,CC) } return PLUGIN_HANDLED } es nezinu vai ies jo neesmu nekads eksperts Edited June 24, 2007 by Dark13 Link to comment Share on other sites More sharing options...
eM` Posted June 24, 2007 Author Report Share Posted June 24, 2007 Tad tiks ieksa visi no krievijas, bet man vajag tikai lai tiek vins. Link to comment Share on other sites More sharing options...
Alviic Posted June 24, 2007 Report Share Posted June 24, 2007 Ta4 pamegini uzlikt vinjam imunity , ja ir imunity daudzi plugini uz to kam imunity neiedarbojas , mby arii shoreiz taa buus... Link to comment Share on other sites More sharing options...
eM` Posted June 24, 2007 Author Report Share Posted June 24, 2007 Neizdevas. Tapat kiko. Link to comment Share on other sites More sharing options...
10BaseT Posted June 24, 2007 Report Share Posted June 24, 2007 (edited) Un šādi ? stock IsLocalIp(IP[32]) { new tIP[32] copy(tIP,3,IP) if(equal(tIP,"10.") || equal(tIP,"127")) return 1 copy(tIP,7,IP) if(equal(tIP,"192.168")) return 1 copy(tIP,15,IP) /* 15 - Aizstāj ar ip garumu ieskaitot punktus */ if(equal(tIP,"xxx.xxx.xxx.xxx")) /* Te ieraksti IP */ return 1 return 0 } Edited June 24, 2007 by 10BaseT Link to comment Share on other sites More sharing options...
eM` Posted June 24, 2007 Author Report Share Posted June 24, 2007 Paldies. Vis bumbas. Link to comment Share on other sites More sharing options...
eM` Posted June 26, 2007 Author Report Share Posted June 26, 2007 Sorry Doble post. Ne tomer nestrada, tapat kiko. Nu jau tadi speletaji ir 4 no arzemem, bet pilniba es vinu nost negribu, jo Pingo. Un vinus es ar pasutit negribu Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now