Jump to content

teamTable question


Bean666

Recommended Posts

Posted

how do i use getTeamFromName using tables

thanks in advance

local teams = { 
"Military", 
"FIB", 
"SWAT" 
} 
  
local theTeam = getTeamFromName("??") 
  

Aftermath

Posted

check this:

--Example 1: 
  
local teams = { 
  ["Team1"] = teamName1; 
  ["Team2"] = teamName2; 
} 
  
-- then you can use this to get the team from name 
local theTeam = getTeamFromName(teams["Team1"]) 
  
-- Example 2 
local teams = { 
  team1 = teamName1; 
  team2 = teamName2; 
} 
  
-- and you can use this to get the team from name 
local theTeam = getTeamFromName(teams.team1) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Or you can use this

teama = teams[1] --- Switch out 1 with the number you want as long as its in range in the table. 

But after looking at what you want, other guys solution would work better I believe.

Wolf Inc Discord

Youtube channel
Github

Posted

actually what i want is not like this

what i wanted is all the stuff on the table not 1 2 3 stuff or maybe i just missed something , but yeah ill try something / learn on my own

Aftermath

Posted

That sets up the table.

Table = {} -- Creates an empty table 
  
Table[1] = "Test" -- Assigns a value to the table 
  
function test () 
local tablea = Table[2] -- Turns value #2 into a local table 
local tablea[1] = "test" -- Assigns a value to the table 
local tableb = tablea[1] -- Deeper table.  
  
--- And so on  

Wolf Inc Discord

Youtube channel
Github

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