Jump to content

table expected got string


Best-Killer

Recommended Posts

function creatMarkerSystem()
	local GetAllMarker = exports.NGSQL:db_query ( "SELECT * FROM marker_system " )
	if ( type ( GetAllMarker ) == "table" and #GetAllMarker > 0 ) then
		for i = 1, #GetAllMarker do
		    local n = {GetAllMarker[i]["Name"], GetAllMarker[i]["posX"], GetAllMarker[i]["posY"], GetAllMarker[i]["posZ"], GetAllMarker[i]["Alpha"], GetAllMarker[i]["Color"], GetAllMarker[i]["Vehicles"], GetAllMarker[i]["Rotation"], GetAllMarker[i]["Data"]}
            for ii = 1, #n do n[ ii ] = tostring( n[ ii ] ) end
		    color = fromJSON(n[6])
			local marker = createMarker( n[2], n[3], n[4]-1, 'cylinder', 1.25, color[1], color[2], color[3], 255 )
			if marker then
            markers[marker] = {n[1], n[7], n[8], n[9], n[10]}
			addEventHandler("onMarkerHit", marker, onSpawnerMarkerHit)
			setElementData(marker, 'id', i )
            setElementData(marker,"teamMarker",true)	
  		end
	end
end
end


function onSpawnerMarkerHit(hitPlayer, matchingDimension)
if not matchingDimension then return end
if getElementType(hitPlayer) == "player" then
if isPedInVehicle(hitPlayer) then return end
local team = getElementData(source,"teamMarker")
if not team then return end
local tName = getElementData(hitPlayer,tostring(markers[source][4]))
if not tName then return end
for i,v in pairs(markers[source][1]) do
if v == tName then
triggerClientEvent(hitPlayer,"showvehicle",hitPlayer,markers[source][2],source)
      end
    end
  end
end

Line 28

Edited by Best-Killer
Worng line
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...