someone can help me?, i have a znote acc converted for avesta but the shop dont found properly, for the shop i have that npc
but when i say for example
ganjita:boots of haste
npc:Sorry, but you are not allowed to buy equipments with me.
how i can repair that?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
local accid = getAccountNumberByPlayerName(getPlayerName(cid))
local orderQuery = mysqlQuery("SELECT `points` FROM `znote_accounts` WHERE `account_id` = ".. accid .." LIMIT 1;", "points")
local shop_points = getNumberValue(orderQuery.points)
if msgcontains(msg, "list") then
npcHandler:say("Here you are.")
doShowTextDialog(cid, 2195, "** Shop List **\n\nBoots of Haste [20 points]\nSoft Boots [50 points]")
elseif msgcontains(msg, "boots of haste") then
npcHandler:say('Do you want to buy 1 boots of haste for 20 points?')
pontos = 20
item_id = 2195
quant = 1
topic = 1
elseif msgcontains(msg, "soft boots") then
npcHandler:say('Do you want to buy 1 soft boots for 50 points?')
pontos = 50
item_id = 2640
quant = 1
topic = 1
end
-- Confirm Yes or No
if topic == 1 and msgcontains(msg, "yes") then
if shop_points > 0 then
npcHandler:say("Enjoy it young adventurer!")
doPlayerAddItem(cid, item_id, quant)
mysqlQuery("UPDATE `znote_accounts` SET `points` = ".. shop_points - pontos .." WHERE `account_id` = ".. accid .." LIMIT 1;", "UPDATE")
topic = 0
else
npcHandler:say('You do not have enough points!')
topic = 0
end
else
npcHandler:say("Sorry, but you are not allowed to buy equipments with me.")
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
but when i say for example
ganjita:boots of haste
npc:Sorry, but you are not allowed to buy equipments with me.
how i can repair that?