advanced_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
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:

17 Jun 2012, 18:44

Deci am pus pluginul acesta pe server,dar doar ownerii si fondatorii pot da gag,ceilalti nu au acces,adica co-owneri,moderatori..etc care ma ajuta

Code: Select all

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Advanced Gag"
#define VERSION "2.1"
#define AUTHOR "anakin_cstrike"

#define ACCESS 			ADMIN_KICK
#define WORDS			64
#define SWEAR_GAGMINUTES	2
#define SHOW

new const tag[] = "[Gag]";
new const g_FileName[] = "gag_words.ini";

new 
bool:g_Gaged[ 33 ], g_GagTime[ 33 ],
bool:g_SwearGag[ 33 ], bool:g_CmdGag[ 33 ],
bool:g_NameChanged[33];

new g_reason[ 32 ], g_admin[ 32 ], g_name[ 33 ][ 32 ];

new g_WordsFile[ 128 ];
new g_Words[ WORDS ][ 32 ], g_Count, g_Len;

new point, g_msgsaytext;
new toggle_tag, toggle_admins;

public plugin_init() 
{
	register_plugin( PLUGIN, VERSION, AUTHOR );
	register_dictionary( "advanced_gag.txt" );
	
	register_concmd( "amx_gag", "gag_cmd", ACCESS,"- <target> <minutes> <reason>" );
	register_concmd( "amx_ungag", "ungag_cmd", ACCESS, "- <target>" );
	register_clcmd( "say", "check" );
	register_clcmd( "say_team", "check" );
	
	toggle_tag = register_cvar( "gag_tag", "1" );
	toggle_admins = register_cvar( "gag_admins", "0" );
	point = get_cvar_pointer( "amx_show_activity" );
	g_msgsaytext = get_user_msgid( "SayText" );
	
}

public plugin_cfg()
{
	static dir[ 64 ];
	get_localinfo( "amxx_configsdir", dir, 63 );
	formatex( g_WordsFile , 127 , "%s/%s" , dir, g_FileName );
	
	if( !file_exists( g_WordsFile ) )
		write_file( g_WordsFile, "[Gag Words]", -1 );
		
	new Len;
	
	while( g_Count < WORDS && read_file( g_WordsFile, g_Count ,g_Words[ g_Count ][ 1 ], 30, Len ) )
	{
		g_Words[ g_Count ][ 0 ] = Len;
		g_Count++;
	}
}

public gag_cmd( id, level, cid )
{
	if( !cmd_access( id, level, cid, 4 ) )
		return PLUGIN_HANDLED;
		
	new arg[ 32 ], arg2[ 6 ], reason[ 32 ];
	new name[ 32 ], namet[ 32 ];
	new minutes;
	
	read_argv( 1, arg, sizeof arg - 1 );
	read_argv( 2, arg2, sizeof arg2 - 1 );
	read_argv( 3, reason, sizeof reason - 1 );
	
	get_user_name( id, name, 31 );
	
	copy( g_admin, 31, name );
	copy( g_reason, 31, reason );
	remove_quotes( reason );
	
	minutes = str_to_num( arg2 );
	
	new target = cmd_target( id, arg, 10 );
	if( !target)
		return PLUGIN_HANDLED;
	
	if( g_Gaged[ target ] )
	{
		console_print( id, "%L",id, "GAG_ALLREDYGAGED" );
		return PLUGIN_HANDLED;
	}
	
	get_user_name( target, namet, 31 );
	copy( g_name[ target ], 31, namet );
	
	g_CmdGag[ target ] = true;
	g_Gaged[target] = true;
	g_GagTime[ target ] = minutes;
	
	#if defined SHOW
		print( 0, "%L", LANG_PLAYER, "GAG_ADMINGAGEDPLAYER",get_pcvar_num( point ) == 2 ? name : "", namet, minutes, reason );
	#endif
	
	print( target, "%L", target ,"GAG_ADMINHASGAGEDYOU", get_pcvar_num( point ) == 2 ? name : "", minutes, reason );
	
	if( get_pcvar_num( toggle_tag ) == 1 )
	{
		new Buffer[ 64 ];
		formatex( Buffer, sizeof Buffer - 1, "%s %s", tag, namet );
		
		g_NameChanged[ target ] = true;
		client_cmd( target, "name ^"%s^"",Buffer );
	}
	
	set_task( 60.0, "count", target + 123, _, _, "b" );
	
	return PLUGIN_HANDLED;
}

