Jump to content

If I click to the safe object then.....


thund3rbird23

Recommended Posts

I want to do that if I click to the safe(2332) object then showing up the safe's inventory.

With the player and the vehicle element's are working.
 

if itemsTableState == "player" then
		tabStartX = drawCategoryTab(tabStartX, tabStartY, "main", "bag", "Bag")
		tabStartX = drawCategoryTab(tabStartX + sizeForTabs, tabStartY, "keys", "key", "Keys")
		tabStartX = drawCategoryTab(tabStartX + sizeForTabs, tabStartY, "papers", "wallet", "Papers")
	elseif itemsTableState == "vehicle" then
		tabStartX = drawCategoryTab(tabStartX, tabStartY, "main", "vehicle", "Trunk")
	elseif itemsTableState == "object" then
		tabStartX = drawCategoryTab(tabStartX, tabStartY, "main", "safe", "Safe")
	end

 

 

Link to comment

Presumably you have a line that goes something like this

local itemsTableState = getElementType(unknown_variable)

well, you need to add

local clickedElementModel = getElementModel(unknown_variable)

and then

elseif itemsTableState == "object" then
  if clickedElementModel == 2332 then -- if the element model is a safe
    tabStartX = drawCategoryTab(tabStartX, tabStartY, "main", "safe", "Safe")
  end
end

But you haven't provided enough lines for me to know what is the name of the variable storing the clicked element, so I've named it unknown_variable here.

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