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

[Lua + SQL] Return value from player (solved)

StormRusher

New Member
Joined
Dec 23, 2009
Messages
138
Reaction score
0
Well i need a function to return the value of one column of SQLite, for example "test"

I wanna make a script to check if player has the value 1 or 0, then do action

Thanks
 
Last edited:
Code:
function getTest(cid)
	if isPlayer(cid) then
		local query = db.getResult("SELECT `test` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
		if(query:getID() ~= -1) then
			local ret = query:getDataInt("test")
			query:free()
			return ret
		end
	end
	return false
end
 
Back
Top