VictorOtInfinit
Member
- Joined
- Mar 14, 2020
- Messages
- 139
- Solutions
- 3
- Reaction score
- 11
I need to get all Tibia Coins that we have in the server and save in one variable, how i do that?
I tryed:
Got this error:
Also tryed:
Got this error. Why god is so hard to get a simple data information from database in lua?
I tryed:
Lua:
local allCoins = db.storeQuery("SELECT `coins` FROM `accounts` LIMIT 0;")
doPlayerPopupFYI(cid, "total coins: ".. allCoins.."")
Also tryed:
Code:
function onSay(cid, words, param)
local allCoins = db.storeQuery("SELECT `coins` FROM `accounts` LIMIT 9999;")
local list = {}
if allCoins:getID() == -1 then
return true
end
repeat
local coins = allCoins:getDataString("coins")
table.insert(list, coins)
until not allCoins:next()
doPlayerPopupFYI(cid, "total coins: ".. table.concat(list,"\n") .."")
end
Got this error. Why god is so hard to get a simple data information from database in lua?
Attachments
-
1607353339859.png13.6 KB · Views: 0 · VirusTotal