以下是非常簡陋的東西 希望有幫助,如果幫不上忙很抱歉......
至少不是灌水
複製程式
#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