手痒改良了一下这个插件……加入了同队频道中的伤心事件,也把『sad』跟『sosad』侦测改了一下
例如『我又被杀了sad』也会显示他十分伤心……
不过貌似有BUG……例如『uya
sadgfsd』也会显示他十分伤心
源码:
复制程式
#include <amxmodx>
#include <cstrike>
public plugin_init()
{
register_plugin( "Sadness", "1.0", "随便" )
register_clcmd("say", "clcmd_Sadness");
register_clcmd("say_team", "clcmd_SadnessTeam");
}
public clcmd_Sadness(id)
{
new word[255],i
read_args(word, 255)
if((i = containi(word, "Sad") != -1) || (i = containi(word, "sad") != -1) || (i = containi(word, "SAD") != -1))
{
static szName[33]
get_user_name(id,szName,31)
client_print(0,print_chat,"[Sadness] %s 感到伤心!",szName)
}
}
public clcmd_SadnessTeam(id)
{
new word[255],i
read_args(word, 255)
if((i = containi(word, "Sad") != -1) || (i = containi(word, "sad") != -1))
{
for(new j=1;j<=31;j++)
{
if(cs_get_user_team(id) == cs_get_user_team(j))
{
static szName[33]
get_user_name(id,szName,31)
client_print(j,print_chat,"[Sadness] %s 感到伤心!",szName)
}
}
}
}