Raised This Month: $32 Target: $400
 8% 

Solved IP kicker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow728988
Member
Join Date: Sep 2017
Old 09-15-2018 , 23: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 00:10.
shadow728988 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-16-2018 , 02: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 , 09: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 09:43. Reason: new
shadow728988 is offline
shadow728988
Member
Join Date: Sep 2017
Old 09-16-2018 , 09: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: SP, Brazil
Old 09-16-2018 , 09:59   Re: IP kicker
Reply With Quote #5

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



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









Last edited by CrazY.; 09-16-2018 at 09:59.
CrazY. is offline
shadow728988
Member
Join Date: Sep 2017
Old 09-16-2018 , 10: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 , 13: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



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 06:11.


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