[Solved] Adversting Plugin Problem Need Fix

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Infamous2017
Membru, skill +1
Membru, skill +1
Posts: 228
Joined: 11 Feb 2017, 12:13
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 2 times
Contact:

12 Jun 2020, 19:51

I have still the problem that the plugin kicks me when i try to use the Nickname as IP: 37.59.43.196:27018
then every User with this IP in Nickname GET KICKED TOO and i dont want that they get KICKED when they are USING this NICKNAME ....

Anyone can fix this ? Or maybe just remove the kick thing and rename every player who have more as 5 Numbers in Nickname to my serverip... Can anyone do it?


Code: Select all

#include <amxmodx>

#define MAX_NUMBERS 5

new const WHITELIST[][] =
{
	"37.59.43.196:27018"
}

public plugin_init()
{
	register_plugin("Max Number in Name&Chat", "1.1", "OciXCrom")
	register_clcmd("say", "OnSay")
	register_clcmd("say_team", "OnSay")
}

public OnSay(id)
{
	static szArgs[192]
	read_args(szArgs, charsmax(szArgs))
	return has_advertisement(szArgs) ? PLUGIN_HANDLED : PLUGIN_CONTINUE
}
public client_putinserver(id)
{
	new szName[32]
	get_user_name(id, szName, charsmax(szName))

	for(new i; i < sizeof(WHITELIST); i++)
	{
		if(equali(szName, WHITELIST[i]))
		{
			return
		}
	}

	if(has_advertisement(szName))
		server_cmd("kick #%i ^"Too many numbers in name.^"", get_user_userid(id))
}

bool:has_advertisement(const szString[])
{
	static iCount, i
	iCount = 0

	for(i = 0; i < strlen(szString); i++)
	{
		if(isdigit(szString[i]))
			iCount++
	}

	return iCount >= MAX_NUMBERS
}
Last edited by trekA on 13 Jun 2020, 14:06, edited 1 time in total.
Reason: Marked as solved.
RoyalServer 2
User avatar
Olaruflr
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 10 Jun 2020, 12:22
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

12 Jun 2020, 20:15

Lol, you put whitelist just for this name " 37.59.43.196:27018 " , like you can just join the server just with the ip name
Infamous2017
Membru, skill +1
Membru, skill +1
Posts: 228
Joined: 11 Feb 2017, 12:13
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 2 times
Contact:

12 Jun 2020, 20:23

Thats my Problem. When i use the name: 37.59.43.196:27018 then i got kicked too.......

So is there an way to rename them without kick them when they dont have this IP as Name?
Infamous2017
Membru, skill +1
Membru, skill +1
Posts: 228
Joined: 11 Feb 2017, 12:13
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 2 times
Contact:

13 Jun 2020, 11:54

no one an idea or can help?
Infamous2017
Membru, skill +1
Membru, skill +1
Posts: 228
Joined: 11 Feb 2017, 12:13
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 2 times
Contact:

13 Jun 2020, 12:11

can be closed. All good i added wrong Nickname under Option.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests