Raised This Month: $ Target: $400
 0% 

Country Kicker Exception


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
noisydude
New Member
Join Date: Apr 2008
Old 01-01-2009 , 19:25   Country Kicker Exception
Reply With Quote #1

Hi, i was wondering if you can help me with my little big problem
I am using EKS's country kicker ( http://forums.alliedmods.net/showthread.php?t=11412 ), it works great but i would want to add some exceptions from the rule. It's setted for romanians only, but I have friends on other countrys who would like to enter too. I don't want to let the whole country to enter my server, just that specific person's IP or IP range. Is this possible?
I would be very greatfull if you can help me

P.S. I need it for Counter-Strike 1.6 if this thing matters.
noisydude is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 01-01-2009 , 20:37   Re: Country Kicker Exception
Reply With Quote #2

It's called an if statement.

PHP Code:
new szID[20]
get_user_authid(idszID19)

if (!
equal(szID"STEAM_0:x:xxxxxxx"))
    
server_cmd("kick #%d"id

Last edited by Spunky; 01-01-2009 at 20:41.
Spunky is offline
Send a message via AIM to Spunky
noisydude
New Member
Join Date: Apr 2008
Old 01-02-2009 , 06:20   Re: Country Kicker Exception
Reply With Quote #3

Can you make it by IP, not by STEAMID please?
noisydude is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 01-02-2009 , 06:27   Re: Country Kicker Exception
Reply With Quote #4

You can't figure that out? -_-

PHP Code:
new szIP[20]
get_user_ip(idszIP191)

if (!
equal(szIP"Enter IP here"))
    
server_cmd("kick #%d"id
If you want multiple exceptions, you could do something like this...

PHP Code:
new szIP[20]
get_user_ip(idszIP191)

if (!
equal(szIP"Enter first IP") && !equal(szIP"Enter second IP") && !equal(szIP"Enter third IP"))
    
server_cmd("kick #%d"id
Pretty much without limit.

Last edited by Spunky; 01-02-2009 at 06:30.
Spunky is offline
Send a message via AIM to Spunky
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-02-2009 , 07:05   Re: Country Kicker Exception
Reply With Quote #5

You sure you want to do that? Unless you're trying to play WON or something, your solution may only be temporary. IP addresses can change, but Steam ID's will not.
__________________
Bad_Bud is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 01-02-2009 , 07:20   Re: Country Kicker Exception
Reply With Quote #6

He's just modifying a plugin, and I don't think he's very experienced. So this is probably best for him at the moment.
Spunky is offline
Send a message via AIM to Spunky
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-02-2009 , 20:15   Re: Country Kicker Exception
Reply With Quote #7

I force my suggestion upon ye!

PHP Code:
public client_connect(id)
{
 new 
usersteamid[37]
 
get_user_authid(id,usersteamid,36)
 
 if(!
equal("Your friend's steam ID here",usersteamid)&&!equal("Your second friend's steam ID here",usersteamid))
 {
  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 == && !IsConInArray(CC))
  {
   
server_cmd("kick #%d Only ppl from %s are allowed",get_user_userid(id),CountyList)
 
   new 
Name[32]
   
get_user_name(id,Name,31)
   
client_print(0,print_chat,"%s was kicked because he is not from %s",Name,CountyList)
  }
  else if(
g_Mode == && 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

Replace this function with the code above, and add in the steamid's of your friends within the quotes.
__________________

Last edited by Bad_Bud; 01-02-2009 at 20:17.
Bad_Bud is offline
Reply


Thread Tools
Display Modes

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 09:09.


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