chojrak
Banned User
- Joined
- Oct 25, 2008
- Messages
- 5,832
- Solutions
- 2
- Reaction score
- 160
It's answer for: http://otland.net/f132/0-3-5pl1-request-51235/
Idea by Gesior.pl!
Tested on The Forgotten Server 0.3.5pl1
How it works?
It will create a parcel with items from table, then send this parcel to mailbox positions. (It'll be send to players depot by parcel system.)
The Function
mailBoxPos = some position of mail box on map.
Example talkaction for test:
How to use?
doPlayerAddDepotItems(Player UID, Town Name, Items Table {Item ID, Count}, Notification TRUE/FALSE)
Idea by Gesior.pl!
Tested on The Forgotten Server 0.3.5pl1
How it works?
It will create a parcel with items from table, then send this parcel to mailbox positions. (It'll be send to players depot by parcel system.)
The Function
mailBoxPos = some position of mail box on map.
Code:
function doPlayerAddDepotItems(cid, town, items, notify)
local mailBoxPos = {x = 991, y = 1052, z = 7}
local parcel = doCreateItemEx(2595)
local label = doAddContainerItem(parcel, 2599)
doSetItemText(label, getCreatureName(cid) .."\n".. town)
for i = 1, #items do
doAddContainerItem(parcel, items[i][1], items[i][2])
end
doTeleportThing(parcel, mailBoxPos)
if (notify == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New mail arrived.")
end
return true
end
Example talkaction for test:
Code:
function onSay(cid, words, param, channel)
local items = {
{2160, 99},
{2152, 59}
}
doPlayerAddDepotItems(cid, "Main City", items, TRUE)
return true
end
How to use?
doPlayerAddDepotItems(Player UID, Town Name, Items Table {Item ID, Count}, Notification TRUE/FALSE)
Last edited: