搜索
查看: 5055|回复: 4

【发布】CZBot Control v1.0 - 自动添加/踢出/杀死 CZ机器人

[复制链接]
发表于 2006-6-4 14:09:50 | 显示全部楼层 |阅读模式 来自 中国–湖北–武汉
[color="Blue"]参数:
1、[color="Red"]amx_addbots_to [color="Blue"]<NUMBER>     //  控制添加机器人是人数到该数目;不能使服务器全满!
2、[color="Red"]amx_killbots [color="Blue"]<1 或 [color="Blue"]0>     // 为1时,当所有玩家死光,6.0秒后杀死机器人。

[color="Blue"]添加机器人(BOT)的方法:
打开CS目录下面的\valve\autoexec.cfg或\cstrike\autoexec.cfg,添加一行[PHP]localinfo mm_gamedll podbot/dlls/mpbot.dll[/PHP](假如CZ bot文件为\cstrike\dlls\mpbot.dll)

[color="Blue"]要求:
[color="Magenta"]amxx 1.70以上版本

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2015-1-1 22:36:39 | 显示全部楼层 来自 中国–河北–唐山
高手原来在这里! 找了好久了!顶一个!谢谢高手
回复 1 0

使用道具 举报

 楼主| 发表于 2006-6-4 14:16:59 | 显示全部楼层 来自 中国–湖北–武汉

回复: 【发布】CZBot Control v1.0 - 自动添加/踢出/杀死 CZ机器人

[color="Magenta"]那个空间需要IE支持。下面贴出全部源码:
[PHP]
//       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[32],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
}[/PHP]
回复

使用道具 举报

发表于 2006-7-28 02:42:50 | 显示全部楼层 来自 中国–广东–深圳

回复: 【发布】CZBot Control v1.0 - 自动添加/踢出/杀死 CZ机器人

这个插件可以当成MM子插件来启动吗?
回复

使用道具 举报

发表于 2011-10-15 22:48:12 | 显示全部楼层 来自 中国–贵州–贵阳
需要插件还是直接打命令?
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表