• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua [TALK] -=[TFS]=- 0.4 v8.60 I would like you to sell everything at once in the !sellall command and 1 of each in the !sell command

samuel157

/root
Joined
Mar 19, 2010
Messages
447
Solutions
3
Reaction score
49
Location
São Paulo, Brazil
GitHub
Samuel10M
Lua:
local sellTable = {
[2498] = 40000,
[2475] = 6000,
[2497] = 9000,
[2491] = 5000,
[2462] = 4000,
[2663] = 500,
[2458] = 35,
[2459] = 30,
[2645] = 400000,
[2195] = 40000,
[2646] = 100000,
[2472] = 100000,
[2492] = 60000,
[2494] = 90000,
[2466] = 30000,
[2487] = 20000,
[2476] = 5000,
[2656] = 15000,
[2500] = 2500,
[2463] = 400,
[2465] = 200,
[2464] = 100,
[2470] = 80000,
[2488] = 15000,
[2477] = 6000,
[2647] = 500,
[2487] = 100,
[2514] = 80000,
[2520] = 40000,
[2523] = 150000,
[2522] = 100000,
[2534] = 25000,
[2536] = 8000,
[2537] = 4000,
[2519] = 5000,
[2528] = 4000,
[2515] = 200,
[2518] = 1500,
[2525] = 100,
[2390] = 150000,
[2408] = 100000,
[2400] = 90000,
[2393] = 10000,
[2407] = 6000,
[2396] = 4000,
[2392] = 3000,
[2409] = 1500,
[2383] = 800,
[2377] = 400,
[2413] = 70,
[2406] = 30,
[2376] = 25,
[2414] = 10000,
[2431] = 90000,
[2427] = 7500,
[2432] = 10000,
[2430] = 2000,
[2387] = 200,
[2381] = 200,
[2378] = 100,
[2388] = 20,
[2391] = 6000,
[2421] = 90000,
[2436] = 1000,
[2434] = 2000,
[2423] = 200,
[2417] = 60,
[2398] = 30,
}

function on_search_container(cid, uid)
local size = getContainerCap(uid)
for slot = (size - 1), 0, -1 do
    local item = getContainerItem(uid, slot)
    if item.uid > 0 then
        if sellTable[item.itemid] then
            doPlayerAddMoney(cid, sellTable[item.itemid])
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sold ".. getItemNameById(item.itemid) .." for ".. sellTable[item.itemid] .." gold.")
            doRemoveItem(item.uid, 1)
        elseif isContainer(item.uid) then
            on_search_container(cid, item.uid)
        end
    end
end
end

function onSay(cid, words, param, channel)
on_search_container(cid, getPlayerSlotItem(cid, CONST_SLOT_BACKPACK).uid)
return true
end
Code:

XML:
<talkaction words="!sell;!sellall" event="script" value="sellall.lua"/>
 
Back
Top