|
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN_NAME "Chat"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "DD"
public plugin_init(){
register_plugin(PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR)
register_clcmd("say","sign_say",ADMIN_ALL,"Chat")
}
public sign_say(id){
new text[64],name[32],message[128]
read_args (text,63)
remove_quotes(text)
get_user_name(id,name,31)
if ((get_user_flags(id) & ADMIN_BAN)){
if(is_user_alive(id))
{
format(message,127,"^x04【ADMIN】^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
if(!is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
{
format(message,127,"^x03*死亡*^x04【ADMIN】^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
else if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
{
format(message,127,"^x03*观察者*^x04【ADMIN】^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
}
else if ((get_user_flags(id) & ADMIN_RESERVATION)){
if(is_user_alive(id))
{
format(message,127,"^x04【VIP】^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
if(!is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
{
format(message,127,"^x03*死亡*^x04【VIP】^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
else if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
{
format(message,127,"^x03*观察者*^x04【VIP】^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
}
else {
if(is_user_alive(id))
{
format(message,127,"^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
if(!is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
{
format(message,127,"^x03*死亡* ^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
else if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
{
format(message,127,"^x03*观察者* ^x03%s^x01: %s",name,text)
client_color(0,id,message)
}
}
return PLUGIN_HANDLED
}
public client_color(playerid, colorid, msg[]){
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),{0,0,0},playerid)
write_byte(colorid)
write_string(msg)
message_end()
} |
|