|
发表于 2007-3-23 18:06:51
|
显示全部楼层
来自 中国–福建–漳州
回复: 如何捕获玩家的自杀动作?
- public plugin_init(){
- 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为自动选择队伍
- //在此判断玩家是否还活着,以及加入前后分别是什么队伍,然后做出处罚
- //当然,可能玩家换队伍不一定会成功
- //如果不想给玩家在活着的时候换队伍,return PLUGIN_HANDLED
- }
-
- 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)
- }
- }
复制代码 |
|