leyendario
kind of scripter
Message of items inside a bp.
it send a message to the player when open the backpack/bag or any other item-container type if you want to.
actions.xml
add any other bp/bag id that you want to have this function.
bp.lua
it send a message to the player when open the backpack/bag or any other item-container type if you want to.
actions.xml
Code:
<action itemid="1988" event="script" value="bp.lua"/>
bp.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition) -- script by leyendario
local a, b, counter = getContainerSize(item.uid) or nil, "", 0
if a ~= nil then
for i = 0, a do
local c = getContainerItem(item.uid, i)
if c.itemid ~= 0 then
if c.type > 1 then
if b == "" then
b = c.type .." ".. getItemPluralNameById(c.itemid)
else
b = b ..", ".. c.type .." ".. getItemPluralNameById(c.itemid)
end
counter = 1
else
if b ~= "" then
b = b ..", ".. getItemNameById(c.itemid)
else
b = getItemNameById(c.itemid)
end
counter = 1
end
end
end
if b ~= "" then
if counter > 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have these items : '.. b ..'.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have this item : '.. b ..'.')
end
end
end
end