TFS 1.1+ shop talkaction fix by @kushovu Fix #200

This commit is contained in:
Znote 2016-10-24 01:37:31 +02:00
parent 21e0de50b4
commit ee11674450

View File

@ -1,8 +1,7 @@
-- Znote Shop v1.0 for Znote AAC on TFS 1.0+. -- Znote Shop v1.0 for Znote AAC on TFS 1.1
function onSay(cid, words, param) function onSay(player, words, param)
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks. local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
local cooldown = 15 -- in seconds. local cooldown = 15 -- in seconds.
local player = Player(cid)
if player:getStorageValue(storage) <= os.time() then if player:getStorageValue(storage) <= os.time() then
player:setStorageValue(storage, os.time() + cooldown) player:setStorageValue(storage, os.time() + cooldown)
@ -13,10 +12,10 @@ function onSay(cid, words, param)
-- Detect if we got any results -- Detect if we got any results
if orderQuery ~= false then if orderQuery ~= false then
-- Fetch order values -- Fetch order values
local q_id = result.getDataInt(orderQuery, "id") local q_id = result.getNumber(orderQuery, "id")
local q_type = result.getDataInt(orderQuery, "type") local q_type = result.getNumber(orderQuery, "type")
local q_itemid = result.getDataInt(orderQuery, "itemid") local q_itemid = result.getNumber(orderQuery, "itemid")
local q_count = result.getDataInt(orderQuery, "count") local q_count = result.getNumber(orderQuery, "count")
result.free(orderQuery) result.free(orderQuery)
-- ORDER TYPE 1 (Regular item shop products) -- ORDER TYPE 1 (Regular item shop products)