- 听众
- 收听
- 积分
- 373
- 主题
- 回帖
- 0
- 精华
注册时间2009-1-6
最后登录1970-1-1
该用户从未签到
|
本帖最后由 lovehuai 于 2010-2-2 06:42 编辑
最近打平台老是被穿死反穿老是找不到点 囧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值
效果如图/代码使劲往下拉
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <string>
- #include <fun>
- #include <csstats>
- /*
- My Blog : http://www.lovehuai.cn
- E-Mail : darKZol_huai@163.com
- 如果你有更好建议请发邮件谢谢!~
- */
- new Bot_Id[32]
- new origin[32][3]
- new g_sprite
- public plugin_init()
- {
- register_plugin("Bot_Exercise", "0.1", "天下第一小賤人");
- register_clcmd("exercise_bot", "Exercise_Menu")
- register_event("Damage", "damage_msg", "b", "2!0", "3=0", "4!0")
- }
- public plugin_precache()
- {
- g_sprite = precache_model("sprites/dot.spr");
- }
- public damage_msg(id)
- {
- new Index = get_user_attacker(id)
- new damage = read_data(2)
- set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 2.0, 0.02, 0.02, 7)
- show_hudmessage(Index,"%i Hp",damage)
- return PLUGIN_CONTINUE
- }
- 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_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, "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)
- SetHp(112233+Bot_Id[id])
- SetArmor(112244+Bot_Id[id])
- set_user_origin(Bot_Id[id], origin[id])
- 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 99
- }
- public client_connect(id)
- {
- Bot_Id[id] =0;
- origin[id] ="";
- }
- public client_disconnect (id)
- {
- Bot_Id[id] =0;
- origin[id] ="";
- if(task_exists(11223 + id))
- {
- remove_task(112233+id)
- remove_task(112244+id)
- }
- }
- public SetHp(id)
- {
- id = id - 112233
- if(!is_user_connected(id)) {
- remove_task(112233 + id)
- } else {
-
- if(is_user_alive(id)){
- if(get_user_health(id)<255)
- {
- set_user_health(id,255)
- }
- }
- }
- set_task(1.0,"SetHp",112233+id)
- return PLUGIN_HANDLED
- }
- public SetArmor(id)
- {
- id = id - 112244
- if(is_user_alive(id))
- {
- if(get_user_armor(id)<255)
- {
- cs_set_user_armor(id,255,CS_ARMOR_VESTHELM)
- }
- }
-
- set_task(1.0,"SetArmor",112244+id)
- return PLUGIN_HANDLED
- }
- 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;
- }
复制代码 |
评分
-
查看全部评分
|