詢問如何不用<cstrike>模塊取得玩家是否裝消音器

Home Home
引用 | 編輯 8106125
2014-12-29 02:15
樓主
推文 x0
如標題.

獻花 x0
引用 | 編輯 andyt0621
2014-12-29 20:40
1樓
  
複製程式
stock fm_get_weapon_silen(index)
{
       new silencemode = get_pdata_int(index, 74, 4), weapon = get_pdata_int(index, 43, 4);
       if (weapon == CSW_USP && silencemode & (1<<0)) return 1;
       if (weapon == CSW_M4A1 && silencemode & (1<<2)) return 1;
       return 0;
}


獻花 x1
引用 | 編輯 岳岳
2014-12-29 23:26
2樓
  
下面是引用 andyt0621 於 2014-12-29 20:40 發表的 : 到引言文
複製程式
stock fm_get_weapon_silen(index)
{
       new silencemode = get_pdata_int(index, 74, 4), weapon = get_pdata_int(index, 43, 4);
       if (weapon == CSW_USP && silencemode & (1<<0)) return 1;
       if (weapon == CSW_M4A1 && silencemode & (1<<2)) return 1;
       return 0;
}



想請問一下喔..."(1<<0)" 這個是甚麼意思??

獻花 x1
引用 | 編輯 8106125
2015-01-02 00:19
3樓
  
複製程式
static weap_id
weap_id = get_user_weapon(attacker)

if (weap_id == CSW_USP || weap_id == CSW_M4A1)
{
       if (fm_get_weapon_silen(attacker))
       {
              damage *= 1.1
              client_print(attacker, print_chat, "增加傷害")
              SetHamParamFloat(4, damage)
       }
}

用這樣的寫法沒辦法判斷,是不是有裝消音器呢
想詢問寫法,謝謝

獻花 x0