随便写的,没怎么测试。。
! y) B5 }8 G+ P' i7 K4 Y妖城在线论坛) g- d. r* z+ J: S" A
试试看吧,架构还是你之前的,我只是做出来效果而已。
5 ~0 W. g# O, a魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート5 W* _3 X C! I
另外,我不建议在人物身上挂任何的callback..(如loop,会跟宠邮的loop产生冲突)
复制内容到剪贴板
代码:
NL.RegPartyEvent(nil,"OnPlayerJoinParty");
Delegate.RegInit("PartyManager_Init");
function OnPlayerJoinParty( _index, _target, _type)
if _type == 0 then
local ConfirmMessage = "\\n\\n"..Char.GetData(_index, 2000).." 申请加入您的队伍。\\n\\n是否同意其入队申请呢?\\n\\n同意入队请选择『是』,拒绝入队请选择『否』。\\n"
if NLG.ShowWindowTalked( _target, m_PartyManager, 0, 12, _index, ConfirmMessage) < 0 then
return 1; --异常处理机制(如果没法给队长发送消息..)
end
return 0;
end
return 1;
end
function OnPartyManagerWindowTalked( _me, _tome, _seqno, _select, _data)
if not _seqno then --索引异常(一般不会出现)
return;
end
local PartyMode = Char.GetData( _tome, 386); --%对象_组队模式%
if PartyMode > 1 then --组队状态异常( 0 is none, 1 is leader)
return;
end
if( _select == 8) then
NLG.SystemMessage( _seqno,"队长拒绝了您的入队申请!");
else
Char.JoinParty( _seqno, _tome);
end
return;
end
function PartyManager_Init()
if (m_PartyManager == nil) then
m_PartyManager = NormalCreate( 0, 99, 33, 777, 4, "PartManager");
if( VaildChar(m_PartyManager) == true) then
Char.SetWindowTalkedEvent(nil, "OnPartyManagerWindowTalked", m_PartyManager);
end
end
end