esse sistema de owner do MatheusMkalo é praticamente uma função, ou seja você faz uma quest e poem essa função ela adicionar o Nome do Player no item, até
[Pedido] Sistema De Owner Para Equips (Só Para Items Vip)
Por cs007, 01 de abr. de 2012 em Scripts
info
Grupo: Herói
Registrado: 12/03/11
Posts: 1.9k
Reputação: +284
Gênero: Masculino
Char no Tibia: Nokte

info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

Uhm =/ Não tem como dar uma modificada para quando receber o item do shop é só essa pessoa pode usar?
Ninguém sabe se pode fazer algum tipo de modificação? valeu
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

Uma dica que te dou é usar esse sisteminha:
http://www.xtibia.co...p-items-system/
Assim apenas vips poderão usar armas vips.
E me passa o teu globalevent que receber o item do site que eu tento adaptar com o script de owner.
Editado Abril 3 por Jhon992
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

Não é só para VIPs usar as armas é sim somente que fez a doação.
=)
shop.lua
-- FIXED BY Cybermaster && Kekox © OTLand.net
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
action = tostring(result_plr:getDataString("action"))
delete = tonumber(result_plr:getDataInt("delete_it"))
cid = getCreatureByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(result_plr:getDataInt("param3"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param1"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(container_id, itemtogive_count)
if isItemRune(container_id) == TRUE then
full_weight = getItemWeightById(container_id, 1)
else
full_weight = getItemWeightById(container_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(container_id, itemtogive_count)
doItemSetAttribute(new_item, "description", "This item can only be used by the player ".. getPlayerName(cid) .."!")
doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
doPlayerSave(cid, true)
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Shop.')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Prison Break Shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Spider shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return TRUE
end
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

Primeiro implementa o sistema de owner do @Mateus.
Depois troca esse seu código por este:
-- FIXED BY Cybermaster && Kekox © OTLand.net
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
action = tostring(result_plr:getDataString("action"))
delete = tonumber(result_plr:getDataInt("delete_it"))
cid = getCreatureByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) == TRUE then
local itemtogive_id = tonumber(result_plr:getDataInt("param3"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local container_id = tonumber(result_plr:getDataInt("param1"))
local container_count = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local received_item = 0
local full_weight = 0
if add_item_type == 'container' then
container_weight = getItemWeightById(container_id, 1)
if isItemRune(itemtogive_id) == TRUE then
items_weight = container_count * getItemWeightById(itemtogive_id, 1)
else
items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
end
full_weight = items_weight + container_weight
else
full_weight = getItemWeightById(container_id, itemtogive_count)
if isItemRune(container_id) == TRUE then
full_weight = getItemWeightById(container_id, 1)
else
full_weight = getItemWeightById(container_id, itemtogive_count)
end
end
local free_cap = getPlayerFreeCap(cid)
if full_weight <= free_cap then
if add_item_type == 'container' then
local new_container = doCreateItemEx(container_id, 1)
local iter = 0
while iter ~= container_count do
doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
iter = iter + 1
end
received_item = doPlayerAddItemEx(cid, new_container)
else
local new_item = doCreateItemEx(container_id, itemtogive_count)
received_item = doPlayerAddItemEx(cid, new_item)
end
if received_item == RETURNVALUE_NOERROR then
setItemOwner(received_item, cid)
doPlayerSave(cid, true)
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Shop.')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Prison Break Shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from Spider shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return TRUE
en
Fais um backup antes, pq eu não testei.
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

Oks veio vou testar e hoje ainda dou a resposta se funcionou. valeu
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

Veio nem funcionou e ainda ficou entregando o item varias vezes sem parar x,x te como arrumar? valeu =)
Ninguém?
Quando o item do shop chega ele da erro na lib mas não na linha que eu adicionei a função mas em outra linha e fica entregando o item varias vezes...aaaah até com quest ele da esse erro creio que o problema sejá na lib
Editado Abril 15 por cs007
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

Alguém ajuda? não e nada de mais para quem sabe de scripts;
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

Dei uma olhada novamente e ao meu ver era pra estar funcionando perfeitamente. Qual erro aparece no executavel do ot?
info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera

Quando liga não da erro só da erro no aquivo 050-functions Só que o erro não foi na linha que fui adicionado a função(estou sem o ot para testar aqui) é ele ficou entregando o item varias vezes. vou ver se coloco o server no meu pc dinovo. valeu
Erro e nessa linha.
na function
return getItemDescriptions(uid).name
Editado Abril 26 por cs007


info
Grupo: Conde
Registrado: 10/07/08
Posts: 574
Reputação: +13
Gênero: Masculino
Char no Tibia: Hebi Of Amera
Olá pessoal eu achei um sistema de owner para equipes do MatheusMkalo, tem como passar esse mod só para determinados items? valeu
Link