Jump to content

ERROR


yToPzz

Recommended Posts

ERROR: mod\server\gui.lua:26: bad argument #1 to 'pairs' (table expected, got boolean)

 

function syncObjects (player)
	if isPedInVehicle (player) then 
		local vehicle = getPedOccupiedVehicle(player);
		for i, v in pairs (getVehicleOccupants(vehicle)) do ---- line 26
			triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle));
		end	
	end	
end

 

Link to comment
7 hours ago, yToPzz said:

ERROR: mod\server\gui.lua:26: bad argument #1 to 'pairs' (table expected, got boolean)

 

function syncObjects (player)
	if isPedInVehicle (player) then 
		local vehicle = getPedOccupiedVehicle(player);
		for i, v in pairs (getVehicleOccupants(vehicle)) do ---- line 26
			triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle));
		end	
	end	
end

 

function syncObjects (player)
	local vehicle = getPedOccupiedVehicle(player);
	if vehicle then
    	local occupants = getVehicleOccupants(vehicle)
    	if occupants then
          for i, v in pairs (occupants) do
              triggerLatentClientEvent (v, "tune.sync_objects", resourceRoot, getVehicleName (vehicle),getVehicleObjects(vehicle))
          end
      	end
	end	
end

Try this

Edited by AngelAlpha
  • Like 1
  • Thanks 1
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...