AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved IP kicker (https://forums.alliedmods.net/showthread.php?t=310699)

shadow728988 09-15-2018 23:25

IP kicker
 
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.

fysiks 09-16-2018 02:48

Re: IP kicker
 
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).

shadow728988 09-16-2018 09:00

Re: IP kicker
 
Quote:

Originally Posted by fysiks (Post 2615387)
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?

shadow728988 09-16-2018 09:13

Re: IP kicker
 
also can you tell me how exactly you use client_connectex

CrazY. 09-16-2018 09:59

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

:arrow:

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

shadow728988 09-16-2018 10:27

Re: IP kicker
 
Quote:

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

:arrow:

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

oh okay..thanks

OciXCrom 09-16-2018 13:21

Re: IP kicker
 
Quote:

Originally Posted by shadow728988 (Post 2615411)
also can you tell me how exactly you use client_connectex

https://www.amxmodx.org/api/amxmodx/client_connectex


All times are GMT -4. The time now is 03:17.

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