Block Names

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
LordOfNothing
Membru, skill 0
Membru, skill 0
Posts: 0
Joined: 19 Jul 2013, 15:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 35 times

18 Dec 2013, 10:00

Descriere: acest plugin iti scaneaza numele si te da afara (numele ilegale sunt setate dintrun fisier din configs "names.ini"

Descarcare:
SMA | Afiseaza codul
#include <amxmodx>
#include <amxmisc>

new const PLUGIN [] = "Name Scan"
new const VERSION [] = "1.1";
new const AUTHOR [] = "LordOfNothing";


new Array:g_Stroke = Invalid_Array;

new xmsg;



public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	xmsg = register_cvar("namescan_msg", "[AMXX] Change your name !");
	
}

public client_connect(id)
{
	if (!ArraySize(g_Stroke))
	{
		return PLUGIN_CONTINUE;
	}
	
	static Stroke[64], Size = 0;
	
	new name[32]
	new szMsg[50];
	get_pcvar_string(xmsg, szMsg, 49);
	new userid = get_user_userid(id)
	get_user_name(id, name, 31)
	
	
	for (Size = 0; Size < ArraySize(g_Stroke); Size++)
	{
		ArrayGetString(g_Stroke, Size, Stroke, charsmax(Stroke));
		
		if (equal(name, Stroke))
		{
			server_cmd("kick #%d %s",userid,szMsg)
			
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public client_infochanged(id)
{
	if (!ArraySize(g_Stroke))
	{
		return PLUGIN_CONTINUE;
	}
	
	static Stroke[64], Size = 0;
	
	new name[32]
	new szMsg[50];
	get_pcvar_string(xmsg, szMsg, 49);
	new userid = get_user_userid(id)
	get_user_info(id, "name", name,31) 
	
	
	for (Size = 0; Size < ArraySize(g_Stroke); Size++)
	{
		ArrayGetString(g_Stroke, Size, Stroke, charsmax(Stroke));
		
		if (equal(name, Stroke))
		{
			server_cmd("kick #%d %s",userid,szMsg)
			
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public plugin_cfg()
{
	static File = 0, Buffer[64], Location[256];
	
	g_Stroke = ArrayCreate(64 /* maximum length */);
	
	get_localinfo("amxx_configsdir", Location, charsmax(Location));
	
	add(Location, charsmax(Location), "/names.ini ");
	
	if (!file_exists(Location))
	{
		File = fopen(Location, "w+" /* write file */);
		
		if (File)
		{
			fclose(File);
		}
	}
	
	File = fopen(Location, "rt" /* read file as text */);
	
	if (File)
	{
		while (!feof(File))
		{
			fgets(File, Buffer, charsmax(Buffer));
			
			trim(Buffer);
			
			if (!strlen(Buffer) || Buffer[0] == ';')
			{
				continue;
			}
			
			ArrayPushString(g_Stroke, Buffer);
		}
		
		fclose(File);
	}
}
INI | Afiseaza codul
Admin
***
***
***
***
Idiot
retard
Nume: Block Names
Versiune: 1.0
Link oficial: extreamcs
Autori: Akman(adica lordofnothing)

Instalare:
1. Fisierul block_names.sma il puneti in addons/amxmodx/scripting
2. Fisierul block_names.amxx il puneti in addons/amxmodx/plugins
3. Fisierul names.ini il puneti in addons/amxmodx/plugins
4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

block_names.amxx
Cvars :[/b]
  • namescan_msg "[AMXX] Change Your name" - acest cvar setezi mesaju care sa il afiseze cand ii da kick !
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests