|
发表于 2007-11-2 14:57:33
|
显示全部楼层
来自 中国–广东–中山
回复: 是否有不允许使用M的插件?
看看我的反自杀插件代码是否合适(感谢Rulzy版主指导)/* UTF-8 func by www.DT-Club.net */
#include <amxmodx>
#include <cstrike>
#include <fun>
public plugin_init()
{
register_plugin("HC_SuicidePunish","0.1","Apocalyptic")
register_menucmd(-2,(1<<0)|(1<<1)|(1<<4)|(1<<5),"team_select")
register_menucmd(register_menuid("Team_Select", 1), (1<<0)|(1<<1)|(1<<4)|(1<<5),"team_select")
}
public team_select(id, key)
{//key==0时,为要加入匪;1时,为要加入警;4为自动选择队伍
//在此判断玩家是否还活着,以及加入前后分别是什么队伍,然后做出处罚
if (is_user_alive(id) && (cs_get_user_team(id)==CS_TEAM_CT || cs_get_user_team(id)==CS_TEAM_T))
{
//在这里输入你喜欢的处罚方案
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public client_command(id)
{//这是检测玩家输入换队命令的模块
new command[32], num, snum[3]
read_argv(0, command, 31)
if(equali(command, "jointeam"))
{
read_argv(1, snum, 2)
num = str_to_num(snum)
return team_select(id, num-1)
}
return PLUGIN_CONTINUE
}
public client_kill(id)
{//这是防止活着的玩家自杀的模块
if(!is_user_alive(id))
{
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED
} |
|