Cerere adminchat colorat + statsx colorat

Cereri de pluginuri noi, skinuri in CS, etc.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
JaponezuEnd
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 29 Jul 2018, 12:28
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

03 Oct 2021, 19:26

Salut dupa cum spune si tilul as dori un adminchat colorat , am cautat atat dar din atatea exista o problema , aceea problema era cand scriam ca admin + @ mesajul aparea ok , daca scria un player in u@ aparea (ADMINS) in loc de ( PLAYER ) asa ca v-as ruga frumos daca puteti sa imi faceti un adminchat care sa fie ceva de genu

[ * ADMIN * ] ** NUME : Mesaj

[ * PLAYER * ] ** NUME : Mesaj

Si as mai dori decat la statsx sa apara colorat cand scrii rank , me , hp si atat

Multumesc frumos
lexz
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Detinator server CS: CSGO.WARFACE.RO
SteamID: profiles/76561198070
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 11 times
Been thanked: 23 times

03 Oct 2021, 20:27

lasa pluginul la care ai avut probleme si ti-l modific eu.
JaponezuEnd
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 29 Jul 2018, 12:28
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

04 Oct 2021, 01:57

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <K1d0x_C_Color>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}

new amx_show_activity;
new g_AdminChatFlag = ADMIN_CHAT;

public plugin_init()
{
	new admin_chat_id

	register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
	register_dictionary("adminchat.txt")
	register_dictionary("common.txt")
	register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
	register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
	register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
	admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
	register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
	register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
	register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")
	
	amx_show_activity = get_cvar_pointer("amx_show_activity");
	
	if (amx_show_activity == 0)
	{
		amx_show_activity = register_cvar("amx_show_activity", "2");
	}

	new str[1]
	get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
}

public cmdSayChat(id)
{
	if (!access(id, g_AdminChatFlag))
	{
		return PLUGIN_CONTINUE
	}
	
	new said[6], i = 0
	read_argv(1, said, 5)
	
	while (said[i] == '@')
	{
		i++
	}
	
	if (!i || i > 3)
	{
		return PLUGIN_CONTINUE
	}
	
	new message[192], a = 0
	read_args(message, 191)
	remove_quotes(message)
	
	switch (said[i])
	{
		case 'r': a = 1
		case 'g': a = 2
		case 'b': a = 3
		case 'y': a = 4
		case 'm': a = 5
		case 'c': a = 6
		case 'o': a = 7
	}
	
	new n, s = i
	if (a)
	{
		n++
		s++
	}
	while (said[s] && isspace(said[s]))
	{
		n++
		s++
	}
	

	new name[32], authid[32], userid
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])
	
	if (++g_msgChannel > 6 || g_msgChannel < 3)
	{
		g_msgChannel = 3
	}
	
	new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0
	
	set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

	switch ( get_pcvar_num(amx_show_activity) )
	{
		case 3, 4:
		{
			new maxpl = get_maxplayers();
			for (new pl = 1; pl <= maxpl; pl++)
			{
				if (is_user_connected(pl) && !is_user_bot(pl))
				{
					if (is_user_admin(pl))
					{
						show_hudmessage(pl, "%s :   %s", name, message[i + n])
						client_print(pl, print_notify, "%s :   %s", name, message[i + n])
					}
					else
					{
						show_hudmessage(pl, "%s", message[i + n])
						client_print(pl, print_notify, "%s", message[i + n])
					}
				}
			}
		}
		case 2:
		{
			show_hudmessage(0, "%s :   %s", name, message[i + n])
			client_print(0, print_notify, "%s :   %s", name, message[i + n])
		}
		default:
		{
			show_hudmessage(0, "%s", message[i + n])
			client_print(0, print_notify, "%s", message[i + n])
		}
	}

	return PLUGIN_HANDLED
}

public cmdSayAdmin(id)
{
	new said[2]
	read_argv(1, said, 1)
	
	if (said[0] != '@')
		return PLUGIN_CONTINUE
	
	new message[192], name[32], authid[32], userid
	new players[32], inum
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])
	
	if (is_user_admin(id))
		format(message, 191, "!e(%L) !v%s !e:  %s", id, "ADMIN", name, message[1])
	else
		format(message, 191, "!e(%L) !v%s !e:  !c%s", id, "PLAYER", name, message[1])

	get_players(players, inum)
	
	for (new i = 0; i < inum; ++i)
	{
		// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
		if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
			K1d0x_C_Color(players[i], "%s", message)
	}
	
	K1d0x_C_Color(id, "%s", message)
	
	return PLUGIN_HANDLED
}

