請問要怎麼寫"無法使用右鍵"?

Home Home
引用 | 編輯 ak47klo
2014-04-06 20:22
樓主
推文 x0
我要我要限制玩家無法使用右鍵
要怎麼寫?

獻花 x0
引用 | 編輯 op47
2014-04-06 21:05
1樓
  
FM_CmdStart

獻花 x0
引用 | 編輯 ak47klo
2014-04-06 22:33
2樓
  
下面是引用 op47 於 2014-04-06 21:05 發表的: 到引言文
FM_CmdStart
我也知道
語法呢?

獻花 x0
引用 | 編輯 岳岳
2014-04-07 17:37
3樓
  
get_user_button(id)?????

獻花 x0
引用 | 編輯 Nailaz
2014-04-07 18:23
4樓
  
public fw_CmdStart(id, uc_handle, seed)
{
     if((get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) && (pev(id,pev_oldbuttons) & IN_ATTACK2))
    (如果按了右鍵,要執行的寫入下列)
    {
    }
}


獻花 x0
引用 | 編輯 岳岳
2014-04-07 23:43
5樓
  
下面是引用 Nailaz 於 2014-04-07 18:23 發表的 : 到引言文
public fw_CmdStart(id, uc_handle, seed)
{
     if((get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) && (pev(id,pev_oldbuttons) & IN_ATTACK2))
    (如果按了右鍵,要執行的寫入下列)
    {
    }
}



應該是不用用到oldbuttons...他好像是只要隔檔右鍵的功能而已...我記得oldbutton是放開按鈕的動作0.0

獻花 x0
引用 | 編輯 ak47klo
2014-04-08 18:25
6樓
  
下面是引用 Nailaz 於 2014-04-07 18:23 發表的: 到引言文
那如果我要使玩家無法執行任何動作呢...?
應該也有特定語法吧?

獻花 x0
引用 | 編輯 Nailaz
2014-04-08 19:10
7樓
  
加個
return FMRES_IGNORED

獻花 x0
引用 | 編輯 ak47klo
2014-04-08 19:19
8樓
  
下面是引用 Nailaz 於 2014-04-08 19:10 發表的: 到引言文
加個
return FMRES_IGNORED
這樣就可以了吧...

獻花 x0
引用 | 編輯 11922911
2014-04-09 16:53
9樓
  
下面是引用 ak47klo 於 2014-04-06 22:33 發表的 : 到引言文

我也知道
語法呢?

複製程式
#include amxmodx
#include fakemeta

public plugin_init()
{
       register_forward(FM_CmdStart, "CmdStart_Post", 1);
}

public CmdStart_Post( player, uc_handle, random_seed )
{
       new buttons = get_uc(uc_handle, UC_Buttons);
       if( buttons & IN_ATTACK2 )
       {
              set_uc(uc_handle, UC_Buttons, buttons & ~IN_ATTACK2);
       }
}

複製程式
#include amxmodx
#include fakemeta

public plugin_init()
{
       register_forward(FM_PlayerPreThink, "PlayerPreThink");
}

public PlayerPreThink( entity )
{
       new button = pev(entity, pev_button);
       if( button & IN_ATTACK2 )
       {
              set_pev(entity, pev_button, button & ~IN_ATTACK2);
       }
}


獻花 x0