Jump to content

[HELP] Table


Recommended Posts

On 01/05/2019 at 18:42, NX_CI said:

local pos={
  	-- {x,y,z}
	{3.44,10.433,12.2},
	{6.11,21.29,15.1},
};


for key, values in ipairs(pos) do
	outputChatBox("X: ("..values[1]..") Y: ("..values[2]..") Z: ("..values[3]..")");
end

 

Not work !

I want table for open the gui panel in my position !

Link to comment
local positions={
	{fX,fY,fWidth,fHeight}, -- positions
	{fX,fY,fWidth,fHeight}, -- positions
	{fX,fY,fWidth,fHeight}, -- positions
};


local colshape={};

for k, v in ipairs(positions) do
	local x,y,width,height=v[1],v[2],v[3],v[4]
	colshape[#colshape+1]=createColRectangle(x,y,width,height); -- colshape[key] = new col rectangle
end


addEventHandler("onClientColShapeHit",root,
	function(hitElement)
		if hitElement==localPlayer then
			for i=1,#colshape do -- loop for the colshapes table ( i = 1 to count of colshapes )
				if colshape[i]==source then -- check the source colshape if it equals any colshape in the table of colshapes
					-- Your code
				end
			end
		end
	end
);

 

  • Like 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...