Raised This Month: $120 Target: $400
 30% 

Solved IP kicker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow728988
Member
Join Date: Sep 2017
Old 09-16-2018 , 00:25   IP kicker
Reply With Quote #1

Hi guys, I was just wondering if there was a way that when a players tries to connects with a specific ip they get kicked from the server.

Last edited by shadow728988; 09-19-2018 at 01:10.
shadow728988 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-16-2018 , 03:48   Re: IP kicker
Reply With Quote #2

Banning by SteamID is the most reliable way to prevent certain players into your server. Otherwise, if you still insist: client_connect(), get_user_ip(), if IP match then kick them (see admincmd.sma for how to kick).
__________________
fysiks is offline
shadow728988
Member
Join Date: Sep 2017
Old 09-16-2018 , 10:00   Re: IP kicker
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Banning by SteamID is the most reliable way to prevent certain players into your server. Otherwise, if you still insist: client_connect(), get_user_ip(), if IP match then kick them (see admincmd.sma for how to kick).
public client_connect(id)
{
new szIP[40];

get_user_ip ( id, szIP, charsmax(szIP) , 1 );

if(contain(szIP, "0.0.") != -1)
{
server_cmd("kick #%d", id)
}
else if(contain(szIP, "0.0.") != -1)
{
server_cmd("kick #%d", id)
}
}
something like this?

Last edited by shadow728988; 09-16-2018 at 10:43. Reason: new
shadow728988 is offline
shadow728988
Member
Join Date: Sep 2017
Old 09-16-2018 , 10:13   Re: IP kicker
Reply With Quote #4

also can you tell me how exactly you use client_connectex
shadow728988 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 09-16-2018 , 10:59   Re: IP kicker
Reply With Quote #5

Code:
server_cmd("kick #%d", id)



Code:
server_cmd("kick #%d", get_user_userid(id))
__________________
Working with $$$ paid plugins. Contact below (ONLY FOR NEGOTIATIONS)
  • Skype: crazy.770
  • Steam: crazy770
  • Discord: CrazY.#5317
Feel free to check my work at https://conceptstrike.blogspot.com

Check my Aliens vs. Predator: currently offline

Last edited by CrazY.; 09-16-2018 at 10:59.
CrazY. is offline
shadow728988
Member
Join Date: Sep 2017
Old 09-16-2018 , 11:27   Re: IP kicker
Reply With Quote #6

Quote:
Originally Posted by CrazY. View Post
Code:
server_cmd("kick #%d", id)



Code:
server_cmd("kick #%d", get_user_userid(id))
oh okay..thanks
shadow728988 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 09-16-2018 , 14:21   Re: IP kicker
Reply With Quote #7

Quote:
Originally Posted by shadow728988 View Post
also can you tell me how exactly you use client_connectex
https://www.amxmodx.org/api/amxmodx/client_connectex
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 19:50.


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