搜索
查看: 2328|回复: 3

求大家看看,感谢

[复制链接]
发表于 2009-8-27 21:31:52 | 显示全部楼层 |阅读模式 来自 中国–北京–北京
本帖最后由 retry 于 2009-8-28 14:44 编辑

这个是第一局雷战且手雷无限,用了感觉给手雷慢点,怎么改成扔出之后马上就给的那种,求高手看看,另外我想多玩几局雷战要怎么改,谢谢
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4. #include <engine>
  5. #define PLUGIN "FirstRoundhegrenade"
  6. #define VERSION "0.2.16"
  7. #define AUTHOR "iG_os"
  8. new bool:FirstRound = true
  9. new bool:iTask[33]
  10. new ModName[10]

  11. public switchweapon(id)
  12. {
  13.     if(!FirstRound)
  14.         return PLUGIN_CONTINUE
  15.     new HE = cs_get_user_bpammo(id, CSW_HEGRENADE)
  16.     if((!HE) && (!iTask[id]))
  17.     {
  18.         new paramID[1]
  19.         paramID[0] = id
  20.         set_task(0.6, "give_hegrenade", id, paramID, 1)
  21.         iTask[id] = true
  22.         return PLUGIN_CONTINUE
  23.     }
  24.     new WeaponID = read_data(2)
  25.     if (HE)  
  26.     if (WeaponID!=CSW_HEGRENADE)
  27.         engclient_cmd(id, "weapon_hegrenade")
  28.     return PLUGIN_CONTINUE
  29. }

  30. public give_hegrenade(paramID[])
  31. {
  32.     new id = paramID[0]
  33.     if ( FirstRound && is_user_alive(id) )
  34.     {
  35.         new HE = cs_get_user_bpammo(id, CSW_HEGRENADE)
  36.         if (!HE)  
  37.            give_item(id, "weapon_hegrenade") //给雷
  38.         engclient_cmd(id, "weapon_hegrenade")
  39.         iTask[id] = false
  40.     }
  41. }

  42. public StartSetting(paramID[])
  43. {
  44.     new id = paramID[0]
  45.     if ( FirstRound && is_user_alive(id) )
  46.         give_item(id, "item_assaultsuit")
  47. }

  48. public newround(id)
  49. {
  50.     if (FirstRound)
  51.     {
  52.         new task_msgID = id+100
  53.         new task_startID = id+200
  54.         if (task_exists(task_msgID)) remove_task(task_msgID)
  55.         if (task_exists(task_startID)) remove_task(task_startID)
  56.         iTask[id] = false
  57.         new paramID[1]
  58.         paramID[0] = id
  59.         set_task(3.0, "Mode_msg", task_msgID, paramID, 1, "a", 3)
  60.         set_task(2.5, "StartSetting", task_startID, paramID, 1)
  61.     }
  62.     return PLUGIN_CONTINUE
  63. }

  64. public restartround()
  65. {
  66.     FirstRound = true
  67.     return PLUGIN_CONTINUE
  68. }

  69. public end_round()
  70. {
  71.     FirstRound = false
  72.     return PLUGIN_CONTINUE
  73. }

  74. public message_TextMsg(msg_id, msg_dest, entity)
  75.   
  76. {
  77.     if (!FirstRound || !get_cvar_num("he_blockfireinthehole"))
  78.         return PLUGIN_CONTINUE
  79.     new argNum = get_msg_args() //获取参数数量,少于5个就不是radio信息
  80.     if (argNum<5) return PLUGIN_CONTINUE
  81.     new string[30]
  82.     if (equal(ModName,"cstrike"))  
  83.     { //适应CS
  84.         get_msg_arg_string(3, string, 29)
  85.         if (!equal(string, "#Game_radio"))
  86.             return PLUGIN_CONTINUE
  87.         get_msg_arg_string(5, string, 29) //CS 取第5个参数
  88.     }
  89.     else
  90.     { //适应CZ
  91.         get_msg_arg_string(3, string, 29)
  92.         if (!equal(string, "#Game_radio_location"))
  93.            return PLUGIN_CONTINUE
  94.         get_msg_arg_string(6, string, 29) //CZ 取第6个参数
  95.     }
  96.     if (!equal(string, "#Fire_in_the_hole"))
  97.         return PLUGIN_CONTINUE
  98.     if (get_cvar_num("he_blockfireinthehole"))
  99.         return PLUGIN_HANDLED // 消除 “Fire in the hole” 文字显示...
  100.     return PLUGIN_CONTINUE
  101. }

  102. public message_SendAudio(msg_id, msg_dest, entity)  
  103. {
  104.     if (!FirstRound || !get_cvar_num("he_blockfireinthehole"))
  105.         return PLUGIN_CONTINUE
  106.     new string[20]
  107.   
  108.     get_msg_arg_string(2, string, 19)
  109.     if (equal(string, "%!MRAD_FIREINHOLE"))
  110.         return PLUGIN_HANDLED // 消除 “Fire in the hole” 声音...
  111.     return PLUGIN_CONTINUE
  112. }

  113. public Mode_msg(paramID[])  
  114. {
  115.     new id = paramID[0]
  116.     //client_print(id,print_chat,"->第一局混战<-")
  117.     new msg[100]
  118.     format(msg,99,"^x03轻松时间^x01>>^x04")  
  119.     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)  
  120.     write_byte(id)
  121.     write_string(msg)
  122.     message_end()
  123. }

  124. public plugin_init()
  125. {
  126.     register_plugin(PLUGIN,VERSION,AUTHOR)
  127.     register_cvar("he_blockfireinthehole", "1")
  128.     register_event("ResetHUD", "newround", "be")
  129.     register_event("TextMsg", "restartround", "a", "2&#Game_C", "2&#Game_w")
  130.     register_event("SendAudio", "end_round", "a", "2&%!MRAD_terwin",
  131.                              "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
  132.     register_event("CurWeapon", "switchweapon", "be", "1=1")
  133.     register_message(get_user_msgid("SendAudio"), "message_SendAudio")
  134.     register_message(get_user_msgid("TextMsg"), "message_TextMsg")
  135.     get_modname(ModName, 9)
  136. }
复制代码
发表于 2009-8-28 02:15:04 | 显示全部楼层 来自 中国–广东–惠州

  1. set_task(0.6, "give_hegrenade", id, paramID, 1)
复制代码
改成
  1. set_task(0.1, "give_hegrenade", id, paramID, 1)
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-8-28 10:54:22 | 显示全部楼层 来自 中国–北京–北京–海淀区
感谢您的帮助,晚上去试试
回复

使用道具 举报

 楼主| 发表于 2009-8-28 14:44:28 | 显示全部楼层 来自 中国–北京–北京–海淀区
另外想问下,多玩几句雷战或者一直雷战也不错的,需要怎么改啊,谢谢
回复

使用道具 举报

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

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