Ir para conteúdo

Featured Replies

Postado

Hello,
remaker script for tfs 1.x.

 

talkactions.xml

	<talkaction words="!ownbp" script="ownbp.lua"/>

ownbp.lua

local config = {
	cost = 1000, -- Cost (GP)
	ownTime = 24 * 60 * 60 * 1000, -- Time (24 horas)
	backpackId = 2000
}

function onSay(player, words, param)
    local playerID = player:getGuid()
    local owner = (playerID + 100)
    local ownerName = player:getName()
    local function noOwner(o)
        o:removeAttribute(ITEM_ATTRIBUTE_DESCRIPTION)
        o:setActionId(0)
    end
    if (player:removeMoney(config.cost) == true) then
        local backpack = doPlayerAddItem(player:getId(), config.backpackId, 1)
        if (backpack ~= nil) then
            doSetItemSpecialDescription(backpack, ownerName..' owns this container.')
            doSetItemActionId(backpack, owner)
            addEvent(noOwner, 1000 * config.ownTime, backpack)
        end
    else
        doPlayerSendCancel(cid, "You do not have the amount of GP ("..config.cost..").")
    end
end

 

 

actions.xml

	<action itemid="2000" script="ownbp.lua"/>
ownbp.lua
	function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
	    local playerID = cid:getGuid() -- getPlayerGUID(cid)
	    local owner = (item.actionid - 100)
	    if (owner > 0) then
	        if (owner ~= playerID) then
	            doPlayerSendCancel(cid, "You aren\'t owner of this container.")
	            return TRUE
	        end
	    end
	end

 

Editado por HeberPcL
Ajustes post (veja o histórico de edições)

  • 2 weeks later...

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo