Ir para conteúdo
  • 0

Pergunta

To com um grande problema no shop do meu Gesior acc

 

Eu coloco os itens pra comprar no shop mas quando eu compro eles com um player de teste

os itens não vão para o player nem pro dp dele. Mas quando eu pago pra mudar o nome

o nome muda sem erro nenhum alguém pode me ajudar?

Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/
Compartilhar em outros sites

13 respostass a esta questão

Posts Recomendados

  • 0

Olá amigo, tente trocar o seu globalevent por essa:

 

globalevents.xml adicione:
<globalevent name="shop" interval="30000" event="script" value="shop.lua"/>
Crie em globalevents/scripts um arquivo chamado shop.lua
function doPlayerAddDepotItems(cid, items, town)
if (not isPlayer(cid)) then
error("Player not found")
end
local town = town or getPlayerTown(cid)


local parcel = doCreateItemEx(ITEM_PARCEL)
for item, count in pairs(items) do
if (type(item) == "number") then
local attritemid = doAddContainerItem(parcel, item, count)
doItemSetAttribute(attritemid, "description", "This item belongs to ".. getPlayerName(cid) ..".")
doItemSetAttribute(attritemid, "aid", getPlayerGUID(cid)+10000)
elseif (type(item) == "string") then
doAddContainerItem(parcel, getItemIdByName(item), count)
else
error("Undefinied type of item name")
end
end


return doPlayerSendMailByName(getCreatureName(cid), parcel, town) 
end


function onThink(interval, lastExecution, thinkInterval)


local result = db.getResult("SELECT * FROM shop_history WHERE `processed` = 0;")


