Jump to content

Text


xRGamingx

Recommended Posts

How can I put a text in the middle of this list of cars?

I think I'm putting the wrong text --Level1 and Level2

---I need to put this name, Example: 

carshopWindow = guiCreateWindow(0.01, 0.22, 0.39, 0.58, "CarShop", true)
guiSetVisible(carshopWindow, false)
guiSetAlpha(carshopWindow, 1)
guiWindowSetSizable(carshopWindow, false)
carGridList = guiCreateGridList(0.02, 0.06, 0.47, 0.80, true, carshopWindow)
guiGridListSetSelectionMode(carGridList, 0)
carColumn = guiGridListAddColumn(carGridList, "Car", 0.4)
costColumn = guiGridListAddColumn(carGridList, "$", 0.4)


local cars = {
{"Level1"} ------------------TEXT TEX
  {481, 50000},-- BMX  
  {509, 50000},-- bike
  {529, 55000},-- Willard
  {492, 60000},-- Gleenwood
{"Level2"} ------------------TEXT TEX
  {421, 60000},-- Whasington 
  {466, 65000},-- Glendale
  {422, 65000},-- Bobcat
  {600, 70000},-- Picador
  {578, 70000},-- DFT-30
  {582, 70000},-- Newsvan
  {410, 71000},-- Manana
  {489, 75000},-- Rancher  
  {474, 75000},-- Hermes
  {491, 75000} -- Virgo

 

Link to comment
carshopWindow = guiCreateWindow(0.01, 0.22, 0.39, 0.58, "CarShop", true)
guiSetVisible(carshopWindow, false)
guiSetAlpha(carshopWindow, 1)
guiWindowSetSizable(carshopWindow, false)
carGridList = guiCreateGridList(0.02, 0.06, 0.47, 0.80, true, carshopWindow)
guiGridListSetSelectionMode(carGridList, 0)
carColumn = guiGridListAddColumn(carGridList, "Car", 0.4)
costColumn = guiGridListAddColumn(carGridList, "$", 0.4)


local cars = {
	["Level1"] = { ------------------TEXT TEX
		{481, 50000},-- BMX  
		{509, 50000},-- bike
		{529, 55000},-- Willard
		{492, 60000},-- Gleenwood
	},  
	["Level2"] = { ------------------TEXT TEX
		{421, 60000},-- Whasington 
		{466, 65000},-- Glendale
		{422, 65000},-- Bobcat
		{600, 70000},-- Picador
		{578, 70000},-- DFT-30
		{582, 70000},-- Newsvan
		{410, 71000},-- Manana
		{489, 75000},-- Rancher  
		{474, 75000},-- Hermes
		{491, 75000}, -- Virgo
	},
}  

function setTexts()
	for i,v in pairs(cars) do
		local row = guiGridListAddRow(carGridList)
		guiGridListSetItemText(carGridList,row,1,i,true,false)
		for i,k in pairs(v) do
			local model,price = unpack(k)
			local row2 = guiGridListAddRow(carGridList)
			guiGridListSetItemText(carGridList,row2,1,getVehicleNameFromModel(model),false,false)
			guiGridListSetItemText(carGridList,row2,2,price,false,false)
		end
	end
end	
setTexts()

 

Link to comment
9 hours ago, Mahlukat said:

carshopWindow = guiCreateWindow(0.01, 0.22, 0.39, 0.58, "CarShop", true)
guiSetVisible(carshopWindow, false)
guiSetAlpha(carshopWindow, 1)
guiWindowSetSizable(carshopWindow, false)
carGridList = guiCreateGridList(0.02, 0.06, 0.47, 0.80, true, carshopWindow)
guiGridListSetSelectionMode(carGridList, 0)
carColumn = guiGridListAddColumn(carGridList, "Car", 0.4)
costColumn = guiGridListAddColumn(carGridList, "$", 0.4)


local cars = {
	["Level1"] = { ------------------TEXT TEX
		{481, 50000},-- BMX  
		{509, 50000},-- bike
		{529, 55000},-- Willard
		{492, 60000},-- Gleenwood
	},  
	["Level2"] = { ------------------TEXT TEX
		{421, 60000},-- Whasington 
		{466, 65000},-- Glendale
		{422, 65000},-- Bobcat
		{600, 70000},-- Picador
		{578, 70000},-- DFT-30
		{582, 70000},-- Newsvan
		{410, 71000},-- Manana
		{489, 75000},-- Rancher  
		{474, 75000},-- Hermes
		{491, 75000}, -- Virgo
	},
}  

function setTexts()
	for i,v in pairs(cars) do
		local row = guiGridListAddRow(carGridList)
		guiGridListSetItemText(carGridList,row,1,i,true,false)
		for i,k in pairs(v) do
			local model,price = unpack(k)
			local row2 = guiGridListAddRow(carGridList)
			guiGridListSetItemText(carGridList,row2,1,getVehicleNameFromModel(model),false,false)
			guiGridListSetItemText(carGridList,row2,2,price,false,false)
		end
	end
end	
setTexts()

 

Look My code 

carshopWindow = guiCreateWindow(0.01, 0.22, 0.39, 0.58, "CarShop", true)
guiSetVisible(carshopWindow, false)
guiSetAlpha(carshopWindow, 1)
guiWindowSetSizable(carshopWindow, false)
carGridList = guiCreateGridList(0.02, 0.06, 0.47, 0.80, true, carshopWindow)
guiGridListSetSelectionMode(carGridList, 0)
carColumn = guiGridListAddColumn(carGridList, "Car", 0.4)
costColumn = guiGridListAddColumn(carGridList, "$", 0.4)
local cars = {
  ["Level1"] = { ------------------TEXT TEX ERROR ..
  {481, 50000},-- BMX  
  {509, 50000},-- bike
  {529, 55000},-- Willard
  {492, 60000},-- Gleenwood
  {421, 60000},-- Whasington 
  {466, 65000},-- Glendale
  {422, 65000},-- Bobcat
  {600, 70000},-- Picador
  {578, 70000},-- DFT-30
  {582, 70000},-- Newsvan
  {410, 71000},-- Manana
  {489, 75000},-- Rancher  
  {474, 75000},-- Hermes
}
for i, v in ipairs(cars) do
  local carName = getVehicleNameFromModel(v[1])
  local row = guiGridListAddRow(carGridList)
  guiGridListSetItemText(carGridList, row, 1, carName, false, true)
  guiGridListSetItemText(carGridList, row, 2, tostring(v[2]), false, true)
end

 

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