Help me please. I am very need it.
admin_chatcolor plugin replaces
!t to
^x03
!w to
^x01
!g to
^x04
but doing it only with players chat messages.
I need
Change this plugin that he would replacing from any messages on server.
suppose we have statsx, we go to lang file, where replace
Killed by %s from %s @ %0.0fm
to
Killed by !g%s!t from %s @ %0.0fm
and when player die he see chat message
Killed by %s from %s @ %0.0fm
OR
tell how i must change .sma files of any plugin for do colored chat messages
I tried:
just insert "!g" or "^x04" in place where i need it in lang file - no effect
move admin_chatcolor plugin to the top of plugin.ini file - no effect
adding "!g" or "^x04" to statsx.sma file -> compile, replace old statsx.amxx - no effect
i find it on 1 server, but they dont give this plugin to people.
here is screen shots from it (server information hided )
<img src="http://img156.**************/img156/2885/detrain0000yk4.th.png" border="0" />
<img src="http://img65.**************/img65/4695/detrain0001lg5.th.png" border="0">
<img src="http://img65.**************/img65/1651/detrain0003bl9.th.png" border="0"/>
here is code of admin_chatcolor.
PHP Code:
//Use !T for team-color (sorry, can't use red when on CT, and vice-versa)
//!G for green, and !W for normal (it's more of a tan than a white...)
//Includes
#include <amxmodx>
#include <cstrike>
//Defines
#if defined ACCESS_LEVEL
#undef ACCESS_LEVEL
#endif
//#define ACCESS_LEVEL ADMIN_CHAT //UNCOMMENT THIS LINE to allow only admins (with ADMIN_CHAT) to use colors
//Messages
new gmsgSayText
//Globals
//Initialization
public plugin_init()
{
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "CatchSay")
register_clcmd("say_team", "CatchSay")
register_plugin("Admin Chat Color","1.0","BlueRaja")
return PLUGIN_CONTINUE
}
//Functions
public CatchSay(id)
{
#if defined ACCESS_LEVEL
if( !(get_user_flags(id)&ACCESS_LEVEL) ) return PLUGIN_CONTINUE
#endif
new message[129]
read_argv(1,message,128)
if ( containi(message,"!t")==-1 &&
containi(message,"!w")==-1 &&
containi(message,"!g")==-1 )
{
return PLUGIN_CONTINUE
}
new szCommand[9]
read_argv(0,szCommand,8)
new CsTeams:team = cs_get_user_team(id)
new isAlive = is_user_alive(id)
new playerList[32]//players to send message to
new playerCount
new message_to_send[129] = "^x01"
new szFlags[4] = ""
if(isAlive){
add(szFlags,3,"a")//Only alive players
} else {
add(szFlags,3,"b")//Only dead players
add(message_to_send,128,"*DEAD*")
}
add(szFlags,3,"c")//skip bots
if(equal(szCommand,"say_team")) {
add(szFlags,3,"e")//Match with passed teamname
if(team==CS_TEAM_T){
get_players(playerList,playerCount,szFlags,"TERRORIST")
add(message_to_send,128,"(Terrorist) ^x03")
} else if(team==CS_TEAM_CT) {
get_players(playerList,playerCount,szFlags,"CT")
add(message_to_send,128,"(Counter-terrorist) ^x03")
} else { //assume Spectator
get_players(playerList,playerCount,szFlags,"SPECTATOR")
add(message_to_send,128,"(Spectator) ^x03")
}
} else { //assume "say"
get_players(playerList,playerCount,szFlags)
if(isAlive)
{
add(message_to_send,128,"^x03")
} else {
add(message_to_send,128," ^x03")
}
}
new username[129]
get_user_name(id,username,128)
add(message_to_send,128,username)
add(message_to_send,128,"^x01 : ")
add( message_to_send,128,message,(128-strlen(message_to_send)) )
while(containi(message_to_send,"!t") != -1)
{
replace(message_to_send,128,"!T","^x03")
replace(message_to_send,128,"!t","^x03")
}
while(containi(message_to_send,"!g") != -1)
{
replace(message_to_send,128,"!G","^x04")
replace(message_to_send,128,"!g","^x04")
}
while(containi(message_to_send,"!w") != -1)
{
replace(message_to_send,128,"!W","^x01")
replace(message_to_send,128,"!w","^x01")
}
for(new i=0; i<playerCount; i++)
{
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, playerList[i])
write_byte(playerList[i])
write_string(message_to_send)
message_end()
}
return PLUGIN_HANDLED
}
Sorry for bad English