• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Actions] Backpack Owner

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[Actions] Backpack Owner Empty [Actions] Backpack Owner Miér Dic 05, 2018 4:50 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    Hola usuarios de tibiaface

    Esta es una backpack que va contener el nombre del player, donde solo el puede abrir y mover la backpack.

    nos vamos a:

    data/actions/scripts
    copiamos cualquier archivo y renobramos por owner.lua y pegamos esto dentro

    Código:

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if itemEx.actionid ~= 3070 then
           if isInArray({1988, 2365}, itemEx.itemid) then
               doItemSetAttribute(itemEx.uid, "aid", 3070)
               doItemSetAttribute(itemEx.uid, "uid", getPlayerGUID(cid) + 1000)
               doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " that belongs to ".. getCreatureName(cid) .. ".")
               doRemoveItem(item.uid)
           else
               doPlayerSendCancel(cid, "Sorry, not possible.")
           end
       else
           doPlayerSendCancel(cid, "Sorry, not possible.")
       end

       return true
    end


    ahora nos vamos a:

    data/actions/actions.xml
    y agregamos esta tag

    Código:
    <action itemid="4851" event="script" value="owner.lua"/>

    este 4851 es un objeto que al ser usasdo en la backpack le agregara el nombre del player

    if isInArray({1988, 2365}, itemEx.itemid) then

    en esta aprte podemos agregar ls item que se podran agregarle el nombre del player

    bueno continuamos............

    nos vamos a:

    data/actions/scripts
    copiamos cualquier archivo y renombramos por backpack.lua y pegamos esto dentro

    Código:

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if item.actionid == 3070 then
           if item.uid ~= getPlayerGUID(cid) + 1000 then
               doPlayerSendCancel(cid, "Sorry, this backpack doesn't belong to you.")
               return true
           end
       end
    end

    nos vamos a:

    data/actions/actions.xml
    y agregamos esta tag

    Código:
    <action actionid="3070" event="script" value="backpack.lua"/>


    y listo eso seria todo

    #Creditos

    >JDB|



    [Actions] Backpack Owner YNU5B25
    5 participantes
    http://www.tibiaface.com

    2[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Jul 30, 2019 2:33 am

    gzdiaz20

    gzdiaz20
    Miembro
    Miembro
    esta cool pero no se podria poner x storage

    5 participantes

    3[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Jul 30, 2019 7:41 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    gzdiaz20 escribió:esta cool pero no se podria poner x storage

    explicate



    [Actions] Backpack Owner YNU5B25
    5 participantes
    http://www.tibiaface.com

    4[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Vie Ene 03, 2020 8:20 pm

    gzdiaz20

    gzdiaz20
    Miembro
    Miembro
    todo bn pero ahora me sale Duplicate uniqueId 1007 cuando conepta un player con un bp q tenga el owner y si tiene mas de un bp salen mas Duplicate uniqueId 1007

    Duplicate uniqueId 1007
    Duplicate uniqueId 1007
    Duplicate uniqueId 1007
    Duplicate uniqueId 1007
    Duplicate uniqueId 1007

    5 participantes

    5[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Vie Ene 03, 2020 8:47 pm

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    gzdiaz20 escribió:todo bn pero ahora me sale Duplicate uniqueId 1007 cuando conepta un player con un bp q tenga el owner y si tiene mas de un bp salen mas Duplicate uniqueId 1007

    Duplicate uniqueId 1007
    Duplicate uniqueId 1007
    Duplicate uniqueId 1007
    Duplicate uniqueId 1007
    Duplicate uniqueId 1007

    es muy probable que usted tenga en action.xml tenga alguna linea con ese unique id



    [Actions] Backpack Owner YNU5B25
    5 participantes
    http://www.tibiaface.com

    6[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Sáb Feb 18, 2023 4:43 pm

    Deken

    Deken
    Miembro
    Miembro
    y para que sea una quest??

    5 participantes

    7[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Feb 21, 2023 9:11 am

    [Admin] God Maya

    [Admin] God Maya
    Administrador
    Administrador
    este 4851 es un objeto que al ser usasdo en la backpack le agregara el nombre del player

    busque un objeto usable pero no movible para que lo coloque como ua quest y reemplaza en ves de 4851 asi que usario que lleguen a cierto level de la quest vayan y le den clic a cierto objeto y puedan darle clic a su backpack



    [Actions] Backpack Owner YNU5B25
    5 participantes
    http://www.tibiaface.com

    8[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Feb 21, 2023 12:03 pm

    Deken

    Deken
    Miembro
    Miembro
    [Admin] God Maya escribió:
    este 4851 es un objeto que al ser usasdo en la backpack le agregara el nombre del player

    busque un objeto usable pero no movible para que lo coloque como ua quest y reemplaza en ves de 4851 asi que usario que lleguen a cierto level de la quest vayan y le den clic a cierto objeto y puedan darle clic a su backpack

    me refiero que una quest te de ya el backpack

    5 participantes

    9[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Feb 21, 2023 1:15 pm

    SoyFabi

    SoyFabi
    Miembro
    Miembro
    Deken escribió:
    [Admin] God Maya escribió:
    este 4851 es un objeto que al ser usasdo en la backpack le agregara el nombre del player

    busque un objeto usable pero no movible para que lo coloque como ua quest y reemplaza en ves de 4851 asi que usario que lleguen a cierto level de la quest vayan y le den clic a cierto objeto y puedan darle clic a su backpack

    me refiero que una quest te de ya el backpack  


    Código:
    function onUse(cid, item, target, fromPosition, toPosition, isHotkey)

     local item = doPlayerAddItem(cid, 1988, 1) --/ Item que dara al abrir el cofre.
     local name = 1988 --/ Nombre del Item "Demon Armor"
     local storage = 63075 --/ Storage.
     
    if getCreatureStorage(cid, storage) ~= 1 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Haz encontrado un Backpack.")
       doCreatureSetStorage(cid, storage, 1)
       doItemSetAttribute(item, "aid", 3070)
       doItemSetAttribute(item, "uid", getPlayerGUID(cid) + 1000)
       doItemSetAttribute(item, "name", getItemInfo(name).name .. ", the owner is ".. getCreatureName(cid) .. "")
    else
       doPlayerSendCancel(cid, "Ya haz abierto este cofre.")
    end

       return true
    end

    5 participantes

    10[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Feb 21, 2023 1:25 pm

    Deken

    Deken
    Miembro
    Miembro
    SoyFabi escribió:
    Deken escribió:
    [Admin] God Maya escribió:
    este 4851 es un objeto que al ser usasdo en la backpack le agregara el nombre del player

    busque un objeto usable pero no movible para que lo coloque como ua quest y reemplaza en ves de 4851 asi que usario que lleguen a cierto level de la quest vayan y le den clic a cierto objeto y puedan darle clic a su backpack

    me refiero que una quest te de ya el backpack  


    muy bien pero se puede hacer mas de una ves y cualquiera puede usas ese item



    Código:
    function onUse(cid, item, target, fromPosition, toPosition, isHotkey)

     local item = doPlayerAddItem(cid, 1988, 1) --/ Item que dara al abrir el cofre.
     local name = 1988 --/ Nombre del Item "Demon Armor"
     local storage = 63075 --/ Storage.
     
    if getCreatureStorage(cid, storage) ~= 1 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Haz encontrado un Backpack.")
       doCreatureSetStorage(cid, storage, 1)
       doItemSetAttribute(item, "aid", 3070)
       doItemSetAttribute(item, "uid", getPlayerGUID(cid) + 1000)
       doItemSetAttribute(item, "name", getItemInfo(name).name .. ", the owner is ".. getCreatureName(cid) .. "")
    else
       doPlayerSendCancel(cid, "Ya haz abierto este cofre.")
    end

       return true
    end

    5 participantes

    11[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Feb 21, 2023 2:17 pm

    SoyFabi

    SoyFabi
    Miembro
    Miembro
    Ahora si:

    Código:
    function onUse(cid, item, target, fromPosition, toPosition, isHotkey)

     local item = 2187 --/ Item que dara al abrir el cofre.
     local count = 1 --/ Cantidad
     
     local name = 2187 --/ Nombre del Item "Wand of Inferno"
     local storage = 63075 --/ Storage.
     
    if getPlayerStorageValue(cid, storage) < 1 then
       doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Haz encontrado una ".. getItemNameById(item)..".")
       setPlayerStorageValue(cid, storage, 1)
       local item_reward =  doPlayerAddItem(cid, item, count)
       doItemSetAttribute(item_reward, "aid", 3070)
       doItemSetAttribute(item_reward, "uid", getPlayerGUID(cid) + 1000)
       doItemSetAttribute(item_reward, "name", getItemInfo(item).name .. ", the owner is ".. getCreatureName(cid) .. "")
    else
       doPlayerSendCancel(cid, "Ya haz abierto este cofre.")
    end

       return true
    end



    Última edición por SoyFabi el Miér Feb 22, 2023 12:10 am, editado 1 vez

    5 participantes

    12[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Mar Feb 21, 2023 2:37 pm

    SoyFabi

    SoyFabi
    Miembro
    Miembro
    El de Movements:

    Código:
    function onEquip(cid, item, slot)
       if item.actionid == 3070 then
          if item.uid == getPlayerGUID(cid) + 1000 then
          return true
       end
       doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Sorry, this does not belong to you.")
       end
       return false
    end

    5 participantes

    13[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Jue Feb 23, 2023 1:48 am

    Deken

    Deken
    Miembro
    Miembro

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if itemEx.actionid ~= 3070 then
           if isInArray({1988, 2365}, itemEx.itemid) then
               doItemSetAttribute(itemEx.uid, "aid", 3070)
               doItemSetAttribute(itemEx.uid, "uid", getPlayerGUID(cid) + 1000)
               doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " that belongs to ".. getCreatureName(cid) .. ".")
               doRemoveItem(item.uid)
           else
               doPlayerSendCancel(cid, "Sorry, not possible.")
           end
       else
           doPlayerSendCancel(cid, "Sorry, not possible.")
       end

       return true
    end

    me sale esto
    (LuaInterface::luaDoItemSetAttribute) Value for protected key "uid" must be in range of 1000 to 65535

    5 participantes

    14[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Jue Feb 23, 2023 2:39 pm

    akane

    akane
    Miembro
    Miembro
    Deken escribió:

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if itemEx.actionid ~= 3070 then
           if isInArray({1988, 2365}, itemEx.itemid) then
               doItemSetAttribute(itemEx.uid, "aid", 3070)
               doItemSetAttribute(itemEx.uid, "uid", getPlayerGUID(cid) + 1000)
               doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " that belongs to ".. getCreatureName(cid) .. ".")
               doRemoveItem(item.uid)
           else
               doPlayerSendCancel(cid, "Sorry, not possible.")
           end
       else
           doPlayerSendCancel(cid, "Sorry, not possible.")
       end

       return true
    end

    me sale esto
    (LuaInterface::luaDoItemSetAttribute) Value for protected key "uid" must be in range of 1000 to 65535



    el uid debe ser abajo de 65535

    5 participantes

    15[Actions] Backpack Owner Empty Re: [Actions] Backpack Owner Jue Feb 23, 2023 2:43 pm

    Deken

    Deken
    Miembro
    Miembro
    akane escribió:
    Deken escribió:

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if itemEx.actionid ~= 3070 then
           if isInArray({1988, 2365}, itemEx.itemid) then
               doItemSetAttribute(itemEx.uid, "aid", 3070)
               doItemSetAttribute(itemEx.uid, "uid", getPlayerGUID(cid) + 1000)
               doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " that belongs to ".. getCreatureName(cid) .. ".")
               doRemoveItem(item.uid)
           else
               doPlayerSendCancel(cid, "Sorry, not possible.")
           end
       else
           doPlayerSendCancel(cid, "Sorry, not possible.")
       end

       return true
    end

    me sale esto
    (LuaInterface::luaDoItemSetAttribute) Value for protected key "uid" must be in range of 1000 to 65535



    el uid debe ser abajo de 65535


    si pero lo tengo a 1000 y nada me sale lo mismo




    Deken escribió:

    function onUse(cid, item, fromPosition, itemEx, toPosition)
       if itemEx.actionid ~= 3070 then
           if isInArray({1988, 2365}, itemEx.itemid) then
               doItemSetAttribute(itemEx.uid, "aid", 3070)
               doItemSetAttribute(itemEx.uid, "uid", getPlayerGUID(cid) + 1000)
               doItemSetAttribute(itemEx.uid, "name", getItemInfo(itemEx.itemid).name .. " that belongs to ".. getCreatureName(cid) .. ".")
               doRemoveItem(item.uid)
           else
               doPlayerSendCancel(cid, "Sorry, not possible.")
           end
       else
           doPlayerSendCancel(cid, "Sorry, not possible.")
       end

       return true
    end

    me sale esto
    (LuaInterface::luaDoItemSetAttribute) Value for protected key "uid" must be in range of 1000 to 65535
    alguien tiene una solucion




    bumm

    5 participantes

    Contenido patrocinado


    5 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).