public cmdChat(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new message[192], name[32], players[32], inum, authid[32], userid
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	get_players(players, inum)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
	
	format(message, 191, "(ADMINS) %s :   %s", name, message)
	console_print(id, "%s", message)
	
	for (new i = 0; i < inum; ++i)
	{
		if (access(players[i], g_AdminChatFlag))
			client_print(players[i], print_chat, "%s", message)
	}
	
	return PLUGIN_HANDLED
}

public cmdSay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new message[192], name[32], authid[32], userid
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	K1d0x_C_Color(0, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	
	log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
	log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)
	
	return PLUGIN_HANDLED
}

public cmdPsay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new name[32]
	read_argv(1, name, 31)
	new priv = cmd_target(id, name, 0)

	if (!priv)
		return PLUGIN_HANDLED
	
	new length = strlen(name) + 1

	get_user_name(priv, name, 31); 
	
	new message[192], name2[32], authid[32], authid2[32], userid, userid2
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name2, 31)
	userid = get_user_userid(id)
	read_args(message, 191)
	
	if (message[0] == '"' && message[length] == '"') // HLSW fix
	{
		message[0] = ' '
		message[length] = ' '
		length += 2
	}
	
	remove_quotes(message[length])
	get_user_name(priv, name, 31)
	
	if (id && id != priv)
		K1d0x_C_Color(id, "!e(%s) !v%s !e:   !c%s", name, name2, message[length])
	
	K1d0x_C_Color(priv, "!e(%s) !v%s !e:   !c%s", name, name2, message[length])
	console_print(id, "(%s) %s :   %s", name, name2, message[length])
	get_user_authid(priv, authid2, 31)
	userid2 = get_user_userid(priv)
	
	log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])
	
	return PLUGIN_HANDLED
}

public cmdTsay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0
	
	read_argv(0, cmd, 15)
	new bool:tsay = (tolower(cmd[4]) == 't')
	
	read_args(message, 191)
	remove_quotes(message)
	parse(message, color, 15)
	
	new found = 0, a = 0
	new lang[3], langnum = get_langsnum()

	for (new i = 0; i < MAX_CLR; ++i)
	{
		for (new j = 0; j < langnum; j++)
		{
			get_lang(j, lang)
			format(color2, 15, "%L", lang, g_Colors[i])
			
			if (equali(color, color2))
			{
				a = i
				found = 1
				break
			}
		}
		if (found == 1)
			break
	}
	
	new length = found ? (strlen(color) + 1) : 0
	
	if (++g_msgChannel > 6 || g_msgChannel < 3)
		g_msgChannel = 3

	new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

	switch ( get_pcvar_num(amx_show_activity) )
	{
		case 3, 4:
		{
			new maxpl = get_maxplayers();
			for (new pl = 1; pl <= maxpl; pl++)
			{
				if (is_user_connected(pl) && !is_user_bot(pl))
				{
					if (is_user_admin(pl))
					{
						show_hudmessage(pl, "%s :   %s", name, message[length])
						client_print(pl, print_notify, "%s :   %s", name, message[length])
					}
					else
					{
						show_hudmessage(pl, "%s", message[length])
						client_print(pl, print_notify, "%s", message[length])
					}
				}
			}
			console_print(id, "%s :  %s", name, message[length])
		}
		case 2:
		{
			show_hudmessage(0, "%s :   %s", name, message[length])
			client_print(0, print_notify, "%s :   %s", name, message[length])
			console_print(id, "%s :  %s", name, message[length])
		}
		default:
		{
			show_hudmessage(0, "%s", message[length])
			client_print(0, print_notify, "%s", message[length])
			console_print(id, "%s", message[length])
		}
	}

	log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
	log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)

	return PLUGIN_HANDLED
}
Asta e ultimul adaugat recent , la restu nu am sma-ul si la asta tot asa face , am dezactivat cam toate pluginurile am zis ca poate e de la unu dintre ele dar degeaba .
lexz
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Detinator server CS: CSGO.WARFACE.RO
SteamID: profiles/76561198070
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 11 times
Been thanked: 23 times

04 Oct 2021, 03:48

Verifica si fisierul .txt din lang, trebuie sa fie ceva de genul

Code: Select all

PLAYER = PLAYER
ADMIN = ADMIN

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <K1d0x_C_Color>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}

