狂暴手榴彈問題

Home Home
引用 | 編輯 AA-.-
2013-02-24 23:46
樓主
推文 x0
我是用此大大的插件
http://bbs-mychat.com/reads.php?tid=883419&keyword=%E7%8B%82%E6%9A%B4
我想限制它的購買次數 但我又不懂
有大大可以我嗎

獻花 x0
引用 | 編輯 八云の橙貓
2013-02-25 19:51
1樓
  
下面是引用 AA-.- 於 2013-02-24 23:46 發表的 狂暴手榴彈問題: 到引言文
我是用此大大的插件
http://bbs-mychat.com/reads.php?tid=883419&keyword=%E7%8B%82%E6%9A%B4
我想限制它的購買次數 但我又不懂
有大大可以我嗎

首先 在最前面加上
複製程式
new g_count


接著在plugin_init()加上

複製程式
    register_event("HLTV", "event_RoundStart", "a", "1=0", "2=0")


找到
複製程式
 public zp_extra_item_selected(id, Item)
{
       if (Item == g_iNadeID)
       {
              if (g_iJumpingNadeCount[id] >= 5)
              {
                     zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + g_iItemPrice)
                     client_print(id, print_chat, "[ZP] 你不能取得更多 狂暴手榴彈 !")
                     return PLUGIN_HANDLED;
              }

              give_zp_item(id)
       }

       return PLUGIN_CONTINUE
}

改成以下

複製程式
 public zp_extra_item_selected(id, Item)
{
       if (Item == g_iNadeID)
       {
              if (g_iJumpingNadeCount[id] >= 5)
              {
                     zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + g_iItemPrice)
                     client_print(id, print_chat, "[ZP] 你不能取得更多 狂暴手榴彈 !")
                     return PLUGIN_HANDLED;
              }
              else if(g_count >= 你想要的數字)
              {    
                     zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + g_iItemPrice) 
                     client_print(id,  print_chat,  "[ZP] 道具出售完畢")
                     return PLUGIN_HANDLED;

              }

              give_zp_item(id)
              g_count++
      }

       return PLUGIN_CONTINUE
}


再增加一個函數為
複製程式
 public event_RoundStart()
       g_count = 0




以上 如不行請提出

獻花 x2
引用 | 編輯 AA-.-
2013-02-26 20:35
2樓
  
下面是引用 八云の橙貓 於 2013-02-25 19:51 發表的 : 到引言文

首先 在最前面加上
複製程式
 
new g_count 

.......

轉檔失敗了.......

獻花 x0
引用 | 編輯 八云の橙貓
2013-02-26 22:22
3樓
  
下面是引用 AA-.- 於 2013-02-26 20:35 發表的 : 到引言文
 
轉檔失敗了.......



不好意思 麻煩您貼一下錯誤內容

獻花 x0
引用 | 編輯 AA-.-
2013-02-27 21:33
4樓
  
這個......


圖 1.


獻花 x0
引用 | 編輯 八云の橙貓
2013-02-27 23:33
5樓
  
阿 這個錯誤訊息代表round start已經定義在插件中了

那只要把我那部份直接放到已經定義好的裡面即可(咱上面貼的那個event round start就不用加了)

找到相同的函數貼上
複製程式
g_count = 0
即可囉

獻花 x0
引用 | 編輯 AA-.-
2013-02-28 19:33
6樓
  
抱歉 我是AMXX新手
那即是把g_count = 0 貼在 public event_RoundStart() arrayset(g_iJumpingNadeCount, 0, 33)?

獻花 x0
引用 | 編輯 八云の橙貓
2013-02-28 21:33
7樓
  
下面是引用 AA-.- 於 2013-02-28 19:33 發表的 : 到引言文
抱歉 我是AMXX新手
那即是把g_count = 0 貼在 public event_RoundStart() arrayset(g_iJumpingNadeCount, 0, 33)?



是的 但是作者為了方便省略排版 
複製程式
public event_RoundStart() arrayset(g_iJumpingNadeCount, 0, 33)



請樓主排成這樣 (不確定直接打在後面是否會造成問題)
複製程式
public event_RoundStart() 
{
     arrayset(g_iJumpingNadeCount, 0, 33)
     g_count = 0
}


獻花 x1
引用 | 編輯 AA-.-
2013-03-01 20:40
8樓
  
終於成功了 表情
謝謝大大的指導

獻花 x1