public ungag_cmd( id,level, cid )
{
	if( !cmd_access( id, level, cid, 2 ) )
		return PLUGIN_HANDLED;
		
	new arg[ 32 ], reason[ 32 ], name[ 32 ];
	read_argv( 1, arg, sizeof arg - 1 );
	read_argv( 2, reason, sizeof reason - 1 );
	get_user_name( id, name, sizeof name - 1 );
	remove_quotes( reason );
	
	new target = cmd_target( id, arg, 11 );
	if( !target )
		return PLUGIN_HANDLED;
	new namet[ 32 ];
	get_user_name( target, namet, sizeof namet - 1 );
	
	if( !g_Gaged[ target ] )
	{
		console_print( id, "%L", id, "GAG_PLAYERNOTGAGED", namet );
		return PLUGIN_HANDLED;
	}
	
	g_Gaged[ target ] = false;
	g_SwearGag[ target ] = false;
	
	if( g_NameChanged[ target ] )
		client_cmd( target, "name ^"%s^"", g_name[ target ] );
		
	g_NameChanged[ target ] = false;
	
	remove_task( target + 123 );
	
	#if defined SHOW
		print( 0, "%L", LANG_PLAYER, "GAG_ADMINUNGAGEDPLAYER",get_pcvar_num( point ) == 2 ? name : "", namet );
	#endif
	
	print( target, "%L", target ,"GAG_ADMINHASUNGAGEDYOU", get_pcvar_num( point ) == 2 ? name : "", reason[ 0 ] ? reason : "-" );
	
	return PLUGIN_HANDLED;
}
	
public count( task )
{
	new index = task - 123;
	if( !is_user_connected( index ) )
		return 0;
		
	g_GagTime[index] -= 1;
	
	if( g_GagTime[ index ] <= 0 )
	{
		remove_task( index + 123 );
		
		print( index, "%L", index, "GAG_AUTOUNGAGED" );
		g_Gaged[ index ] = false;
	
		if( g_NameChanged[ index ] )
			client_cmd( index, "name ^"%s^"", g_name[ index ] );
		
		return 0;
	}
	
	return 1;
}

public check( id )
{
	if( ( get_user_flags( id ) & ACCESS ) && get_pcvar_num( toggle_admins ) == 0 )
		return PLUGIN_CONTINUE;
		
	new said[ 192 ];
	read_args( said, sizeof said - 1 );
	
	if( !strlen( said ) )
		return PLUGIN_CONTINUE;
		
	if( g_Gaged[ id ] )
	{
		if( g_CmdGag[ id ] )
		{
			print( id,"%L", id, "GAG_CANTSPEAK_ADMINCMD" ,g_admin, g_GagTime[ id ], g_GagTime[ id ] == 1 ? "" : "s" );
			print( id,"%L", id, "GAG_WORDREASON", g_reason );
			
			return PLUGIN_HANDLED;
		
		} else if( g_SwearGag[ id ] ) {
			print( id, "%L", id, "GAG_CANTSPEAK_SWEAR",  g_GagTime[ id ], g_GagTime[ id ] == 1 ? "" : "s" );
			return PLUGIN_HANDLED;
		}
	} else {
		
		new bool:g_Sweared, 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++ ] = '*';
					
				g_Sweared = true;
				continue;
			}
		}
		
		if( g_Sweared )
		{
			new cmd[ 32 ], name[ 32 ];
			
			get_user_name( id, name, sizeof name - 1 );
			read_argv( 0, cmd, sizeof cmd - 1 );
			copy( g_name[ id ], 31, name );
			
			engclient_cmd( id, cmd, said );
			g_Gaged[ id ] = true;
			g_CmdGag[ id ] = false;
			
			if( get_pcvar_num( toggle_tag ) == 1 )
			{
				new Buffer[ 64 ];
				formatex( Buffer, sizeof Buffer - 1, "%s %s", tag, name );
		
				g_NameChanged[ id ] = true;
				client_cmd( id, "name ^"%s^"", Buffer) ;
			}
			
			g_SwearGag[ id ] = true;
			g_GagTime[ id ] = SWEAR_GAGMINUTES;
			
			print( id, "%L", id, "GAG_GAGFORSWEAR" );
		
			set_task( 60.0, "count",id+123,_,_,"b");
			
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_CONTINUE;
}

