From ee116744508106f71f71ed7d0472907771c40c30 Mon Sep 17 00:00:00 2001 From: Znote Date: Mon, 24 Oct 2016 01:37:31 +0200 Subject: [PATCH] TFS 1.1+ shop talkaction fix by @kushovu Fix #200 --- LUA/TFS_10/talkaction shopsystem/znoteshop.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/LUA/TFS_10/talkaction shopsystem/znoteshop.lua b/LUA/TFS_10/talkaction shopsystem/znoteshop.lua index ef0342a..32b24d3 100644 --- a/LUA/TFS_10/talkaction shopsystem/znoteshop.lua +++ b/LUA/TFS_10/talkaction shopsystem/znoteshop.lua @@ -1,8 +1,7 @@ --- Znote Shop v1.0 for Znote AAC on TFS 1.0+. -function onSay(cid, words, param) +-- Znote Shop v1.0 for Znote AAC on TFS 1.1 +function onSay(player, words, param) local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks. local cooldown = 15 -- in seconds. - local player = Player(cid) if player:getStorageValue(storage) <= os.time() then player:setStorageValue(storage, os.time() + cooldown) @@ -13,10 +12,10 @@ function onSay(cid, words, param) -- Detect if we got any results if orderQuery ~= false then -- Fetch order values - local q_id = result.getDataInt(orderQuery, "id") - local q_type = result.getDataInt(orderQuery, "type") - local q_itemid = result.getDataInt(orderQuery, "itemid") - local q_count = result.getDataInt(orderQuery, "count") + local q_id = result.getNumber(orderQuery, "id") + local q_type = result.getNumber(orderQuery, "type") + local q_itemid = result.getNumber(orderQuery, "itemid") + local q_count = result.getNumber(orderQuery, "count") result.free(orderQuery) -- ORDER TYPE 1 (Regular item shop products) @@ -43,4 +42,4 @@ function onSay(cid, words, param) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. player:getStorageValue(storage) - os.time()) end return false -end +end \ No newline at end of file