• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Need some help with this shop script!!

Hanozy

~HanoZy
Joined
Mar 25, 2015
Messages
39
Reaction score
1
Location
Sweden
Hey, I am trying to use the Znote Shop talkaction script with my shopsystem (Geisor)
I am getting this error message on my server:

mysql_real_query(): SELECT `id`, `type`, `param1`, `param2` FROM `z_ots_comunica
tion` WHERE `name` = Sorisonta - MYSQL ERROR: Unknown column 'Test' in 'where clause' (1054)


Here is the script!

-- Znote Shop v1.0 for Znote AAC on TFS 0.3.6+ Crying Damson.
function onSay(cid, words, param)
local storage = 54073 -- Make sure to select non-used storage. This is used to prevent SQL load attacks.
local cooldown = 1 -- in seconds.

if getPlayerStorageValue(cid, storage) <= os.time() then
setPlayerStorageValue(cid, storage, os.time() + cooldown)
local accid = getCreatureName(cid)

-- Create the query
local orderQuery = db.storeQuery("SELECT `id`, `type`, `param1`, `param2` FROM `z_ots_comunication` WHERE `name` = " .. accid .. " ")

-- 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, "param1")
local q_count = result.getDataInt(orderQuery, "param2")
result.free(orderQuery)
-- ORDER TYPE 1 (Regular item shop products)
if q_type == 1 then
-- Get wheight
local playerCap = getPlayerFreeCap(cid)
local itemweight = getItemWeightById(q_itemid, q_count)
if playerCap >= itemweight and getTileInfo(getCreaturePosition(cid)).protection then
--backpack check
local backpack = getPlayerSlotItem(cid, 3)
local gotItem = false
if(backpack and backpack.itemid > 0) then
local received = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, q_itemid,q_count)
if(received ~= false) then
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. q_id .. ";")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have recieved ".. q_count .." "..getItemNameById(q_itemid).."(s)!")
gotItem = true
end
end

if(not gotItem) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no available space in backpack to receive that item.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Need more CAP and Protectzone!")
end
end
-- Add custom order types here
-- Type 2 is reserved for premium days and is handled on website, not needed here.
-- Type 3 is reserved for character gender(sex) change and is handled on website as well.
-- So use type 4+ for custom stuff, like etc packages.
-- if q_type == 4 then
-- end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You have no orders.")
end

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Can only be executed once every "..cooldown.." seconds. Remaining cooldown: ".. getPlayerStorageValue(cid, storage) - os.time())
end
return false
end

I can't get this problem solved, can someone help me out?

Thanks!!
 
mysql_real_query(): SELECT `id`, `type`, `param1`, `param2` FROM `z_ots_comunica
tion` WHERE `name` = Sorisonta - MYSQL ERROR: Unknown column 'Test' in 'where clause' (1054)
The error makes no sense since you don't have a 'Test' column in your query... Are you sure you haven't modified this?
What does your table 'z_ots_comunication' look like?
 
Back
Top