|
楼主 |
发表于 2007-12-29 14:51:43
|
显示全部楼层
来自 中国–甘肃–兰州
回复: 插件修改:当双方都只剩下一人时强制用小刀PK插件
测试成功!再次感谢zwfgdlc楼主!不过我又稍微做了一下改动,把相关信息用hud的方式显示,用来提醒玩家:已经进入小刀PK模式!(参见游戏截图)
[PHP]/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Automatic Knife Duel"
#define VERSION "1.0"
#define AUTHOR "Administrator"
new bool:knifematic=false
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("CurWeapon", "event_holdwpn", "be", "1=1")
register_event("DeathMsg", "event_death", "a")
register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
// Add your code here...
}
public event_death()
{
if(get_playersnum(0)<2) return
new Tnum=0,CTnum=0
new playerlist[32],num
get_players(playerlist,num,"a")
for(new i=0;i<num;i++)
{
new team=get_user_team(playerlist)
if(team==1)
++Tnum
else
++CTnum
}
//log_amx("T is %d,CT is %d",Tnum,CTnum)
if(Tnum==1&&CTnum==1)
{
knifematic=true
new players[32],snum
get_players(players,snum,"a")
for(new i=0;i<snum;i++)
{
engclient_cmd(players,"weapon_knife")
set_hudmessage(32, 202, 32, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, -1)
show_hudmessage(0,"Now start to knife duel^n%d T vs %d CT",Tnum,CTnum)
}
}
}
public event_holdwpn(id)
{
new wpnid=read_data(2)
if(wpnid!=CSW_KNIFE && knifematic)
engclient_cmd(id,"weapon_knife")
}
public event_round_end()
{
knifematic=false
}[/PHP] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|