|
--此条LUAC来自珊瑚大大精心制作无错版.
--使用方法.GMSV-LUA-System-BaseModule-luac.(以下代码复制进你的luac里)
--##########
--# 全队指令
--##########
local s_tmp = Split(s,",")
local key = s_tmp[1] or ""
--全队道具栏空位检测
if key == "gaitemspace" then
local RTFLG = 1;
local NeedNum = tonumber(s_tmp[2]) or 1
for i = 0,4 do
local pch = Char.GetPartyMember(player,i);
if Char.GetData(player,%对象_组队模式%) == 0 then
pch = player
end
local EmptyNum = 0
for j = 8, 27 do
if Char.GetItemIndex(pch,j) < 0 then
EmptyNum = EmptyNum + 1
end
end
if EmptyNum < NeedNum then
RTFLG = 0
--告诉队员
NLG.SystemMessage(pch,"需要保留"..NeedNum.."个道具栏空位");
--告诉队长
if pch ~= player then
NLG.SystemMessage(player,"["..Char.GetData(pch,2000).."]需要保留"..NeedNum.."个道具栏空位");
end
end
if Char.GetData(player,%对象_组队模式%) == 0 then
break
end
end
return RTFLG
--全队给道具
elseif key == "gagiveitem" then
local ItemID = tonumber(s_tmp[2]) or 0;
if ItemID == 0 then return 0 end;
local ItemNum = tonumber(s_tmp[3]) or 1;
for i = 0 , 4 do
local pch = Char.GetPartyMember(player,i);
if Char.GetData(player,%对象_组队模式%) == 0 then
pch = player
end
local ItemIndex = Char.GiveItem(pch,ItemID,ItemNum);
if pch ~= player then
NLG.SystemMessage(player,"["..Char.GetData(pch,2000).."]获得了 "..Item.GetData(ItemIndex,2001));
end
if Char.GetData(player,%对象_组队模式%) == 0 then
break
end
end
return 1
end
-------
---以下为脚本的写法.
block
luac gaitemspace,1
if localcount31 == 1
window "啊.啊.啊.",OK,cancel
window_OK
luac gagiveitem,211,1
#warp 0,1000,238,80
endif
endblock |
|