amx_gag_ban

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
mast3rwap
Membru, skill +1
Membru, skill +1
Posts: 324
Joined: 11 Feb 2012, 21:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: da
SteamID: berlo1990
Location: italia
Has thanked: 30 times
Been thanked: 5 times
Contact:

22 Jul 2012, 21:43

Deci folosesc Pluginul amx_gag_ban dar nu merge corect,adica cand dau gag la un player tot poate sa vorbeasca in chat

Code: Select all

include <amxmodx>
#include <amxmisc>
#include <colorchat>

//Prefix la mesajele in chat
#define PREFIX "[global]"

//Bools
new bool:g_Gaged[33];
new g_GagTime[33];

//Cvar-uri
new cvar_gag_time, cvar_gag_ban_reason,cvar_gag_ban_time,cvar_ban,cvar_file,cvar_sound,cvar_admin;

//Sunet
new const g_Sound[] = "lafel_gag.wav";

//Nume fisier
new const g_FileName[] = "amx_gag_words.ini";

//Fisier
new g_File[128];
new g_Words[64][32], g_Count, g_Len;

public plugin_init() {
	register_plugin("AMX GAG", "0.08", "Ex3cuTioN");
	
	//Comenzi admin
	register_concmd("amx_gag", "cmdGag", ADMIN_KICK,"- <target> <minutes>" );
	register_concmd("amx_ungag", "cmdUngag", ADMIN_KICK, "- <target>");
	
	//Comanda de chat
	register_clcmd("say", "sayHandle");
	register_clcmd("say_team", "sayHandle");
	
	//Cvar-uri
	cvar_gag_time = register_cvar("amx_gag_time", "3");
	cvar_ban = register_cvar("amx_gag_ban", "1");
	cvar_gag_ban_reason = register_cvar("amx_gag_ban_reason", "Deconectare cu gag");
	cvar_gag_ban_time = register_cvar("amx_gag_ban_time", "15");
	cvar_file = register_cvar("amx_gag_file", "0");
	cvar_sound = register_cvar("amx_gag_sound", "1");
	cvar_admin = register_cvar("amx_gag_admin", "1");
}

public plugin_cfg() {
	if(get_pcvar_num(cvar_file)) {
		static dir[64];
		get_localinfo( "amxx_configsdir", dir, 63 );
		formatex(g_File, 127 , "%s/%s" , dir, g_FileName);
		
		if(!file_exists(g_File))
			write_file(g_File, "[Cuvinte interzise pe server]", -1);
			
		new Len;
		while(g_Count < 64 && read_file(g_File, g_Count ,g_Words[g_Count][ 1 ], 30, Len)) {
			g_Words[g_Count][0] = Len;
			g_Count++;
		}
	}
}

public plugin_precache() {
	if(get_pcvar_num(cvar_sound))
		precache_sound(g_Sound);
}

public client_putinserver(id) {
	g_Gaged[id] = false;
	g_GagTime[id] = 0;
}

public client_disconnect(id) {
	//Daca are gag primeste ban
	if(get_pcvar_num(cvar_ban) && g_Gaged[id]) {
		new reason[32];
		get_pcvar_string(cvar_gag_ban_reason, reason, 31);
		
		server_cmd("amx_ban ^"%s^" %i ^"%s^"",get_name(id),get_pcvar_num(cvar_gag_ban_time),reason);
		
		ColorChat(0,GREEN,"%s^x03 %s^x01 a primit ban^x04 %d^x01 minute.Motiv : ^x04 %s",PREFIX,get_name(id),get_pcvar_num(cvar_gag_ban_time),reason);
		
		remove_task(id + 123);
		
		ColorChat(0, GREEN, "%s^x03 %s^x01<%s><%s> s-a deconectat dupa gag.",PREFIX,get_name(id), get_steamid(id), get_ip(id));
	}
	
	g_Gaged[id] = false
	g_GagTime[id] = 0;
}

