Raised This Month: $ Target: $400
 0% 

Why not works? ((((


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 10-13-2019 , 15:08   Why not works? ((((
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>
#include <regex> 

public plugin_init() {
	register_plugin("No bad usernames", "1", "KARAULOV");
	set_task(1.0, "bad_checker", _, _, _, "b");
}

public bad_checker(xxx)
{ 
	new i;
	new mUserName[64] 
	new players[32], count
	get_players(players, count)
	for(i = 0; i < count; i++)
	{
		new id = players[i]
		get_user_name(id, mUserName, charsmax(mUserName))
		new userid = get_user_userid( id );
		new ret, error[128]
		new Regex:regex_handle = regex_match(mUserName, "\d+\.\d+.\d+.\d+:", ret, error, charsmax(error))
		switch(regex_handle)
		{
			case REGEX_MATCH_FAIL:
			{
				return;
			}
			case REGEX_PATTERN_FAIL:
			{
				return;
			}
			case REGEX_NO_MATCH:
			{
				return;
			}
			default:
			{
				server_cmd( "amx_kick #%d BAD NICKNAME!", userid)
				server_print( "amx_kick %s - #%d BAD NICKNAME!", mUserName, userid)
				regex_free(regex_handle);
			}
		}
	}
}

This not kick users who contain "IP addresss: PORT" in nickname ....
karaulov is offline
 



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 02:41.


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