new amx_show_activity;
new g_AdminChatFlag = ADMIN_CHAT;

public plugin_init()
{
	new admin_chat_id

	register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
	register_dictionary("adminchat.txt")
	register_dictionary("common.txt")
	register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
	register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
	register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
	admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
	register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
	register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
	register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")
	
	amx_show_activity = get_cvar_pointer("amx_show_activity");
	
	if (amx_show_activity == 0)
	{
		amx_show_activity = register_cvar("amx_show_activity", "2");
	}

	new str[1]
	get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
}

public cmdSayChat(id)
{
	if (!access(id, g_AdminChatFlag))
	{
		return PLUGIN_CONTINUE
	}
	
	new said[6], i = 0
	read_argv(1, said, 5)
	
	while (said[i] == '@')
	{
		i++
	}
	
	if (!i || i > 3)
	{
		return PLUGIN_CONTINUE
	}
	
	new message[192], a = 0
	read_args(message, 191)
	remove_quotes(message)
	
	switch (said[i])
	{
		case 'r': a = 1
		case 'g': a = 2
		case 'b': a = 3
		case 'y': a = 4
		case 'm': a = 5
		case 'c': a = 6
		case 'o': a = 7
	}
	
	new n, s = i
	if (a)
	{
		n++
		s++
	}
	while (said[s] && isspace(said[s]))
	{
		n++
		s++
	}
	

	new name[32], authid[32], userid
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])
	
	if (++g_msgChannel > 6 || g_msgChannel < 3)
	{
		g_msgChannel = 3
	}
	
	new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0
	
	set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

	switch ( get_pcvar_num(amx_show_activity) )
	{
		case 3, 4:
		{
			new maxpl = get_maxplayers();
			for (new pl = 1; pl <= maxpl; pl++)
			{
				if (is_user_connected(pl) && !is_user_bot(pl))
				{
					if (is_user_admin(pl))
					{
						show_hudmessage(pl, "%s :   %s", name, message[i + n])
						client_print(pl, print_notify, "%s :   %s", name, message[i + n])
					}
					else
					{
						show_hudmessage(pl, "%s", message[i + n])
						client_print(pl, print_notify, "%s", message[i + n])
					}
				}
			}
		}
		case 2:
		{
			show_hudmessage(0, "%s :   %s", name, message[i + n])
			client_print(0, print_notify, "%s :   %s", name, message[i + n])
		}
		default:
		{
			show_hudmessage(0, "%s", message[i + n])
			client_print(0, print_notify, "%s", message[i + n])
		}
	}

	return PLUGIN_HANDLED
}

public cmdSayAdmin(id)
{
	new said[2]
	read_argv(1, said, 1)
	
	if (said[0] != '@')
		return PLUGIN_CONTINUE
	
	new message[192], name[32], authid[32], userid
	new players[32], inum
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])
	
	if (get_user_flags(id) & ADMIN_KICK)
		format(message, 191, "!e(%L) !v%s !e:  %s", id, "ADMIN", name, message[1])
	else
		format(message, 191, "!e(%L) !v%s !e:  !c%s", id, "PLAYER", name, message[1])

	get_players(players, inum)
	
	for (new i = 0; i < inum; ++i)
	{
		// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
		if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
			K1d0x_C_Color(players[i], "%s", message)
	}
	
	K1d0x_C_Color(id, "%s", message)
	
	return PLUGIN_HANDLED
}

public cmdChat(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new message[192], name[32], players[32], inum, authid[32], userid
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	get_players(players, inum)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
	
	format(message, 191, "(ADMINS) %s :   %s", name, message)
	console_print(id, "%s", message)
	
	for (new i = 0; i < inum; ++i)
	{
		if (access(players[i], g_AdminChatFlag))
			client_print(players[i], print_chat, "%s", message)
	}
	
	return PLUGIN_HANDLED
}

public cmdSay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new message[192], name[32], authid[32], userid
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	K1d0x_C_Color(0, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	
	log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
	log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)
	
	return PLUGIN_HANDLED
}

