手癢改良了一下這個插件……加入了同隊頻道中的傷心事件,也把『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)
}
}
}
}