• 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!

Solved How to insert db.query on function in talkactions?

Gilleady Daboit

New Member
Joined
Sep 5, 2016
Messages
2
Reaction score
0
Hi guys,

I need to run a talkaction is made an update on the table players, set cast = 1.

I tried as follow, but not work.


function onSay(player, words, param)
if param == "on" then param = nil end

if player:startLiveCast(param) then
db.query("UPDATE `players` SET `cast` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
player:sendTextMessage(MESSAGE_INFO_DESCR, "Você iniciou o Cast System, agora todos podem te assistir. Comandos: !spectators - !stopcast")
else
player:sendCancelMessage("Você já iniciou o Cast System.")
end
return false
end


Message in tfs: attempt to concatenate a boolean value stack traceback

Can someone help me please? Thanks!!!
 
post the full error of the TFS

maybe use
db.query("UPDATE `players` SET `cast` = '0' WHERE `id` = (" .. getPlayerGUID(cid)) .. ") ;")

missing " )"
 
Back
Top