搜索
查看: 2731|回复: 6

求助!

[复制链接]
发表于 2009-1-15 14:57:37 | 显示全部楼层 |阅读模式 来自 中国–山东–潍坊
那位大哥能帮俺改下插件!

这个插件是<第一局用刀,第二局用刀和手雷插件!可埋包>
我想改成(第一局第二局都用刀和无限高爆手雷的插件不可埋包的)
哪位大哥能帮帮忙的话,小弟万分感谢!

本帖子中包含更多资源

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

×
发表于 2009-1-15 15:11:35 | 显示全部楼层 来自 中国–广东–韶关
用这个吧 功能强大
  1. /*
  2.   刀、O3、O4、O5、C4及手枪战插件,主要有如下特点:

  3.   1、可自定义;
  4.   2、禁止使用的武器装备不允许购买,防止浪费钱;
  5.   3、如果不允许放C4,则将C4没收掉;
  6.   4、可以定义任意一局可以使用的武器。

  7.   参数及命令介绍:
  8.   amx_delaygivegrenade <time> 无限雷时,延迟多长时间给玩家雷,单位为秒,默认 0.1 秒
  9.   amx_clear_restwpns 清除已经有的关于限制武器局数据
  10.   amx_add_restwpns [<flags> [<round> [n]]]  增加一限制武器局, round 代表是第几局, 其最大值为512,
  11.                                               如果省略 round, 则为当前定义的最大局数的下一局
  12.                                               n 表示从第 round 局开始,有 n 局使用此模式
  13.     flags 可以是以下字母的组合:

  14.     a: 可以使用闪光弹
  15.     b: 可以使用高爆手雷
  16.     c: 可以使用烟雾弹
  17.     d: 可以放C4
  18.     e: 可以使用手枪
  19.     f: 可以使用闪光弹,并且无限补给闪光弹
  20.     g: 可以使用高爆手雷,并且无限补给高爆手雷
  21.     h: 可以使用烟雾弹,并且无限补给烟雾弹
  22.     i: 可以使用手枪,并且无限补给子弹
  23.        
  24.         如果使用了"f",就不必使用"a";如果使用了"g",就不必使用"b";
  25.         如果使用了"h",就不必使用"c";如果使用了"i",就不必使用"e"。
  26.        
  27.         为了表达清楚,建议不要省略参数 round 和 n
  28.        
  29.     例如:
  30.     只能用刀:          amx_add_restwpns
  31.     只能用刀和放C4:       amx_add_restwpns "d"
  32.     只能用刀、雷和放C4      amx_add_restwpns "abcd"
  33.     只能用刀、无限雷和放C4    amx_add_restwpns "dfgh"
  34.     只能用刀、手枪无限子弹和放C4 amx_add_restwpns "di"

  35.   完整例子:

  36.   你只需在 amxx.cfg 里加上如下命令:

  37.   amx_clear_restwpns
  38.   amx_add_restwpns
  39.   amx_add_restwpns "abcd"
  40.   amx_add_restwpns "di"
  41.   amx_add_restwpns "" 25
  42.   amx_add_restwpns "d"
  43.   amx_add_restwpns "di"

  44.   则第一局只能用刀,第二局只能用刀、雷和放C4,第三局只能用刀、手枪(无限子弹)和放C4,第4局到第24局正常,
  45.   第25局只能用刀, 第26局只能用刀和放C4, 第27局只能用刀、手枪(无限子弹)和放C4, 第28局后正常。

  46.   需要开启的模块: cstrike、engine、fun

  47.   注意,如果无限雷无效,可能是与其他插件有冲突,如彩色对讲机、炸弹对讲机之类的,
  48.   需在 configs\plugins.ini 中将此插件移到那些插件的前面,不防将此插件放到所有第三方(非官方)插件的前面。
  49. */

  50. #include <amxmodx>
  51. #include <amxmisc>
  52. #include <cstrike>
  53. #include <engine>
  54. #include <fun>

  55. #define MAX_REST_ROUND_COUNT 512

  56. #define FLAG_A 1  //闪光弹
  57. #define FLAG_B 2  //高爆手雷
  58. #define FLAG_C 4  //烟雾弹
  59. #define FLAG_D 8  //C4
  60. #define FLAG_E 16  //手枪
  61. #define FLAG_F 32  //无限闪光弹
  62. #define FLAG_G 64  //无限高爆手雷
  63. #define FLAG_H 128  //无限烟雾弹
  64. #define FLAG_I 256  //无限手枪子弹
  65. #define FLAG_Z 0x2000000  //正常局

  66. new g_RestRoundCounter = 0  //限制局局数计数器(当战斗还没开始时,与真正的局数计数器不一定相等)
  67. new g_RestrictCount = 0     //限制局数
  68. new g_weaponflags[MAX_REST_ROUND_COUNT]
  69. new g_MaxGunBPAmmo[] = {0,52,0,90,1,32,1,100,90,1,120,100,100,90,90,90,100,120,30,120,200,32,90,120,90,2,35,90,90,0,100}
  70. new bool:g_restart_attempt[33]
  71. new g_Restart = 0
  72. new g_HintMsg[256]

  73. new g_Pistols[11][]={        //购买手枪使用的命令
  74.         "usp",
  75.         "glock",
  76.         "deagle",
  77.         "p228",
  78.         "fn57",
  79.         "km45",
  80.         "9x19mm",
  81.         "nighthawk",
  82.         "228compact",
  83.         "elites",
  84.         "fiveseven"
  85. }

  86. new g_OtherGuns[32][]={
  87.         "m3",                //购买霰弹枪使用的命令
  88.         "xm1014",
  89.         "12gauge",
  90.         "autoshotgun",

  91.         "mp5",                //购买冲锋枪使用的命令
  92.         "tmp",
  93.         "p90",
  94.         "mac10",
  95.         "ump45",
  96.         "smg",
  97.         "mp",
  98.         "c90",

  99.         "ak47",                //购买自动步枪使用的命令
  100.         "galil",
  101.         "famas",
  102.         "sg552",
  103.         "m4a1",
  104.         "aug",
  105.         "scout",
  106.         "awp",
  107.         "g3sg1",
  108.         "sg550",
  109.         "cv47",
  110.         "defender",
  111.         "clarion",
  112.         "krieg552",
  113.         "bullpup",
  114.         "magnum",
  115.         "d3au1",
  116.         "krieg550",

  117.         "m249",                //购买轻机枪使用的命令
  118.        
  119.         "shield"        //购买战术盾牌使用的命令
  120. }

  121. public plugin_init()
  122. {
  123.         register_plugin("娱乐局", "1.2", "Rulzy")
  124.         register_menucmd(register_menuid("#Buy", 1), 511, "menuBuy")
  125.         register_menucmd(register_menuid("BuyItem", 1), 511, "menuItem")
  126.         register_event("TextMsg", "Game_Commencing", "ac", "2&#Game_Commencing")
  127.         register_concmd("amx_clear_restwpns", "cmdClearRestrictWeapons", ADMIN_LEVEL_A, "<n> <flags> - set restrict weapons")
  128.         register_concmd("amx_add_restwpns", "cmdAddRestrictWeapons", ADMIN_LEVEL_A, "<flags> - set restrict weapons")
  129.         register_cvar("amx_delaygivegrenade", "0.1")
  130.         register_event("CurWeapon","eWeaponChange","be")
  131.         register_event("HLTV", "eNewRound", "a", "1=0", "2=0")
  132.         register_clcmd("fullupdate", "cmd_fullupdate")
  133.         register_event("ResetHUD", "eResetHUD", "be")
  134.         register_event("TextMsg", "eRestart", "a", "2=#Game_will_restart_in")
  135.         register_event("AmmoX", "eAmmoX", "be")
  136.         g_RestrictCount = 0
  137.         for(new i=0;i<MAX_REST_ROUND_COUNT;i++)
  138.                 g_weaponflags[i] = FLAG_Z
  139. }

  140. public eNewRound()
  141. {
  142.         if(g_Restart==1)
  143.         {
  144.                 g_Restart = 0
  145.                 g_RestRoundCounter = 0
  146.         }
  147.         g_RestRoundCounter++
  148.         if(g_RestRoundCounter>g_RestrictCount||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return
  149.         new iLen = format(g_HintMsg, 255, "注意,本局可用武器:^n刀, ")
  150.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_D)
  151.                 iLen += format(g_HintMsg[iLen], 255-iLen, "C4, ")
  152.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_F)
  153.                 iLen += format(g_HintMsg[iLen], 255-iLen, "闪光弹(无限), ")
  154.         else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_A)
  155.                 iLen += format(g_HintMsg[iLen], 255-iLen, "闪光弹, ")
  156.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_G)
  157.                 iLen += format(g_HintMsg[iLen], 255-iLen, "高爆手雷(无限), ")
  158.         else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_B)
  159.                 iLen += format(g_HintMsg[iLen], 255-iLen, "高爆手雷, ")
  160.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_H)
  161.                 iLen += format(g_HintMsg[iLen], 255-iLen, "烟雾弹(无限), ")
  162.         else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_C)
  163.                 iLen += format(g_HintMsg[iLen], 255-iLen, "烟雾弹, ")
  164.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_I)
  165.                 iLen += format(g_HintMsg[iLen], 255-iLen, "手枪(子弹无限), ")
  166.         else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_E)
  167.                 iLen += format(g_HintMsg[iLen], 255-iLen, "手枪, ")
  168.         g_HintMsg[strlen(g_HintMsg)-2] = 0
  169. }

  170. public Game_Commencing()
  171. {
  172.         g_Restart = 1
  173.         return PLUGIN_CONTINUE
  174. }

  175. public eRestart()
  176. {
  177.         g_Restart = 1
  178.         new players[32], num
  179.         get_players(players, num, "a")
  180.         for (new i; i < num; ++i)
  181.                 g_restart_attempt[players[i]] = true
  182.         return PLUGIN_CONTINUE
  183. }

  184. public cmd_fullupdate()
  185. {
  186.         return PLUGIN_HANDLED
  187. }

  188. public eResetHUD(id)
  189. {
  190.         if (g_restart_attempt[id])
  191.         {
  192.                 g_restart_attempt[id] = false
  193.                 return PLUGIN_CONTINUE
  194.         }
  195.        
  196.         ePlayerSpawn(id)
  197.         return PLUGIN_CONTINUE
  198. }

  199. public show_hint(id)
  200. {
  201.         set_hudmessage(255, 128, 255, -1.0, 0.55, 0, 6.0, 2.5,_,_,1)
  202.         show_hudmessage(id, g_HintMsg)
  203. }

  204. public ePlayerSpawn(id)
  205. {
  206.         if(g_RestRoundCounter==0) eNewRound()
  207.         if(g_RestRoundCounter>g_RestrictCount||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return
  208.         show_hint(id)
  209.         set_task(1.5, "show_hint", id,_,_,"a",4)
  210.         set_task(0.1, "changeto_knife", id)
  211.         new ammo, clip
  212.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_F)
  213.         {
  214.                 get_user_ammo(id, CSW_FLASHBANG, ammo, clip)
  215.                 if(ammo<2)
  216.                         set_task(0.1, "give_flashbang", id)
  217.                 if(ammo<1)
  218.                         set_task(0.1, "give_flashbang", id)
  219.         }
  220.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_G)
  221.         {
  222.                 get_user_ammo(id, CSW_FLASHBANG, ammo, clip)
  223.                 if(ammo<1)
  224.                         set_task(0.1, "give_hegrenade", id)
  225.         }
  226.         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_H)
  227.         {
  228.                 get_user_ammo(id, CSW_FLASHBANG, ammo, clip)
  229.                 if(ammo<1)
  230.                         set_task(0.1, "give_smokegrenade", id)
  231.         }
  232. }

  233. public changeto_knife(id)
  234. {
  235.         engclient_cmd(id, "weapon_knife")
  236. }

  237. public cmdClearRestrictWeapons(id, level, cid)
  238. {
  239.         g_RestrictCount = 0
  240.         for(new i=0;i<MAX_REST_ROUND_COUNT;i++)
  241.                 g_weaponflags[i] = FLAG_Z
  242.         return PLUGIN_HANDLED
  243. }

  244. public cmdAddRestrictWeapons(id, level, cid)
  245. {
  246.         if(!cmd_access(id, level, cid, 1))
  247.                 return PLUGIN_HANDLED
  248.         new sflags[32], s[5], round
  249.         read_argv(1, sflags, 31)
  250.         read_argv(2, s, 4)
  251.         if(s[0])
  252.                 round = str_to_num(s)-1
  253.         else
  254.                 round = g_RestrictCount
  255.         if(round<0) round = 0
  256.         if(round>=MAX_REST_ROUND_COUNT)
  257.         {
  258.                 if(id==0)
  259.                         server_print("Max Restrict Count Reached")
  260.                 else
  261.                         client_print(id, print_console, "Max Restrict Count Reached")
  262.                 return PLUGIN_HANDLED
  263.         }
  264.         read_argv(3, s, 4)
  265.         new num
  266.         if(s[0])
  267.                 num = str_to_num(s)
  268.         else
  269.                 num = 1
  270.         if((round+num)>=MAX_REST_ROUND_COUNT)
  271.         {
  272.                 num = MAX_REST_ROUND_COUNT - round
  273.         }
  274.         new flags = read_flags(sflags)
  275.         for(new i=round;i<round+num;i++)
  276.                 g_weaponflags[i] = flags
  277.         if(round+num>g_RestrictCount) g_RestrictCount= round+num
  278.         return PLUGIN_HANDLED
  279. }

  280. public client_command(id)
  281. {
  282.         if(g_RestRoundCounter>g_RestrictCount||g_RestRoundCounter==0||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return PLUGIN_CONTINUE
  283.         new arg[13]
  284.         if(read_argv(0, arg, 12)>11) return PLUGIN_CONTINUE
  285.         for(new i=0;i<11;i++)
  286.         {
  287.                 if(equali(arg, g_Pistols[i]))
  288.                 {       
  289.                         if(g_weaponflags[g_RestRoundCounter-1]&(FLAG_E|FLAG_I))
  290.                                 return PLUGIN_CONTINUE
  291.                         client_print(id, print_center, "此局不能购买此武器")
  292.                         return PLUGIN_HANDLED
  293.                 }
  294.         }
  295.         for(new i=0;i<32;i++)
  296.         {
  297.                 if(equali(arg, g_OtherGuns[i]))
  298.                 {                               
  299.                         client_print(id, print_center, "此局不能购买此武器")
  300.                         return PLUGIN_HANDLED
  301.                 }
  302.         }
  303.         if(equali(arg, "primammo")||equali(arg, "buyammo1"))
  304.         {
  305.                 client_print(id, print_center, "此局不能购买主武器弹药")
  306.                 return PLUGIN_HANDLED
  307.         }
  308.         if(equali(arg, "secammo")||equali(arg, "buyammo2"))
  309.         {
  310.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_E)
  311.                         return PLUGIN_CONTINUE
  312.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_I)
  313.                         client_print(id, print_center, "此局手枪子弹无限,不用购买手枪子弹")
  314.                 else
  315.                         client_print(id, print_center, "此局不能购买手枪子弹")
  316.                 return PLUGIN_HANDLED
  317.         }
  318.         if(equali(arg, "flash"))
  319.         {
  320.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_A)
  321.                         return PLUGIN_CONTINUE
  322.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_F)
  323.                         client_print(id, print_center, "此局闪光弹无限,并自动赠与,不需购买")
  324.                 else
  325.                         client_print(id, print_center, "此局不能购买闪光弹")
  326.                 return PLUGIN_HANDLED
  327.         }
  328.         if(equali(arg, "hegren"))
  329.         {
  330.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_B)
  331.                         return PLUGIN_CONTINUE
  332.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_G)
  333.                         client_print(id, print_center, "此局高爆手雷无限,并自动赠与,不需购买")
  334.                 else
  335.                         client_print(id, print_center, "此局不能购买高爆手雷")
  336.                 return PLUGIN_HANDLED
  337.         }
  338.         if(equali(arg, "sgren"))
  339.         {
  340.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_C)
  341.                         return PLUGIN_CONTINUE
  342.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_H)
  343.                         client_print(id, print_center, "此局烟雾弹无限,并自动赠与,不需购买")
  344.                 else
  345.                         client_print(id, print_center, "此局不能购买烟雾弹")
  346.                 return PLUGIN_HANDLED
  347.         }
  348.         if(equali(arg, "defuser"))
  349.         {
  350.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_D)
  351.                         return PLUGIN_CONTINUE
  352.                 if(get_user_team(id)==2)
  353.                         client_print(id, print_center, "此局禁放C4,不需购买拆弹器")
  354.                 return PLUGIN_HANDLED
  355.         }
  356.         return PLUGIN_CONTINUE
  357. }

  358. public menuBuy(id, key)
  359. {
  360.         if(g_RestRoundCounter>g_RestrictCount||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return PLUGIN_CONTINUE
  361.         if(key==0)
  362.         {
  363.                 if(g_weaponflags[g_RestRoundCounter-1]&(FLAG_E|FLAG_I))
  364.                         return PLUGIN_CONTINUE
  365.                 client_print(id, print_center, "此局不能购买手枪")
  366.                 return PLUGIN_HANDLED
  367.         }
  368.         if(key==1)
  369.         {
  370.                 client_print(id, print_center, "此局不能购买霰弹枪")
  371.                 return PLUGIN_HANDLED
  372.         }
  373.         if(key==2)
  374.         {
  375.                 client_print(id, print_center, "此局不能购买冲锋枪")
  376.                 return PLUGIN_HANDLED
  377.         }
  378.         if(key==3)
  379.         {
  380.                 client_print(id, print_center, "此局不能购买自动步枪")
  381.                 return PLUGIN_HANDLED
  382.         }
  383.         if(key==4)
  384.         {
  385.                 client_print(id, print_center, "此局不能购买轻型机枪")
  386.                 return PLUGIN_HANDLED
  387.         }
  388.         if(key==5)
  389.         {
  390.                 client_print(id, print_center, "此局不能购买主武器弹药")
  391.                 return PLUGIN_HANDLED
  392.         }
  393.         if(key==6)
  394.         {
  395.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_E)
  396.                         return PLUGIN_CONTINUE
  397.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_I)
  398.                         client_print(id, print_center, "此局手枪子弹无限,不用购买手枪子弹")
  399.                 else
  400.                         client_print(id, print_center, "此局不能购买手枪子弹")
  401.                 return PLUGIN_HANDLED
  402.         }
  403.         return PLUGIN_CONTINUE
  404. }

  405. public menuItem(id, key)
  406. {
  407.         if(g_RestRoundCounter>g_RestrictCount||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return PLUGIN_CONTINUE
  408.         if(key==2)
  409.         {
  410.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_A)
  411.                         return PLUGIN_CONTINUE
  412.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_F)
  413.                         client_print(id, print_center, "此局闪光弹无限,并自动赠与,不需购买")
  414.                 else
  415.                         client_print(id, print_center, "此局不能购买闪光弹")
  416.                 return PLUGIN_HANDLED
  417.         }
  418.         if(key==3)
  419.         {
  420.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_B)
  421.                         return PLUGIN_CONTINUE
  422.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_G)
  423.                         client_print(id, print_center, "此局高爆手雷无限,并自动赠与,不需购买")
  424.                 else
  425.                         client_print(id, print_center, "此局不能购买高爆手雷")
  426.                 return PLUGIN_HANDLED
  427.         }
  428.         if(key==4)
  429.         {
  430.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_C)
  431.                         return PLUGIN_CONTINUE
  432.                 else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_H)
  433.                         client_print(id, print_center, "此局烟雾弹无限,并自动赠与,不需购买")
  434.                 else
  435.                         client_print(id, print_center, "此局不能购买烟雾弹")
  436.                 return PLUGIN_HANDLED
  437.         }
  438.         if(key==6)  //拆弹器
  439.         {
  440.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_D)
  441.                         return PLUGIN_CONTINUE
  442.                 client_print(id, print_center, "此局禁放C4,不需购买拆弹器")
  443.                 return PLUGIN_HANDLED
  444.         }
  445.         if(key==7)  //战术盾牌
  446.         {
  447.                 client_print(id, print_center, "此局不能购买此武器")
  448.                 return PLUGIN_HANDLED
  449.         }
  450.         return PLUGIN_CONTINUE
  451. }

  452. public eAmmoX(id)
  453. {
  454.         if(g_RestRoundCounter>g_RestrictCount||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return
  455.         new clip, ammo
  456.         new wpnid = get_user_weapon(id, clip, ammo)
  457.         new Float:delaytime = get_cvar_float("amx_delaygivegrenade")
  458.         switch(wpnid)
  459.         {
  460.                 case CSW_FLASHBANG:
  461.                 {
  462.                         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_F&&ammo<2)
  463.                                 set_task(delaytime, "give_flashbang", id)
  464.                 }
  465.                 case CSW_HEGRENADE:
  466.                 {
  467.                         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_G&&ammo<1)
  468.                                 set_task(delaytime, "give_hegrenade", id)
  469.                 }
  470.                 case CSW_SMOKEGRENADE:
  471.                 {
  472.                         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_H&&ammo<1)
  473.                                 set_task(delaytime, "give_smokegrenade", id)
  474.                 }
  475.         }
  476. }

  477. public give_flashbang(id)
  478. {
  479.         if(is_user_connected(id)&&is_user_alive(id))
  480.                 give_item(id, "weapon_flashbang")
  481. }

  482. public give_hegrenade(id)
  483. {
  484.         if(is_user_connected(id)&&is_user_alive(id))
  485.                 give_item(id, "weapon_hegrenade")
  486. }
  487. public give_smokegrenade(id)
  488. {
  489.         if(is_user_connected(id)&&is_user_alive(id))
  490.                 give_item(id, "weapon_smokegrenade")
  491. }

  492. public eWeaponChange(id)
  493. {
  494.         if(g_RestRoundCounter>g_RestrictCount||g_weaponflags[g_RestRoundCounter-1]&FLAG_Z) return
  495.         new active = read_data(1)
  496.         new wpnid = read_data(2)
  497.         if(wpnid==CSW_C4)
  498.         {
  499.                 if(g_weaponflags[g_RestRoundCounter-1]&FLAG_D==0)
  500.                 {
  501.                         engclient_cmd(id, "drop","weapon_c4")
  502.                         engclient_cmd(id, "weapon_knife")
  503.                         set_task(0.1,"strip_c4", id)
  504.                 }
  505.                 return
  506.         }       
  507.         if(!active) return
  508.         if(wpnid==CSW_KNIFE) return
  509.         switch(wpnid)
  510.         {
  511.                 case CSW_USP,CSW_GLOCK18,CSW_DEAGLE,CSW_P228,CSW_ELITE,CSW_FIVESEVEN:
  512.                 {
  513.                         if(g_weaponflags[g_RestRoundCounter-1]&FLAG_I)
  514.                         {
  515.                                 if(cs_get_user_bpammo(id, wpnid)<g_MaxGunBPAmmo[wpnid])
  516.                                         cs_set_user_bpammo(id, wpnid, g_MaxGunBPAmmo[wpnid])
  517.                         }else if(g_weaponflags[g_RestRoundCounter-1]&FLAG_E==0){
  518.                                 engclient_cmd(id, "weapon_knife")
  519.                         }
  520.                 }
  521.                 case CSW_FLASHBANG:
  522.                 {
  523.                         if(g_weaponflags[g_RestRoundCounter-1]&(FLAG_A|FLAG_F)==0)
  524.                                 engclient_cmd(id, "weapon_knife")
  525.                 }
  526.                 case CSW_HEGRENADE:
  527.                 {
  528.                         if(g_weaponflags[g_RestRoundCounter-1]&(FLAG_B|FLAG_G)==0)
  529.                                 engclient_cmd(id, "weapon_knife")
  530.                 }
  531.                 case CSW_SMOKEGRENADE:
  532.                 {
  533.                         if(g_weaponflags[g_RestRoundCounter-1]&(FLAG_C|FLAG_H)==0)
  534.                                 engclient_cmd(id, "weapon_knife")
  535.                 }
  536.                 default:
  537.                 {
  538.                         engclient_cmd(id, "weapon_knife")
  539.                 }
  540.         }
  541. }

  542. public strip_c4(id)
  543. {
  544.         new weaponbox, bomb = find_ent_by_class(-1, "weapon_c4")
  545.         if(bomb && (weaponbox = entity_get_edict(bomb, EV_ENT_owner)) > get_maxplayers())
  546.         {
  547.                 remove_entity(weaponbox)
  548.                 remove_entity(bomb)
  549.                 message_begin(MSG_ALL, get_user_msgid("BombPickup"))
  550.                 message_end()
  551.         }
  552. }

  553. /* UTF-8 func by www.DT-Club.net */
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-1-15 15:17:24 | 显示全部楼层 来自 中国–山东–潍坊
谢谢版主,我就是用了这个插件,服务器间隔30秒挂一次!
现在都快没人气咧!5555555555.。。。。。
回复

使用道具 举报

发表于 2009-1-15 15:30:05 | 显示全部楼层 来自 中国–广东–韶关
附件的源码发上来
回复

使用道具 举报

 楼主| 发表于 2009-1-15 15:36:25 | 显示全部楼层 来自 中国–山东–潍坊
没源码怎么办啊!:'(
回复

使用道具 举报

发表于 2009-1-15 23:44:47 | 显示全部楼层 来自 中国–四川–遂宁
用另外的版本...
不没收C4,,就不会挂了
回复

使用道具 举报

发表于 2009-1-16 10:45:07 | 显示全部楼层 来自 中国–湖北–武汉
关注一下
回复

使用道具 举报

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

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