logoHourGlass
RegPartyEvent

NL.RegPartyEvent

NL.RegPartyEvent(Dofile, FuncName)

函數功能

創建一個玩家組隊觸發的事件。

參數說明

  • Dofile:字符串 要加載的腳本文件名,如果爲當前文件,則定義nil即可
  • InitFuncName:字符串 觸發的Lua函數的名稱,該函數的申明格式請參考[PartyEventCallBack]

返回值

無返回值

語法

PartyEventCallBack(CharIndex, TargetCharIndex, Type)

參數說明

  • CharIndex:數值型 響應事件的對象index,該值由Lua引擎傳遞給本函數。(隊員)
  • TargetCharIndex:數值型 響應事件的對象index,該值由Lua引擎傳遞給本函數。(隊長)
  • Type:數值型 模式,離隊還是加入團隊,該值由Lua引擎傳遞給本函數。(0:加入組隊,1:離開組隊)

返回值

返回1表示允許操作,返回0表示禁止操作(組隊失敗/離隊失敗)

參考實例

NL.RegPartyEvent(nil,”MyPartyEvent”);

function MyPartyEvent(CharIndex, TargetCharIndex, Type)
  if(Type==0)then
    print("不能加入組隊喲!");
    return 0;
  end
  return 1;
end