zp4.3的BOT倒数前不开枪的插件在zp5.0里不管用
谁能帮我修改一下
谢谢
复制程式
/********************************************
=============================================
* ZBot Helper For Zombie Plague 4.3+ *
=============================================
Description:
Fix some issues happens when playing with
Bots on CS:CZ
Additional CVAR:
bot_auto_kill <1|0>
bot_show_notification <1|0>
Modules:
- csx (for Countdown HUD Message)
- fakemeta (for flashlight code)
Changelog:
1.0 Initial release
1.1 Fix event_start so it works
1.2 Fix release
+ Added HUD Countdown features
+ Added 2 new cvars
+ Added experimental force flashlight
+ Added show notification
> Fix round end, bots stop attacking
each others now
1.3 Change logic, Fix sync issue
1.4 Fix release
+ Added bot_auto_kill
- Remove countdown code
- Remove force flashlight code
> Bots don't use smg (more survive)
> Bots don't use sniper (more survive)
Credits:
- AMXModx Team (AMXModX 1.8.1)
- Mercylezz (Zombie Plague 4.3)
********************************************/
#include <amxmodx>
#include <csx>
#include <fakemeta>
#include <amxmisc>
#include <zombieplague>
#define PLUGIN "[ZP] ZBot Helper Lite"
#define VERSION "1.4"
#define AUTHOR "Dels"
new freeze_time, max_player;
new cvar_zbot_autokill, cvar_zbot_notification;
const TASK_ID = 1603;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
//used for "bot_auto_kill"
register_event("DeathMsg","event_death","a");
//cvars
cvar_zbot_autokill = register_cvar("bot_auto_kill", "0"); //auto kill when all human die
cvar_zbot_notification = register_cvar("bot_show_notification", "0"); //not actual debug, just show notification
}
public event_round_start()
{
//bugfix
remove_task(TASK_ID);
//initialization each time round start
set_cvar_num("mp_autoteambalance", 0); //是否启动自动队伍平衡功能 0=关闭 1=开启 或是人数例如32
set_cvar_num("mp_friendlyfire", 1); //玩家是否可以伤害到队友 0=关闭 1=开启
set_cvar_num("mp_freezetime", 4); //回合开始前的冻结时间 (单位: 秒, 0 为无冻结时间)
set_cvar_num("mp_limitteams", 0); //队伍双方人数最大可相差几人 0=关闭 或是人数例如32
set_cvar_num("bot_allow_grenades", 1); //设定BOT是否使用手榴弹 1=使用
set_cvar_num("bot_allow_shotguns", 1); //设定BOT是否使用散弹枪 1=使用
set_cvar_num("bot_allow_pistols", 1); //设定BOT是否使用手枪 1=使用
set_cvar_num("bot_allow_snipers", 1); //设定BOT是否使用狙击枪 1=使用
set_cvar_num("bot_allow_rogues", 0); //设定BOT是否跟随队伍 1=使用
set_cvar_num("bot_allow_machine_guns", 1); //设定BOT是否使用机枪 1=使用
set_cvar_num("bot_allow_sub_machine_guns", 1); //设定BOT是否使用冲锋枪 1=使用
set_cvar_num("bot_allow_shield", 0); //设定BOT不使用盾牌 1=不使用
set_cvar_num("bot_allow_rifles", 1); //设定BOT是否使用步枪 1=使用
set_cvar_num("bot_zombie", 1); //设定BOT丧尸出现前不乱跑及不乱开枪 1=不乱跑及不乱开枪
//notification stuff
if (get_pcvar_num(cvar_zbot_notification) == 1)
client_print(0, print_chat, "DUMB BOTS: ENABLED");
freeze_time = get_cvar_num("zp_delay") - 1;
set_task(4.0, "freeze_bots", TASK_ID);
}
public freeze_bots()
{
--freeze_time;
if(freeze_time >= 1)
{
set_task(1.0, "freeze_bots", TASK_ID);
}
else
{
set_cvar_num("bot_zombie", 0);
remove_task(TASK_ID);
//notification stuff
if (get_pcvar_num(cvar_zbot_notification) == 1)
client_print(0, print_chat, "DUMB BOTS: DISABLED");
}
}
public zp_round_ended(winteam)
{
if (winteam != WIN_NO_ONE)
{
set_cvar_num("bot_zombie", 1);
//notification stuff
if (get_pcvar_num(cvar_zbot_notification) == 1)
client_print(0, print_chat, "DUMB BOTS: ENABLED");
}
}
public event_death()
{
if (get_pcvar_num(cvar_zbot_autokill) == 1)
{
new alive_humans;
max_player = get_maxplayers();
for (new i = 1; i <= max_player; i++)
{
if (!is_user_bot(i) && !is_user_hltv(i) && is_user_alive(i))
alive_humans++;
}
if (alive_humans == 0)
{
//set_cvar_string("bot_kill", "all"); //the simple way, bot frag decreased
for (new j = 1; j <= max_player; j++)
{
if (is_user_bot(j) && !is_user_hltv(j) && is_user_alive(j))
user_kill(j, 1)
}
}
}
}