if(result:getID() ~= -1) then
while(true) do
cid = getCreatureByName(tostring(result:getDataString("player")))
product = tonumber(result:getDataInt("product"))
itemr = db.getResult("SELECT * FROM shop_offer WHERE `id` = "..product..";")
if isPlayer(cid) then
local id = tonumber(itemr:getDataInt("item"))
local tid = tonumber(result:getDataInt("id"))
local count = tonumber(itemr:getDataInt("count"))
local tipe = tonumber(itemr:getDataInt("type"))
local productn = tostring(itemr:getDataString("name"))
if isInArray({5,8},tipe) then
if getPlayerFreeCap(cid) >= getItemWeightById(id, count) then
if isPlayer(cid) then
received = doPlayerAddDepotItems(cid, {[id]=count})
if received then
doPlayerSendTextMessage(cid,19, "You received "..productn.." in depot of your hometown.")
db.executeQuery("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";")
doPlayerSave(cid)
else
doPlayerSendTextMessage(cid,19, "You need a free slot on container to receive "..productn..".")
end
else
doPlayerSendTextMessage(cid,19, "You need a free container to receive "..productn..".")
end
else
doPlayerSendTextMessage(cid,19, "You need "..getItemWeightById(id, count).." of free capacity to receive "..productn..".")
end
elseif isInArray({6,7},tipe) then
if tipe == 6 then
bcap = 8
bid = 1987
elseif tipe == 7 then
bcap = 20
bid = 1988
end
if isItemRune(id) then
count = 1
end
if getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) then
local bag = doCreateItemEx(bid, 1)
for i = 1,bcap do
doAddContainerItem(bag, id, count)
end
received = doPlayerAddDepotItems(cid, bag)
if received == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid,19, "You received "..productn.." in depot of your hometown.")
db.executeQuery("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";")
doPlayerSave(cid)
else
doPlayerSendTextMessage(cid,19, "You need a free slot on container to receive "..productn..".")
end
else
doPlayerSendTextMessage(cid,19, "You need "..getItemWeightById(id, count).." of free capacity to receive "..productn..".")
end
end
end
itemr:free()
if not(result:next()) then
break
end
end
result:free()
end
return true
end
Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560727
Compartilhar em outros sites

  • 0

Deu esse erro cara

 

  Citar

[12/09/2013 00:31:47] [Error - GlobalEvents::think] Couldn't execute event: saveplayer
[12/09/2013 00:31:47] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Table 'otserv.shop_history' doesn't exist (1146)
Editado por koete
Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560729
Compartilhar em outros sites

  • 0

Execute os seguintes comandos no seu phpmyadmin:

 

CREATE TABLE `shop_history`
(
`id` int(11) NOT NULL auto_increment,
`to_name` varchar(255) NOT NULL default '0',
`to_account` int(11) NOT NULL default '0',
`from_nick` varchar(255) NOT NULL,
`from_account` int(11) NOT NULL default '0',
`price` int(11) NOT NULL default '0',
`offer_id` int(11) NOT NULL default '0',
`trans_state` varchar(255) NOT NULL,
`trans_start` int(11) NOT NULL default '0',
`trans_real` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
);

 

 

 

------

 

 

 

ALTER TABLE `shop_history` ADD `processed` int(11) NOT NULL default '0';

 

 

 

 

Espero ter ajudado!

Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560732
Compartilhar em outros sites

  • 0

Bom Eu Uso Gesior Ja fiz esse procedimento Uso tfs 4.0 é nada acontece.

 

 

  Mostrar conteúdo oculto

Editado por EduziTow
Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560750
Compartilhar em outros sites

  • 0

este erro fica dando a cada 30 segundos (tempo que eu configurei no script do Avuenja mostrado ali em cima

[12/09/2013 12:14:05] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:14:12] mysql_real_query(): SELECT `pid`, `sid`, `itemtype`, `count`, `attributes` FROM `player_depotitems` WHERE `player_id` = 13 ORDER BY `sid` DESC - MYSQL ERROR: Incorrect key file for table '.\otserv\player_depotitems.MYI'; try to repair it (126)
[12/09/2013 12:14:12] mysql_store_result(): SELECT `key`, `value` FROM `player_storage` WHERE `player_id` = 13 - MYSQL ERROR: Table 'player_storage' is marked as crashed and should be repaired (1194)
[12/09/2013 12:14:12] Koete has logged in.
[12/09/2013 12:14:36] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:15:07] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:15:38] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:16:09] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:16:40] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:17:11] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:17:42] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:18:13] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:18:44] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:19:15] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
[12/09/2013 12:19:46] mysql_real_query(): SELECT * FROM shop_history WHERE `processed` = 0; - MYSQL ERROR: Unknown column 'processed' in 'where clause' (1054)
 
Já ete erro acontece quando eu clico em "Trans. Histori" no site











Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'otserv.pagsegurotransacoes' doesn't exist' in C:\xampp\htdocs\www\history.php:39 Stack trace: #0 C:\xampp\htdocs\www\history.php(39): PDO->query('SELECT * FROM `...') #1 C:\xampp\htdocs\www\index.php(111): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\www\history.php on line 39
Editado por koete
Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560789
Compartilhar em outros sites

  • 0

Tenta essa script em shop.lua no 'globalevents'

Shop.lua

  Mostrar conteúdo oculto



Globalevents.xml

  Mostrar conteúdo oculto



Testa ae!

Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560808
Compartilhar em outros sites

  • 0

ta dando esse error olha

 

 

  Mostrar conteúdo oculto

 

Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1560969
Compartilhar em outros sites

  • 0

continua com o erro


Resolvi o Problema

 

 

  Mostrar conteúdo oculto

 

 

 

no meu caso foi isso

 

vou dar REP

pra quem mais me ajudou

 

luanluciano93

que sempre me ajuda em minhas duvidas

 

e

 

Avuenja

por ter disponibilizar seu tempo para socorrer minha duvida mais vezes.

Editado por koete
Link para o comentário
https://xtibia.com/forum/topic/220946-shop-gesior/#findComment-1561051
Compartilhar em outros sites

×
×
  • Criar Novo...