public cmdPsay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new name[32]
	read_argv(1, name, 31)
	new priv = cmd_target(id, name, 0)

	if (!priv)
		return PLUGIN_HANDLED
	
	new length = strlen(name) + 1

	get_user_name(priv, name, 31); 
	
	new message[192], name2[32], authid[32], authid2[32], userid, userid2
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name2, 31)
	userid = get_user_userid(id)
	read_args(message, 191)
	
	if (message[0] == '"' && message[length] == '"') // HLSW fix
	{
		message[0] = ' '
		message[length] = ' '
		length += 2
	}
	
	remove_quotes(message[length])
	get_user_name(priv, name, 31)
	
	if (id && id != priv)
		K1d0x_C_Color(id, "!e(%s) !v%s !e:   !c%s", name, name2, message[length])
	
	K1d0x_C_Color(priv, "!e(%s) !v%s !e:   !c%s", name, name2, message[length])
	console_print(id, "(%s) %s :   %s", name, name2, message[length])
	get_user_authid(priv, authid2, 31)
	userid2 = get_user_userid(priv)
	
	log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])
	
	return PLUGIN_HANDLED
}

public cmdTsay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0
	
	read_argv(0, cmd, 15)
	new bool:tsay = (tolower(cmd[4]) == 't')
	
	read_args(message, 191)
	remove_quotes(message)
	parse(message, color, 15)
	
	new found = 0, a = 0
	new lang[3], langnum = get_langsnum()

	for (new i = 0; i < MAX_CLR; ++i)
	{
		for (new j = 0; j < langnum; j++)
		{
			get_lang(j, lang)
			format(color2, 15, "%L", lang, g_Colors[i])
			
			if (equali(color, color2))
			{
				a = i
				found = 1
				break
			}
		}
		if (found == 1)
			break
	}
	
	new length = found ? (strlen(color) + 1) : 0
	
	if (++g_msgChannel > 6 || g_msgChannel < 3)
		g_msgChannel = 3

	new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

	switch ( get_pcvar_num(amx_show_activity) )
	{
		case 3, 4:
		{
			new maxpl = get_maxplayers();
			for (new pl = 1; pl <= maxpl; pl++)
			{
				if (is_user_connected(pl) && !is_user_bot(pl))
				{
					if (is_user_admin(pl))
					{
						show_hudmessage(pl, "%s :   %s", name, message[length])
						client_print(pl, print_notify, "%s :   %s", name, message[length])
					}
					else
					{
						show_hudmessage(pl, "%s", message[length])
						client_print(pl, print_notify, "%s", message[length])
					}
				}
			}
			console_print(id, "%s :  %s", name, message[length])
		}
		case 2:
		{
			show_hudmessage(0, "%s :   %s", name, message[length])
			client_print(0, print_notify, "%s :   %s", name, message[length])
			console_print(id, "%s :  %s", name, message[length])
		}
		default:
		{
			show_hudmessage(0, "%s", message[length])
			client_print(0, print_notify, "%s", message[length])
			console_print(id, "%s", message[length])
		}
	}

	log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
	log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)

	return PLUGIN_HANDLED
}
JaponezuEnd
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 29 Jul 2018, 12:28
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

04 Oct 2021, 12:40

Code: Select all

[en]
COL_WHITE = white
COL_RED = red
COL_GREEN = green
COL_BLUE = blue
COL_YELLOW = yellow
COL_MAGENTA = magenta
COL_CYAN = cyan
COL_ORANGE = orange
COL_OCEAN = ocean
COL_MAROON = maroon
PRINT_ALL = (TOTI) %s : %s
ALL = TOTI
Doar asta apare plus in alte limbi . in adminchat.txt

Edit: am verificat si fisierul common.txt si acolo e ok e cum ai pus tu acolo sus .


Edit 2 : am incercat sa il compilez si imi da asta


adminchat.sma(3) : fatal error 100: cannot read from file: "K1d0x_C_Color"

Compilation aborted.
1 Error.
User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 976
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 100 times
Been thanked: 28 times
Contact:

04 Oct 2021, 14:19

Nu ai acel include (k1d0x cc color chat)
JaponezuEnd
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 29 Jul 2018, 12:28
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

05 Oct 2021, 19:28

Merge multumesc frumos , daca poti sa imi spui unde sa modific sa apara la fel cum am facut eu in primul post cu paranteze drepte si acele stelute etc ?
lexz
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Detinator server CS: CSGO.WARFACE.RO
SteamID: profiles/76561198070
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 11 times
Been thanked: 23 times

05 Oct 2021, 22:59

Code: Select all

if (get_user_flags(id) & ADMIN_KICK)
		format(message, 191, "!e[ *%L* ] ** !v%s !e:  %s", id, "ADMIN", name, message[1])
	else
		format(message, 191, "!e[ *%L* ] ** !v%s !e:  !c%s", id, "PLAYER", name, message[1])

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <K1d0x_C_Color>

