Jump to content

[HELP]Boolean value


denizxd

Recommended Posts

server.lua:48: attempt to concatenate local 'model' (a boolean value)

i couldn't succeed.. help mee

function sVergiGUI(thePlayer)
	if thePlayer then
		source = thePlayer
	end
	local playerID = getElementData(source, "dbid")
	local factID = getElementData(source, "faction")
	local result = exports.mysql:query("SELECT * FROM vehicles WHERE owner = '"..playerID.."' AND deleted=0")
	local playerVehs = {}
	while true do
		local row = exports.mysql:fetch_assoc(result)
		if not row then break end
		local vehicle = exports.pool:getElement("vehicle", row.id)
		local brand = getElementData(vehicle, "vehbrand")
		local model = getElementData(vehicle, "vehmodel")
		local year = getElementData(vehicle, "vehyear")
		local vergi = getElementData(vehicle, "toplamvergi") or 0
		table.insert(playerVehs, { row.id, year.." "..brand.." "..model , tonumber(vergi) })
		triggerClientEvent(source, "vergi:VergiGUI", source, playerVehs)
	end
	triggerClientEvent(source, "vergi:VergiGUI", source, playerVehs)
	exports.mysql:free_result(result)
end
addEvent("vergi:sVergiGUI", true)
addEventHandler("vergi:sVergiGUI", root, sVergiGUI)

 

Link to comment
  • Moderators
2 hours ago, SpecT said:

Maybe it's something from the database part.

Maybe you could get the model from the database instead, since you already fetched the vehicle data. But that only works correctly if the database is up to date.
It could become de-synced if:

  • the vehicle model can be changed for the same ID
  • AND the database does not receive an update after every elementdata change.

 

Edited by IIYAMA
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...