public sayHandle(id) {	
	new said[192];
	read_args(said,191);
	
	if(!strlen(said) || get_pcvar_num(cvar_admin))
		return PLUGIN_CONTINUE;
		
	if(g_Gaged[id]) {
		ColorChat(id,GREEN,"%s^x01 Mai ai^x04 %i^x01 minute din gag.",PREFIX,g_GagTime[id]);
		return PLUGIN_HANDLED;
	}
	else if(get_pcvar_num(cvar_file)) {
		new bool:Injura, i, pos;
		
		for(i = 0; i<g_Count; ++i) {
			if((pos = containi(said, g_Words[i][1])) != -1) {
				g_Len = g_Words[i][0];
				
				while(g_Len--)
					said[pos++] = '*';
					
				Injura = true;
				continue;
			}
		}
		
		if(Injura) {
			new timp = get_pcvar_num(cvar_gag_time);
			g_Gaged[id] = true;
			g_GagTime[id] = timp;
	
			ColorChat(0,GREEN,"%s^x01 Jucatorul^x04 %s^x01 a primit mut pentru^x04 %i^x01 minute datorita limbajului.",PREFIX,get_name(id),timp);

			set_task(60.0, "count", id+123, _, _, "b");
			
			if(get_pcvar_num(cvar_sound))
				client_cmd(0, "spk ^"sound/%s^"", g_Sound);
			
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

public cmdGag(id, level, cid) {
	if(!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED;
		
	new arg[32], arg2[6];
	
	read_argv(1, arg, 31);
	read_argv(2, arg2, 5);
	
	new player = cmd_target(id, arg, 8);
	
	if(!player)
		return PLUGIN_HANDLED;
	
	if(g_Gaged[player]) {
		console_print(id,"Jucatorul %s are deja gag.",get_name(player));
		return PLUGIN_HANDLED;
	}
	
	if(equal(arg2,""))
		g_GagTime[player] = get_pcvar_num(cvar_gag_time);
	else
		g_GagTime[player] = str_to_num(arg2);
	
	g_Gaged[player] = true;
	
	ColorChat(0,GREEN,"%s^x01 Jucatorul^x04 %s^x01 a primit mut de la adminul^x04 %s^x01 pentru^x04 %i^x01 minute.",PREFIX,get_name(player),get_name(id),g_GagTime[player]);

	set_task(60.0, "count", player+123, _, _, "b");
	
	if(get_pcvar_num(cvar_sound))
		client_cmd(0, "spk ^"sound/%s^"", g_Sound);
	
	return PLUGIN_HANDLED;
}

public cmdUngag(id,level, cid) {
	if(!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED;
		
	new arg[32];
	read_argv(1, arg, 31);
	
	new player = cmd_target(id, arg, 8);
	
	if(!player)
		return PLUGIN_HANDLED;
		
	if(!g_Gaged[player]) {
		console_print( id, "Jucatorul %s nu are mut.",get_name(player));
		return PLUGIN_HANDLED;
	}
	
	g_Gaged[player] = false;
	
	remove_task(player + 123);
	
	ColorChat(0,GREEN,"%s^x03 %s^x01 ii da voie sa vorbeasca lui^x04 %s.",PREFIX,get_name(id),get_name(player));
	
	return PLUGIN_HANDLED;
}
	
public count(task) {
	new player = task - 123;
	
	if(!is_user_connected(player))
		return PLUGIN_HANDLED;
		
	g_GagTime[player] -= 1;
	
	if(g_GagTime[player] <= 0) {
		remove_task(player + 123);
		
		ColorChat(0,GREEN,"%s^x01 Jucatorul^x04 %s^x01 are voie sa vorbeasca.",PREFIX,get_name(player));
		g_Gaged[player] = false;

		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

stock get_name(id) {
	new name[32];
	
	get_user_name(id,name,31);
	
	return name;
}

stock get_steamid(id) {
	static steamid[32];
	
	get_user_authid(id,steamid,31);
	
	return steamid;
}

stock get_ip(id) {
	static ip[32];
	
	get_user_ip(id,ip,31);
	
	return ip;
}
Postez aici si plugins.ini

Code: Select all

; Pluginuri !

; Baza admin - intotdeauna una trebuie sa fie activata
admin.amxx		; baza admin
;admin_sql.amxx		; baza admin - versiunea SQL

; Baza
amx_gag_ban.amxx
admincmd.amxx		; comenzile de baza pentru admini
;adminhelp.amxx		; comanda ajutatoare pentru admini
adminslots.amxx		; rezervare slot
;multilingual.amxx	; management multilingvistic

; Meniuri
menufront.amxx		; front-end pentru meniuri admin
cmdmenu.amxx		; meniu comenzi (vorbire, setari)
plmenu.amxx		; meniu jucatori (kick, ban, comenzi client)
mapsmenu.amxx		; meniu harti (votare, schimbare harta)
pluginmenu.amxx		; meniu pentru comenzi/cvaruri organizate prin plugin

; Chat / Mesaje
adminchat.amxx		; comenzi pentru chat
antiflood.amxx		; avertizeaza jucatorii pentru flood-chat
scrollmsg.amxx		; afiseaza un mesaj miscator
;imessage.amxx		; afiseaza mesaje informative
adminvote.amxx		; comenzi de votare

; Harti
nextmap.amxx		; afiseaza harta urmatoare din mapcycle.txt
mapchooser.amxx		; permite votul pentru urmatoarea harta
timeleft.amxx		; afiseaza timpul ramas pe harta

; Configurare
;pausecfg.amxx		; permite pauza/rezumarea unor pluginuri
statscfg.amxx		; permite administrarea pluginurilor prin meniu si comenzi

; Counter-Strike
top15.amxx
;restmenu.amxx		; meniul de restrictie al armelor
statsx.amxx		; statistici la sfarsitul rundei [/rank, /top15] (modulul CSX trebuie activat din modules.ini!)
;miscstats.amxx		; un set de anunturi pentru Counter-Strike
;stats_logging.amxx	; logarea statisticilor armelor (modulul CSX trebuie activat din modules.ini!)
;amxmod_compat.amxx	; pentru a accepta compatibilitatea cu AMX Mod

; Particularizate - adaugati aici orice alte pluginuri aveti nevoie
;====================================================================================================================
                              ========================================
;====================================================================================================================
Krond-Functions.amxx
auto_restart_vl.amxx
advertisements.amxx
who_ionutz.amxx
admin_spec_esp.amxx
amx_showip.amxx
amx_destroy.amxx
blind.amxx
luciaHallucination.amxx debug
pingfaker.amxx
rs.amxx
finish_round_stats.amxx
allchat.amxx
;ultimate_who2.amxx
c4_timer_hud_sound.amxx
ultimate_ss.amxx
flashbang_dlight.amxx
no_team_flash.amxx
tfts_transfer.amxx
killerview.amxx
fast_sniper_switch.amxx
Care ma ajuta primeste +1multumesc
User avatar
tweky
Fost moderator
Fost moderator
Posts: 2632
Joined: 22 Jun 2009, 00:54
Detinator Steam: Da
CS Status: Inactiv
Detinator server CS: Da
SteamID: twekymihai
Reputatie: Fost eXtream Mod
Nume anterior: Mihaita
Fost Membru Club eXtreamCS
Location: Ilfov
Has thanked: 117 times
Been thanked: 166 times
Contact:

25 Jul 2012, 12:39

La fel am patit si eu pana am scos pluginul cu admin chat color , si mi-a mers tu ai acest plugin ?
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests