>> All modules were loaded, server starting up...
>> TFS2 server Online!
terminate called after throwing an instance of 'boost::system::system_error'
what(): Address already in use
-- simple quests based on uniqueId
-- to make quest create chest on map and set its uniqueId to id of quest item
function onUse(cid, item, frompos, item2, topos)
prize = item.uid
if prize > 1000 and prize < 5000 then
queststatus = getPlayerStorageValue(cid,prize)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,1)
setPlayerStorageValue(cid,prize,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return 1
else
return 0
end
end
local itemsTable = parameters.items
local items_list = ''
if table.maxn(itemsTable) > 0 then
for i = 1, table.maxn(itemsTable) do
local item = itemsTable[i]
items_list = items_list .. item[2] .. ' '[COLOR="Red"] .. getItemName(item[1][/COLOR])
if i ~= table.maxn(itemsTable) then
items_list = items_list .. ', '
end
end
end
-- simple quests based on uniqueId
-- to make quest create chest on map and set its uniqueId to id of quest item
function onUse(cid, item, frompos, item2, topos)
prize = item.uid
if prize > 1000 and prize < 5000 then
queststatus = getPlayerStorageValue(cid,prize)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,1)
setPlayerStorageValue(cid,prize,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return 1
else
return 0
end
end
local itemsTable = parameters.items
local items_list = ''
if table.maxn(itemsTable) > 0 then
for i = 1, table.maxn(itemsTable) do
local item = itemsTable[i]
items_list = items_list .. item[2] .. ' ' .. getItemName(item[1])
if i ~= table.maxn(itemsTable) then
items_list = items_list .. ', '
end
end
end
plx help nop pode crear a char
hello,the doors of my work experience which can not be the problem
Hello
i have a little problem xD.
i changed the map for a custom but i've a problem with chests.....doesnt works!!!then i took the "basicquest" script from the tfs 0.2
is this:
PHP:-- simple quests based on uniqueId -- to make quest create chest on map and set its uniqueId to id of quest item function onUse(cid, item, frompos, item2, topos) prize = item.uid if prize > 1000 and prize < 5000 then queststatus = getPlayerStorageValue(cid,prize) if queststatus == -1 then doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.') doPlayerAddItem(cid,prize,1) setPlayerStorageValue(cid,prize,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end return 1 else return 0 end end
BUT look.this happens when you use the chest.
and the addons npc doesnt works correctly.
i think that the problem is this command "getItemName(prize)" the server doesnt mmmm "understand" this order the server takes the chest name,not the item name ,then my addons NPC goes crazy xD because him use the same order
PHP:local itemsTable = parameters.items local items_list = '' if table.maxn(itemsTable) > 0 then for i = 1, table.maxn(itemsTable) do local item = itemsTable[i] items_list = items_list .. item[2] .. ' ' .. getItemName(item[1]) if i ~= table.maxn(itemsTable) then items_list = items_list .. ', ' end end end
plix help,maybe in this ot the script has changed the name and i'm using other ,that not works :S
i dont know if with the original map the chests works OK!!!