new g_msgChannel

#define MAX_CLR 10

new g_Colors[MAX_CLR][] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[MAX_CLR][] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[4][] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}

new amx_show_activity;
new g_AdminChatFlag = ADMIN_CHAT;

public plugin_init()
{
	new admin_chat_id

	register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
	register_dictionary("adminchat.txt")
	register_dictionary("common.txt")
	register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@][w|r|g|b|y|m|c]<text> - displays hud message")
	register_clcmd("say_team", "cmdSayAdmin", 0, "@<text> - displays message to admins")
	register_concmd("amx_say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
	admin_chat_id = register_concmd("amx_chat", "cmdChat", ADMIN_CHAT, "<message> - sends message to admins")
	register_concmd("amx_psay", "cmdPsay", ADMIN_CHAT, "<name or #userid> <message> - sends private message")
	register_concmd("amx_tsay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends left side hud message to all players")
	register_concmd("amx_csay", "cmdTsay", ADMIN_CHAT, "<color> <message> - sends center hud message to all players")
	
	amx_show_activity = get_cvar_pointer("amx_show_activity");
	
	if (amx_show_activity == 0)
	{
		amx_show_activity = register_cvar("amx_show_activity", "2");
	}

	new str[1]
	get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
}

public cmdSayChat(id)
{
	if (!access(id, g_AdminChatFlag))
	{
		return PLUGIN_CONTINUE
	}
	
	new said[6], i = 0
	read_argv(1, said, 5)
	
	while (said[i] == '@')
	{
		i++
	}
	
	if (!i || i > 3)
	{
		return PLUGIN_CONTINUE
	}
	
	new message[192], a = 0
	read_args(message, 191)
	remove_quotes(message)
	
	switch (said[i])
	{
		case 'r': a = 1
		case 'g': a = 2
		case 'b': a = 3
		case 'y': a = 4
		case 'm': a = 5
		case 'c': a = 6
		case 'o': a = 7
	}
	
	new n, s = i
	if (a)
	{
		n++
		s++
	}
	while (said[s] && isspace(said[s]))
	{
		n++
		s++
	}
	

	new name[32], authid[32], userid
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message[i + n])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message[i + n], "en", g_Colors[a])
	
	if (++g_msgChannel > 6 || g_msgChannel < 3)
	{
		g_msgChannel = 3
	}
	
	new Float:verpos = g_Pos[i][1] + float(g_msgChannel) / 35.0
	
	set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], g_Pos[i][0], verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

	switch ( get_pcvar_num(amx_show_activity) )
	{
		case 3, 4:
		{
			new maxpl = get_maxplayers();
			for (new pl = 1; pl <= maxpl; pl++)
			{
				if (is_user_connected(pl) && !is_user_bot(pl))
				{
					if (is_user_admin(pl))
					{
						show_hudmessage(pl, "%s :   %s", name, message[i + n])
						client_print(pl, print_notify, "%s :   %s", name, message[i + n])
					}
					else
					{
						show_hudmessage(pl, "%s", message[i + n])
						client_print(pl, print_notify, "%s", message[i + n])
					}
				}
			}
		}
		case 2:
		{
			show_hudmessage(0, "%s :   %s", name, message[i + n])
			client_print(0, print_notify, "%s :   %s", name, message[i + n])
		}
		default:
		{
			show_hudmessage(0, "%s", message[i + n])
			client_print(0, print_notify, "%s", message[i + n])
		}
	}

	return PLUGIN_HANDLED
}

public cmdSayAdmin(id)
{
	new said[2]
	read_argv(1, said, 1)
	
	if (said[0] != '@')
		return PLUGIN_CONTINUE
	
	new message[192], name[32], authid[32], userid
	new players[32], inum
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1])
	
	if (get_user_flags(id) & ADMIN_KICK)
		format(message, 191, "!e[ *%L* ] ** !v%s !e:  %s", id, "ADMIN", name, message[1])
	else
		format(message, 191, "!e[ *%L* ] ** !v%s !e:  !c%s", id, "PLAYER", name, message[1])

	get_players(players, inum)
	
	for (new i = 0; i < inum; ++i)
	{
		// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
		if (players[i] != id && get_user_flags(players[i]) & g_AdminChatFlag)
			K1d0x_C_Color(players[i], "%s", message)
	}
	
	K1d0x_C_Color(id, "%s", message)
	
	return PLUGIN_HANDLED
}

