发新话题
打印

[提问] 求助一个弄了好久没弄出来的效果

这种需要加一个临时表来存储
3 |/ E* Y0 c9 v4 t$ Q( v0 Wbbs.mocwww.combbs.mocwww.com3 E0 t, V& f  V' @( z
否则Char.JoinParty(CharIndex,_tome);函数会反复触发组队事件。
妖城欢迎您!

TOP

复制内容到剪贴板
代码:
--组队事件
--_player:主动组队的玩家
--_toplayer:被组队的玩家
--_type:0:加入组队,1:离开组队

tbl_party_check = {};

function RPartyEvent(_player,_toplayer,_type)
        if (tbl_party_check[Char.GetData(_player,%对象_账号%)] ~= nil) then
                if (tbl_party_check[Char.GetData(_player,%对象_账号%)] == _toplayer) then
                        tbl_party_check[Char.GetData(_player,%对象_账号%)] = nil;
                        return 1;
                end
        end
        if (_type==0) then
                local msg = "\\n\\n"..Char.GetData(_player,%对象_名字%).." 申请加入您的队伍。\\n\\n是否同意其入队申请呢?\\n\\n同意入队请选择『是』,拒绝入队请选择『否』。\\n";
                tbl_party_check[Char.GetData(_toplayer,%对象_账号%)] = _player;
                NLG.ShowWindowTalked(_toplayer,tbl_npc["id69"],%窗口_信息框%,%按钮_是否%,1,msg);
                return 0;
        end
        return 1;
end
复制内容到剪贴板
代码:
--测试——TestNpc_id69——Lua脚本
function TestNpc_id69_Talked(_npc,_player)
        return;
end

function TestNpc_id69_WTalked(_npc,_player,_seqno,_select,_data)
        local _checkplayer = tbl_party_check[Char.GetData(_player,%对象_账号%)];
        if (tonumber(_seqno)==1) then
                if (tonumber(_select) == %按钮_是%) then
                        tbl_party_check[Char.GetData(_checkplayer,%对象_账号%)] = _player;
                        Char.JoinParty(_checkplayer,_player);
                else
                        NLG.SystemMessage(_checkplayer,"队长拒绝了你的组队申请");
                end
                return;
        end
        return;
end
妖城欢迎您!

TOP

这样就可以了。新建立一个NPC,用来触发弹窗事件。
: y2 e/ |* W" B, |; z1 x妖城在线论坛
0 z- L0 P( F9 I" Q0 S/ D妖城在线论坛然后加一个临时表,用来缓存对象实例
妖城欢迎您!

TOP

魔力本身确实用WindowBuffer缓存的妖城在线论坛# u: s& V/ v1 ]- Y8 ~
魔力私服,最新魔力私服,魔力宝贝私服,魔力宝贝私服技术,魔力宝贝私服,私服架设技术,妖城,FLASH,电影,黑客,网络,网吧,破解,入侵,注册表+ B. h; c( ?6 E5 A
我台服引擎那边,lua的所有选择宠物和道具的位置缓存也都用这个。
# o6 y* @' s( I—魔力私服,魔力宝贝私服技术,DELPHI编程,魔力寶貝, 魔力宝贝, 크로스게이트,クロスゲート
' V1 |1 c0 t8 t妖城在线论坛星夜说的并无错。。。。。。
3 O; S% X+ ], {! b5 F, X妖城在线论坛妖城在线论坛, F4 R  y+ h3 p
好好沟通交流。。。。不要太暴躁。。。
妖城欢迎您!

TOP

发新话题