print( id, const message[ ], { Float, Sql, Result, _ }:... )
{
	new Buffer[ 128 ], Buffer2[ 128 ];
	
	formatex( Buffer2, sizeof Buffer2 - 1, "%s", message );
	vformat( Buffer, sizeof Buffer - 1, Buffer2, 3 );
	
	if( id )
	{
		message_begin( MSG_ONE, g_msgsaytext, _,id );
		write_byte( id );
		write_string( Buffer) ;
		message_end();
	
	} else {
		new players[ 32 ], index, num, i;
		get_players( players, num, "ch" );
		
		for( i = 0; i < num; i++ )
		{
			index = players[ i ];
			if( !is_user_connected( index ) ) continue;
			
			message_begin( MSG_ONE, g_msgsaytext, _, index );
			write_byte( index );
			write_string( Buffer );
			message_end();
		}
	}
}
RoyalServer 2
User avatar
Awakening
eXtream Mod
eXtream Mod
Posts: 3933
Joined: 06 Apr 2010, 11:01
Detinator Steam: Da
CS Status: Plictiseala
Detinator server CS: Adio cs
SteamID: eliara
Reputatie: eXtream Mod
Fost Manager VEST.eXtream.Ro
Fost Manager ZM.eXtream.Ro
Membru Club eXtreamCS (6 luni)
Nume anterior: CRISTIAN
Location: Bucuresti
Discord: m_i3
Has thanked: 151 times
Been thanked: 344 times

17 Jun 2012, 18:57

Code: Select all

#define ACCESS          ADMIN_KICK
Le pui acces de kick si pot folosi
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:

17 Jun 2012, 19:10

si cum il pun,Da-mi detalii
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:

17 Jun 2012, 19:14

De exemplu la acesele astea "abcdefghijlmnopqrs" "a" nu poate da gag si e co owner
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 13:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 306 times
Been thanked: 321 times
Contact:

17 Jun 2012, 19:51

Cred ca ai nevoie de asta :

Code: Select all

; Users configuration file
; File location: $moddir/addons/amxmodx/configs/users.ini

; Line starting with ; is a comment

; Access flags:
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
; b - reservation (can join on reserved slots)
; c - amx_kick command
; d - amx_ban and amx_unban commands
; e - amx_slay and amx_slap commands
; f - amx_map command
; g - amx_cvar command (not all cvars will be available)
; h - amx_cfg command
; i - amx_chat and other chat commands
; j - amx_vote and other vote commands
; k - access to sv_password cvar (by amx_cvar command)
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
; m - custom level A (for additional plugins)
; n - custom level B
; o - custom level C
; p - custom level D
; q - custom level E
; r - custom level F
; s - custom level G
; t - custom level H
; u - menu access
; z - user (no admin)

; Account flags:
; a - disconnect player on invalid password
; b - clan tag
; c - this is steamid/wonid
; d - this is ip
; e - password is not checked (only name/ip/steamid needed)
; k - name or tag is case sensitive. eg: if you set it so the name "Ham"
; is protected and case sensitive (flags "k" only), then anybody
; can use the names "haM", "HAM", "ham", etc, but not "Ham"

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
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:

17 Jun 2012, 20:07

Si ce fac cu ala de mai sus?
User avatar
h4wk
Fost moderator
Fost moderator
Posts: 3806
Joined: 22 Sep 2009, 13:10
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Nume anterior : DaZ , zimpe , Dan eXtream
Location: Iasi
Has thanked: 306 times
Been thanked: 321 times
Contact:

17 Jun 2012, 20:51

mast3rwap wrote:Si ce fac cu ala de mai sus?
Vezi accesele :) ..Astfel poti 'schimba' accesele adminilor.
exemplu :

Code: Select all

c - amx_kick command
; d - amx_ban and amx_unban commands
; e - amx_slay and amx_slap commands

Code: Select all

"Daca ai culoare nu inseamna ca esti mai presus ca un utilizator. Culoare e un fel de "rasplata" pentru ca te implici in "ridicarea" acestei comunitati.
Unii nu realizeaza ca daca ai culoare nu inseamna ca esti smecher." -- by Alexey
:troll :troll

Spui ceva,dar faci altceva !
User avatar
MHz&3viL
Membru, skill +1
Membru, skill +1
Posts: 184
Joined: 26 Nov 2007, 21:41
Detinator Steam: Da
CS Status: EviL ZonE
Detinator server CS: cs.evilz.ro
SteamID: mhz_evilz
Location: Satu Mare
Has thanked: 1 time
Been thanked: 13 times

17 Jun 2012, 22:14

Plugin-ul nu are nimic, intra in folder-ul addons-ului si sterge cmdaccess.ini. Dai restart la server.
User avatar
J3FF
Membru, skill +1
Membru, skill +1
Posts: 472
Joined: 27 Oct 2007, 20:02
Detinator Steam: Nu
CS Status: ON and Ready 2 PLAY
Detinator server CS: Nu
Location: SiBiU
Has thanked: 25 times
Been thanked: 39 times

17 Jun 2012, 23:08

Nu e adevarat .... sunt alte flaguri , alea sunt doar accesele ...

Zi ce litera vrei si til fac eu , eu recomand accesul A (imunitate)
Unii ma mai stiu de e t n a d

Image
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:

18 Jun 2012, 00:29

Am facut ceea ce a spus MHZ si a mers,mersi puteti da t/c
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot], Semrush [Bot] and 23 guests