public cmdChat(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new message[192], name[32], players[32], inum, authid[32], userid
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	get_players(players, inum)
	
	log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
	log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
	
	format(message, 191, "(ADMINS) %s :   %s", name, message)
	console_print(id, "%s", message)
	
	for (new i = 0; i < inum; ++i)
	{
		if (access(players[i], g_AdminChatFlag))
			client_print(players[i], print_chat, "%s", message)
	}
	
	return PLUGIN_HANDLED
}

public cmdSay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 2))
		return PLUGIN_HANDLED

	new message[192], name[32], authid[32], userid
	
	read_args(message, 191)
	remove_quotes(message)
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	K1d0x_C_Color(0, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
	
	log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
	log_message("^"%s<%d><%s><>^" triggered ^"amx_say^" (text ^"%s^")", name, userid, authid, message)
	
	return PLUGIN_HANDLED
}

public cmdPsay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new name[32]
	read_argv(1, name, 31)
	new priv = cmd_target(id, name, 0)

	if (!priv)
		return PLUGIN_HANDLED
	
	new length = strlen(name) + 1

	get_user_name(priv, name, 31); 
	
	new message[192], name2[32], authid[32], authid2[32], userid, userid2
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name2, 31)
	userid = get_user_userid(id)
	read_args(message, 191)
	
	if (message[0] == '"' && message[length] == '"') // HLSW fix
	{
		message[0] = ' '
		message[length] = ' '
		length += 2
	}
	
	remove_quotes(message[length])
	get_user_name(priv, name, 31)
	
	if (id && id != priv)
		K1d0x_C_Color(id, "!e(%s) !v%s !e:   !c%s", name, name2, message[length])
	
	K1d0x_C_Color(priv, "!e(%s) !v%s !e:   !c%s", name, name2, message[length])
	console_print(id, "(%s) %s :   %s", name, name2, message[length])
	get_user_authid(priv, authid2, 31)
	userid2 = get_user_userid(priv)
	
	log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message[length])
	log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message[length])
	
	return PLUGIN_HANDLED
}

public cmdTsay(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	
	new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0
	
	read_argv(0, cmd, 15)
	new bool:tsay = (tolower(cmd[4]) == 't')
	
	read_args(message, 191)
	remove_quotes(message)
	parse(message, color, 15)
	
	new found = 0, a = 0
	new lang[3], langnum = get_langsnum()

	for (new i = 0; i < MAX_CLR; ++i)
	{
		for (new j = 0; j < langnum; j++)
		{
			get_lang(j, lang)
			format(color2, 15, "%L", lang, g_Colors[i])
			
			if (equali(color, color2))
			{
				a = i
				found = 1
				break
			}
		}
		if (found == 1)
			break
	}
	
	new length = found ? (strlen(color) + 1) : 0
	
	if (++g_msgChannel > 6 || g_msgChannel < 3)
		g_msgChannel = 3

	new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0
	
	get_user_authid(id, authid, 31)
	get_user_name(id, name, 31)
	userid = get_user_userid(id)
	set_hudmessage(g_Values[a][0], g_Values[a][1], g_Values[a][2], tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

	switch ( get_pcvar_num(amx_show_activity) )
	{
		case 3, 4:
		{
			new maxpl = get_maxplayers();
			for (new pl = 1; pl <= maxpl; pl++)
			{
				if (is_user_connected(pl) && !is_user_bot(pl))
				{
					if (is_user_admin(pl))
					{
						show_hudmessage(pl, "%s :   %s", name, message[length])
						client_print(pl, print_notify, "%s :   %s", name, message[length])
					}
					else
					{
						show_hudmessage(pl, "%s", message[length])
						client_print(pl, print_notify, "%s", message[length])
					}
				}
			}
			console_print(id, "%s :  %s", name, message[length])
		}
		case 2:
		{
			show_hudmessage(0, "%s :   %s", name, message[length])
			client_print(0, print_notify, "%s :   %s", name, message[length])
			console_print(id, "%s :  %s", name, message[length])
		}
		default:
		{
			show_hudmessage(0, "%s", message[length])
			client_print(0, print_notify, "%s", message[length])
			console_print(id, "%s", message[length])
		}
	}

	log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd[4], message[length])
	log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message[length], color2)

	return PLUGIN_HANDLED
}
liniile 165, 168
JaponezuEnd
Membru, skill 0
Membru, skill 0
Posts: 28
Joined: 29 Jul 2018, 12:28
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

06 Oct 2021, 01:01

Multumesc mult de tot !
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest