Cerere plugin admin chat colors

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
mixatu
Membru, skill +2
Membru, skill +2
Posts: 660
Joined: 26 Apr 2012, 14:47
Detinator Steam: Da
Detinator server CS: ★ PLAY.USP.RO ★
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 28 times
Contact:

07 Dec 2013, 21:40

Salut. Vreau si eu acest plugin. Numele adminului sa fie verde (setat prin CVAR) iar scrisul sa fie cu team color (albastru = CT, rosu = T)

PS: Functia "cautare" nu merge!!! Pe net nu l-am mai gasit. Am gasit doar cel de pe alliedmodders dar la ala pot scrie doar cu verde nu si cu team color.

mixatu: scriu cu team color.
ImageImage
Fondator: ★ PLAY.USP.RO ★ Competitive CS:GO Server [!ws !gloves !knife FREEVIP!]
Rapidserver
User avatar
mixatu
Membru, skill +2
Membru, skill +2
Posts: 660
Joined: 26 Apr 2012, 14:47
Detinator Steam: Da
Detinator server CS: ★ PLAY.USP.RO ★
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 28 times
Contact:

08 Dec 2013, 14:40

Up???
ImageImage
Fondator: ★ PLAY.USP.RO ★ Competitive CS:GO Server [!ws !gloves !knife FREEVIP!]
User avatar
GhosT ***
Membru, skill +2
Membru, skill +2
Posts: 604
Joined: 04 Dec 2013, 21:52
Detinator Steam: Da
CS Status: Morphin . [ Retras ]
SteamID: Mutulica1428
Reputatie: Fost Moderator ajutator
Location: Dumesti.
Has thanked: 40 times
Been thanked: 99 times
Contact:

08 Dec 2013, 15:35

Ia-l | Afiseaza codul
#include <amxmodx>
#include <amxmisc>

#define ADMIN ADMIN_KICK	// Custom admin level

new gMaxPlayers
new gMsgSayText
new gTeams[3][] = 
	{
		"Spectator",
		"Terrorist",
		"Counter-Terrorist"
	}

public plugin_init()
{
	register_plugin("Green Admin Chat", "1.1", "Arion")
	register_clcmd("say", "handle_say")
	register_clcmd("say_team", "handle_teamsay")
	
	gMaxPlayers = get_maxplayers()
	gMsgSayText = get_user_msgid("SayText")
}

public handle_say(id)
{
	new message[192]
	read_args(message, 191)
	remove_quotes(message)
	if(!valid_message(message)) // Checks if message starts with / or @ or @@ or @@@
		{
			return PLUGIN_CONTINUE
		}
	
	new name[32]
	get_user_name(id, name, 31)
	
	new alive = is_user_alive(id)

	new userFlags = get_user_flags(id)
	
	if((userFlags & ADMIN) && alive) format(message, 191, "^x04%s ^x01: ^x03 %s", name, message)  			 // Live admin
	else if((userFlags & ADMIN) && !alive) format(message, 191, "^x01*DEAD*^x04%s ^x01: ^x03 %s", name, message)	 // Dead admin
	else if((!(userFlags & ADMIN)) && alive) format(message, 191, "^x03%s ^x01:  %s", name, message) 			 // Live normal player
	else format(message, 191, "^x01*DEAD*^x03%s ^x01:  %s", name, message)						 // Dead normal player
	
	for(new i = 1; i <= gMaxPlayers; i++)
		{
			if(!is_user_connected(i))
				continue
		
			if(alive && is_user_alive(i) || !alive && !is_user_alive(i)) // Prints the message
				{
					message_begin(MSG_ONE, gMsgSayText, {0, 0, 0}, i)
					write_byte(id)
					write_string(message)
					message_end()
				}
		}
	return PLUGIN_HANDLED
}

public handle_teamsay(id)
{
	new message[192]
	read_args(message, 191)
	remove_quotes(message)
	if(!valid_message(message))
		{
			return PLUGIN_CONTINUE
		}
		
	new name[32]
	get_user_name(id, name, 31)
	
	new alive = is_user_alive(id)
	
	new team = get_user_team(id)
	
	new userFlags = get_user_flags(id)
	
	if((userFlags & ADMIN) && alive) format(message, 191, "^x01(%s)^x04 %s^x01 : ^x03 %s", gTeams[team], name, message)
	else if((userFlags & ADMIN) && !alive) format(message, 191, "^x01*DEAD*(%s)^x04 %s^x01 : ^x03 %s", gTeams[team], name, message)
	else if((!(userFlags & ADMIN)) && alive) format(message, 191, "^x01(%s)^x03 %s^x01 :  %s", gTeams[team], name, message)
	else format(message, 191, "^x01*DEAD*(%s)^x03 %s^x01 :  %s", gTeams[team], name, message)
	
	for(new i = 1; i <= gMaxPlayers; i++)
		{
			if(!is_user_connected(i))
				continue
		
			if(get_user_team(i) != team)
				continue
		
			if(alive && is_user_alive(i) || !alive && !is_user_alive(i))
				{
					message_begin(MSG_ONE, gMsgSayText, {0, 0, 0}, i)
					write_byte(id)
					write_string(message)
					message_end()
				}
		}
	return PLUGIN_HANDLED
}

bool:valid_message(const message[])  // Returns False case message starts with / or @ or @@ or @@@, otherwise, returns True
{
	if(message[0] == '/'
	|| message[0] == '@'
	|| message[0] == '@' && message[1] == '@'
	|| message[0] == '@' && message[1] == '@' && message[2] == '@'
	|| !strlen(message))
		{
			return false
		}
	
	return true
}
Post Reply

Return to “Cereri”

  • Information