复制内容到剪贴板
代码:
--组队事件
--_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