QuaS
Cykotitan Pwned =/
Hello There. I want to show you one of my old scripts.
Take It:
How It Configure? Look into script, there is a schema.
You are putting Unique_ID to chest or corpse/wall/mailbox(anything)
then adding line into script:
also for newbies: To actions.xml:
How It Works?:
Why am i relasing it? Cuz i am bored.
Regards QuaS~
Take It:
Lua:
local items = {
--[item_uid] = {items = { {ITEM_ID,COUNT_OF ITEM}, {ITEM_ID,COUNT_OF ITEM} ... }, container = CONTAINER_ID},
[49009] = {itemss = {{2273,2}, {2480,4},{2361,3}}, container = 2365}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local queststatus = getPlayerStorageValue(cid, item.uid)
if queststatus > 0 then
canDo = "false"
else
canDo = "true"
end
stillDo = getBooleanFromString(canDo)
if not stillDo then
weight = 0
i = 1
repeat
weight = getItemWeightById(items[item.uid].itemss[i][1],items[item.uid].itemss[i][2]) + weight
i = i + 1
until i == #items[item.uid].itemss +1
if getPlayerFreeCap(cid) >= weight then
conta = doCreateItemEx(items[item.uid].container,1)
for i = 1,#items[item.uid].itemss do
doAddContainerItem(conta, items[item.uid].itemss[i][1], items[item.uid].itemss[i][2])
end
addItemToPlayer = doPlayerAddItemEx(cid, conta , 0)
if addItemToPlayer == RETURNVALUE_NOERROR then
setPlayerStorageValue(cid,item.uid,1)
doPlayerSendTextMessage(cid,22,"You have found "..getItemArticleById(items[item.uid].container).." "..getItemNameById(items[item.uid].container)..".")
else
doPlayerSendTextMessage(cid,22,"You do not have enough space in backpack.")
end
else
doPlayerSendTextMessage(cid,22,"You have found "..getItemArticleById(items[item.uid].container).." "..getItemNameById(items[item.uid].container)..". You do not have enough cap. You need ".. weight .." oz. to carry it.")
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return TRUE
end
How It Configure? Look into script, there is a schema.
You are putting Unique_ID to chest or corpse/wall/mailbox(anything)
then adding line into script:
Lua:
[ITEM_UID] = {itemss = {{item1ID,COUNT}, {ITem2ID,count},{ITEM3ID,COUNT}}, container = CONTAINERID}
PHP:
<action uniqueid="UID_OF_CHEST" event="script" value="PATH_TO_FILE.lua" />
How It Works?:
Why am i relasing it? Cuz i am bored.
Regards QuaS~