Modificare Plugin gag

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
lazlo1234
Membru, skill +1
Membru, skill +1
Posts: 390
Joined: 09 Jul 2012, 23:08
Detinator Steam: Da
CS Status: MISCA MISCA DIN BURIC
Detinator server CS: DA
SteamID: nu am
Location: localhost
Has thanked: 114 times
Been thanked: 7 times
Contact:

30 Jul 2012, 01:02

Modificatim si mie pluginu de mai jos , atunci cand dau gag scrie mesaju tot dar nu e bun adica nu da gag playeru care primeste gag poate sa vorbeasca :| , facetimil si mie please ! MS


| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <colorchat>

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

//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[1])) != -1) {
				g_Len = g_Words[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;
}
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

30 Jul 2012, 02:27

Pune amx_gag.amxx deasupra de ghostchat sau cel mai bine punel primul in lista !
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
ik1d0x@redfear.ro
OwN3d#WTF?!
Membru, skill +1
Membru, skill +1
Posts: 109
Joined: 18 Jun 2012, 21:11
Detinator Steam: Da
CS Status: Vreau sa invat scripting
Has thanked: 11 times
Been thanked: 6 times
Contact:

30 Jul 2012, 10:47

incearca amx_mute
No signature.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests