• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Trade VIP

marcos16

Falkhonn
Joined
May 4, 2012
Messages
224
Reaction score
1
Hello.
I would like to modify this script. I would like it not to send the trade item, I want it to serve only for the trade to work, and not to send the item after accepting the trade. And also the player who says! Tradevip the item is being created in the backpack, wanted to remove that.

When the player says! Tradevip appear as in the image below. For it is not appearing.
Imgur: The most awesome images on the Internet


The item that will be used for trade worked I want it to appear like this [2 is the quantity being traded]:
Imgur: The most awesome images on the Internet


The trade is working from far, can you put it to work only 2 sqm near the target? Thanks in advance

Code:
local config = {
    itemid = 5957,
    storage1 = 223314,
    storage2 = 224413
}
function onSay(cid, words, param, param2, channel)
    if param == '' then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
        return true
    end
    local t = string.explode(param, ",")
    local creature = getCreatureByName(t[1])
    if not creature and isPlayer(creature) and not isPlayerGhost(creature) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
        return true
    end
    if os.time() > getPlayerStorageValue(cid, config.storage1) then
        local days = tonumber(t[2])
        if days < 2 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Minimum premium transfer amount is 2 days.")
        return true
    end
        if days and type(days) == 'number' and getPlayerPremiumDays(cid) - 2 >= days then
            doStartTrade(cid, creature, doPlayerAddItem(cid, config.itemid, 1))
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você deu trade no jogador " .. getPlayerName(creature) .. ", com a intenção de trocar " .. days .. " dia(s) de VIP.")
            doPlayerSendTextMessage(creature, MESSAGE_INFO_DESCR, "O Jogador " .. getPlayerName(cid) .. " deu trade em você, e está disposto a trocar " .. days .. " dia(s) de VIP.")
            setPlayerStorageValue(cid, config.storage1, os.time() + 1 * 30)
            setPlayerStorageValue(cid, config.storage2, days)
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not transfer that amount of VIP.")
        end
    else
        doPlayerSendCancel(cid, "Invalid param specified.")
        return true
    end
    return true
end
 
Back
Top