【发布】CZBot Control v1.0 - 自动添加/踢出/杀死 CZ机器人
参数:1、amx_addbots_to <NUMBER> //控制添加机器人是人数到该数目;不能使服务器全满!
2、amx_killbots <1 或 0> // 为1时,当所有玩家死光,6.0秒后杀死机器人。
添加机器人(BOT)的方法:
打开CS目录下面的\valve\autoexec.cfg或\cstrike\autoexec.cfg,添加一行localinfo mm_gamedll podbot/dlls/mpbot.dll(假如CZ bot文件为\cstrike\dlls\mpbot.dll)
要求:
amxx 1.70以上版本 高手原来在这里! 找了好久了!顶一个!谢谢高手
回复: 【发布】CZBot Control v1.0 - 自动添加/踢出/杀死 CZ机器人
那个空间需要IE支持。下面贴出全部源码:// Cvar : amx_addbots_to <NUMBER>; add bots when the number of players is less than NUMBER. not full!
// amx_killbots <1 or 0>; kill bots when all players has death
#include <amxmodx>
#define PLUGIN "CZBot Control"
#define VERSION "1.0"
#define AUTHOR "KinSprite"
#define KILL_BOTS_AFTER_SECONDS 6.0
#define KILL_BOTS_TASK_ID 5555
new g_addbots_to
new g_kill_bots
new bool:has_end_round
new bool:has_exist_task
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_addbots_to = register_cvar("amx_addbots_to","0")
g_kill_bots = register_cvar("amx_killbots","1")
register_logevent("StartNewRound",2,"0=World triggered","1=Round_Start")
register_logevent("EndRound",2,"0=World triggered","1=Round_End")
}
public client_connect(id)
{
//if(!is_user_bot(id))
set_task(1.0, "check_bots")
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
//if(!is_user_bot(id))
set_task(1.0, "check_bots")
return PLUGIN_CONTINUE
}
public check_bots()
{
new add_to_num = get_pcvar_num(g_addbots_to)
if (add_to_num==0 || add_to_num==1)
return PLUGIN_CONTINUE
new max_players = get_maxplayers()
if (max_players <= add_to_num)
add_to_num = max_players - 1
new players_num = get_playersnum(1)
if (add_to_num > players_num)
{
set_cvar_num("bot_quota", get_cvar_num("bot_quota") + 1)
}
else if (add_to_num < players_num)
{
set_cvar_num("bot_quota", get_cvar_num("bot_quota") - 1)
}
return PLUGIN_CONTINUE
}
//public client_death(killer, victim, wpnindex, hitplace, TK){
public client_death()
{
if (!get_pcvar_num(g_kill_bots) || has_end_round || has_exist_task)
return PLUGIN_CONTINUE
new players,num
get_players(players,num,"ac")
if (num==0)
{
set_task(KILL_BOTS_AFTER_SECONDS,"kill_bots",KILL_BOTS_TASK_ID)
has_exist_task = true
}
return PLUGIN_CONTINUE
}
public kill_bots()
{
if (!has_end_round)
server_cmd("bot_kill")
}
public StartNewRound()
{
if (task_exists(KILL_BOTS_TASK_ID))
remove_task(KILL_BOTS_TASK_ID)
has_exist_task = false
has_end_round = false
}
public EndRound()
{
has_exist_task = true
has_end_round = true
}
回复: 【发布】CZBot Control v1.0 - 自动添加/踢出/杀死 CZ机器人
这个插件可以当成MM子插件来启动吗? 需要插件还是直接打命令?
页:
[1]