|
本帖最后由 lovehuai 于 2010-2-5 04:22 编辑
最近打平台老是被穿死反穿老是找不到点 囧Rz
所以单机BOT练穿点
但是问题就来了 Bot在特定位置 才能穿ING
所以就操起记事本匆忙敲了一个
配合 死亡复活 插件 yapb机器人 使用
请下载最新的yapb机器人(里面有多国语言自己设置成中文就行了)
http://yapb.bots-united.com/downloads.html
http://yapb.jeefo.net/
并把yapb.cfg里的 yb_stopbots 设置成 "1" 暂停BOT活动不然BOT到处乱跑你砸穿列
Bot每隔一秒检测一次HP如果低于255就把HP改为255避免穿啊穿就挂了-_,-不过这样貌似还是不妥
随意定位坐标并传送BOT到坐标
显示坐标线 (在BOT跟自己之间画一条直线显示时间为5秒 5秒后消失)
每打一枪的HP值
效果如图/代码使劲往下拉
最后一更 获取攻击部位 攻击HP Bot损失HP后直接恢复到255 只要不是拿AWP不隔墙爆头bot基本就不会死
不隔直接打AWP最大伤害(全套护甲)我读取到的是 444HP 门穿中是 201HP左右
- #include <amxmodx>
- #include <cstrike>
- #include <fun>
- #include <fakemeta>
- #include <hamsandwich>
- /*
- My Blog : http://www.lovehuai.cn
- E-Mail : darkzol_huai@163.com
- 如果你有更好建议请发邮件谢谢!~
- */
- new Bot_Id[32]
- new origin[32][3]
- new g_sprite
- new Dw_Boby[8][] = {
- "全身",
- "头部",
- "胸部",
- "腹部",
- "左臂",
- "右臂",
- "左腿",
- "右腿"
- }
- public plugin_init()
- {
- register_plugin("Bot_Exercise", "0.4", "天下第一小賤人");
- register_clcmd("exercise_bot", "Exercise_Menu")
- RegisterHam(Ham_TraceAttack, "player", "HamTraceAttack");
- }
- public HamTraceAttack(Vic, Att, Float:dmg, Float:dir[3], traceresult, dmgbits)
- {
- if(!is_user_connected(Att) || Vic == Att)
- return PLUGIN_HANDLED;
- new xx=get_tr2(traceresult, TR_iHitgroup)
- new Vic_Hp= 255 - get_user_health(Vic)
- //new CsArmorType:ArmorType
- //new Vic_Armor =255- cs_get_user_armor(Vic, ArmorType)
- set_hudmessage(0, 100, 200, 0.07, 0.71, 0, 6.0, 3.0)
- cs_set_user_armor(Vic,255,CS_ARMOR_VESTHELM)
- set_user_health(Vic,255)
- show_hudmessage(Att, "击中部位%s Hp:%i ",Dw_Boby[xx],Vic_Hp)
- //show_hudmessage(Att, "击中部位%s Hp:%i 护甲 %i",Dw_Boby[xx],Vic_Hp,Vic_Armor)
- return HAM_IGNORED;
- }
- public plugin_precache()
- {
- g_sprite = precache_model("sprites/dot.spr");
- }
- public Exercise_Menu(id, level, cid)
- {
- new menu = menu_create("穿点练习:", "Exercise_Handler")
- menu_additem(menu, "记录当前坐标", "1", ADMIN_ALL)
- menu_additem(menu, "添加BOT练习", "2", ADMIN_ALL)
- menu_additem(menu, "传送到坐标点", "3", ADMIN_ALL)
- menu_additem(menu, "显示坐标线", "4", ADMIN_ALL)
- menu_additem(menu, "退出", "0", ADMIN_ALL)
- menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
- menu_display(id, menu, 0)
- return PLUGIN_HANDLED
- }
- public Exercise_Handler(id, menu, item)
- {
- if (item == MENU_EXIT)
- {
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- new cmd[32], name[32], access,csid[32],user_name[32]
- get_user_info(id, "name", user_name, 31)
- menu_item_getinfo(menu, item, access, cmd, 31, name, 31, access)
- get_user_name(id,csid,31)
- if (strcmp(cmd, "0")==0)
- {
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- if (strcmp(cmd, "1")==0)
- {
- get_user_origin(id, origin[id])
- client_print(id, print_chat, "坐标已保存")
- } else{
- if (strcmp(cmd, "2")==0)
- {
- if ((cs_get_user_team(id) == CS_TEAM_CT) && is_user_alive(id))
- {
- server_cmd("yapb add 100 0 1 %s_bot",user_name)
- client_print(id, print_chat, "命令已执行请稍等")
- set_task(random_float(3.0,10.0), "Bot_Origin", id)
- } else {
- if ((cs_get_user_team(id) == CS_TEAM_T) && is_user_alive(id))
- {
- server_cmd("yapb add 100 0 2 %s_bot",user_name)
- client_print(id, print_chat, "命令已执行请稍等")
- set_task(random_float(3.0,10.0), "Bot_Origin", id)
- }
- }
- }
- if (strcmp(cmd, "3")==0)
- {
- set_user_origin(Bot_Id[id], origin[id])
- client_print(id, print_chat, "BOT已传送到坐标点")
- }
- if (strcmp(cmd, "4")==0)
- {
- Look_Cross(id)
- client_print(id, print_chat, "显示坐标线")
- }
- }
- menu_destroy(menu)
- return PLUGIN_HANDLED
- }
- public Bot_Origin(id)
- {
- new user_name[32]
- get_user_info(id, "name", user_name, 31)
- strcat(user_name, "_bot", sizeof(user_name)-1)
- Bot_Id[id] = is_name_inuse(id,user_name)
- set_user_origin(Bot_Id[id], origin[id])
- cs_set_user_armor(Bot_Id[id],255,CS_ARMOR_VESTHELM)
- set_user_health(Bot_Id[id],255)
- client_print(id, print_chat, "BOT已添加")
- }
- is_name_inuse(id, const sample[])
- {
- new name[32]
- for (new i=1; i<=get_maxplayers(); i++)
- {
- if (!is_user_connected(i)) continue
- if (id==i) continue
- get_user_name(i, name, 31)
- if (strcmp(name, sample)==0)
- return i
- }
- return 0
- }
- public client_connect(id)
- {
- Bot_Id[id] =0;
- origin[id] ="";
- }
- public client_disconnect (id)
- {
- Bot_Id[id] =0;
- origin[id] ="";
- }
- public Look_Cross(id)
- {
- new vec_user[3];
- new vec_bot[3];
- get_user_origin(id, vec_user);
- get_user_origin(Bot_Id[id], vec_bot);
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY, {0, 0, 0}, id);
- write_byte(0);
- write_coord(vec_user[0]);
- write_coord(vec_user[1]);
- write_coord(vec_user[2]);
- write_coord(vec_bot[0]);
- write_coord(vec_bot[1]);
- write_coord(vec_bot[2]);
- write_short(g_sprite);
- write_byte(1);
- write_byte(1);
- write_byte(50); //显示时间 数值乘0.1
- write_byte(10);
- write_byte(0);
- write_byte(100); //R
- write_byte(100); //G
- write_byte(255); //B
- write_byte(100);
- write_byte(0);
- message_end();
- return PLUGIN_HANDLED;
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|