以下是非常简陋的东西 希望有帮助,如果帮不上忙很抱歉......
至少不是灌水
复制程式
#include <amxmisc>
#define WAV "sound\weapon\ak47-1.wav" //自行更改吧
#define ONLY_CMD //只在玩家使用 "disconnect" "quit" "exit"指令时播出,被kick时则应该不会(未测试)
public plugin_precache()
precache_sound(WAV)
public plugin_init()
{
register_plugin("Unknown", "erro", "virus")
#if defined ONLY_CMD
register_clcmd("exit", "cmd_leave", ADMIN_USER)
register_clcmd("quit", "cmd_leave", ADMIN_USER)
register_clcmd("disconnect", "cmd_leave", ADMIN_USER)
#endif
}
#if defined ONLY_CMD
public cmd_leave(id, level, cid)
{
//基本上这2行和上面的ADMIN_USER是多余的,我也不知道为什么就是想写= =||
if (!cmd_access(id, level, cid, 1, true))
return PLUGIN_HANDLED;
engclient_cmd(0, "spk", WAV)
return PLUGIN_HANDLED;
}
#else
public client_disconnect()
engclient_cmd(0, "spk", WAV)
#endif