AMXX開發 - 武器系統[ | ]
ck_Register_Weapon[ | ]
inc里該函數如下:
native ck_Register_Weapon(itemtype, class, const slot[], const wpbody[], const init[], const corename[])
參數:
itemtype:該武器在遊戲中對應的物品類型(itemtype),只有當該武器為解鎖武器時才應該寫上對應的物品類型,否則必須寫-1;
class : (1 << 該兵種對應ID) ,詳見const inc
slot :數組型,共9個數組,對應9兵種,每個位填對應的slot鍵位 ,詳見const inc
const wpbody[] : 數組型,共9個數組,對應9兵種,每個位填WPBODY ,詳見const inc
const init[] : 數組型,共9個數組,每個位填1代表是該兵種的初始武器,0則不是
const corename[] : 核心名, 插件間識別用,請以」wpn_」打頭
作用:註冊一個新的武器,如果是解鎖武器需要提供已經註冊的itemtype
返回:它會返回給你分配到的武器類型(weapontype aka wpntype)
相關:無