購買人類道具 武器的 SMA 是這樣寫嗎????(已OK)

Home Home
引用 | 編輯 死之天使
2011-01-23 10:26
樓主
推文 x0
複製程式
#include <amxmodx>

#include <fakemeta>

#include <cstrike>

#include <fun>

#include <hamsandwich>

#include <zombieplague>





new g_itemid1, g_itemid2, g_itemid3




 g_itemid1 = zp_register_extra_item("Barret M82A1", 50, ZP_TEAM_HUMAN) 

}

public zp_extra_item_selected(player, itemid)

{
 if (itemid == g_itemid1)
 client_print(player, print_chat, "[ZP]獲得Barret M82A1")

}





give_weapon_sg550(id)








貌似完全寫錯(根本就都寫錯了)


還有支援BOT要怎樣寫?

獻花 x0
引用 | 編輯 a7811311622
2011-01-23 13:04
1樓
  
複製程式
 
#include <amxmodx> 
#include <fakemeta> 
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 
#include <zombieplague> 

new g_itemid1, g_itemid2, g_itemid3 

public plugin_init() 
{ 
 g_itemid1 = zp_register_extra_item("Barret M82A1", 50, ZP_TEAM_HUMAN) 
} 
public zp_extra_item_selected(player, itemid) 
{ 
 if (itemid == g_itemid1) 
 { 
  give_weapon_sg550(id) 
  client_print(player, print_chat, "[ZP]獲得Barret M82A1") 
 } 
} 

大致上是這樣寫的吧…
而且如果槍支沒有什麼特殊效果(例如射擊榴彈)的話…
剩下的就只是支援BOT隨機購買而已…

獻花 x1
引用 | 編輯 X!a0an@小安
2011-01-23 16:35
2樓
  
可是
give_weapon_sg550(id) 
這一段不是要有個定義嗎?

要定義出
give_weapon
的動作吧?

----------------------------------------give_weapon_sg550(id) [/pre]它沒有定義ID是誰,應該要改成[/pre]give_weapon_sg550(player)[/pre]吧? [/pre][/pre]
---------------------------------------

還有,竟然只用到一個g_itemid1
那其他的就刪掉吧?
把new g_itemid1, g_itemid2, g_itemid3
改為new g_itemid1
因為太多沒用的東西很佔cs資源,會跑很慢




獻花 x1
引用 | 編輯 Hangbaby
2011-03-22 19:14
3樓
  
我想知道掉了後,再拿回,應該加??

獻花 x0
引用 | 編輯 Abcdzxc555
2011-03-22 22:42
4樓
  
stock give_weapon_sg550(id)
{
       give_item(id, "weapon_sg550")
}

獻花 x0
引用 | 編輯 Abcdzxc555
2011-03-22 22:47
5樓
  
支援BOT
public zp_round_started(gamemode, id)
{
    for (new bot = 1; bot <= 32; bot++)
    {
        if (zp_get_user_ammo_packs(bot) >= 50 && !zp_get_user_zombie(bot) && is_user_alive(bot) && is_user_bot(bot))
              zp_extra_item_selected(bot, g_itemid1)
    }
}

獻花 x0
引用 | 編輯 Hangbaby
2011-03-23 22:47
6樓
  
轉模組呢,樓上大大的msn是,我想請教你

獻花 x0
引用 | 編輯 Hangbaby
2011-04-02 13:40
7樓
  
保留下場使用呢

獻花 x0