Ir para conteúdo

Featured Replies

Postado

Boa tarde, queria saber se alguem possa disponibilizar um comando que teria a seguinte função

 

O god falar /additem x (nome do player) é o item cair no depor ou Bag do player mesmo que ele não esteja online.

Postado

additemdepot.lua

function doPlayerAddDepotItems(pid, item, count) --By magus and edited by vodkart
    local item,count = {item},{(count or 1)}
    for k,v in ipairs(item) do
        local ls = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..pid.." ORDER BY `sid` DESC LIMIT 1")
        return db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..pid..", "..(ls:getDataInt("sid")+1)..", 101, "..v..", "..count[k]..", '')") or false
    end
end
function onSay(cid, words, param)
    local t = string.explode(param:lower(),",")
    if not t[1] then doPlayerSendCancel(cid, "digite Nome, Item ID, quantidade.")
        return true
    elseif not getPlayerByNameWildcard(t[1]) and not getPlayerGUIDByName(t[1]) then
        doPlayerSendCancel(cid, "Você deve digitar um Nome Válido.")
        return true
    elseif not tonumber(t[2]) or not tonumber(t[3]) or tonumber(t[3]) < 1 or tonumber(t[3]) > 999 or not isItemStackable(t[2]) and tonumber(t[3]) > 10 then
        doPlayerSendCancel(cid, "você deve digitar NOME,ID,QUANTIDADE(maior que 0"..(not isItemStackable(t[2]) and " até 10 se não for empilhavel." or " até 1000 se for empilhavel.")..").")
        return true
    elseif not isItemMovable(t[2]) or not getItemNameById(tonumber(t[2])) then
        doPlayerSendCancel(cid, "Este item não existe ou não pode ser adicionado ao jogador.")
        return true
    end
    local player = getPlayerByNameWildcard(t[1])
    if player then
        parcel = doCreateItemEx(ITEM_PARCEL)
        if isItemStackable(t[2]) or tonumber(t[3]) == 1 then
            doAddContainerItem(parcel, t[2], t[3])
        else
            for i = 1, t[3] do
                doAddContainerItem(parcel, t[2], 1)
            end
        end
        doPlayerSendMailByName(getPlayerNameByGUID(getPlayerGUIDByName(t[1])), parcel, 1)
    else
        local getPlayer = getPlayerGUIDByName(t[1])
        if isItemStackable(t[2]) or tonumber(t[3]) == 1 then
            doPlayerAddDepotItems(getPlayer, t[2], t[3])
        else
            for i = 1, t[3] do
            doPlayerAddDepotItems(getPlayer, t[2], 1)
            end
        end
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"você adicionou "..t[3].." "..getItemNameById(t[2]).." ao depot do jogador "..t[1])
    return true
end

 

 

TAG

 

<talkaction log="yes" access="5" words="/adddepot" event="script" value="additemdepot.lua"/>

 

 


Exemplo:

 

/adddepot vodkart,2160,500

 

or

 

/adddepot vodkart,2494,6

 

 

postei isso em 2013 acho la na otland kk

 

https://otland.net/threads/add-items-depot-from-player-online-offline.196947/

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo