Jump to content

Problem with table.


Rat32

Recommended Posts

Posted
tablicapremii = {"Roadtrain", "Tanker", "Linerunner"} 
czypremiakon = getVehicleName(czypremia) 
if getVehicleName(czypremia) == tablicapremii then 
givePlayerMoney(client, 10000) 
  

Why this "if" not read the "tablicapremii" table? Please help :).

Posted
if tablicapremii[czypremiakon] then 

Edit:_ not sure about above thing

Try looping through table and compare value with czy thing like

for i,value in pairs(tablicapremii) do 
if value == czypremiakon then 
    -- your code of money here 
  

Posted
tablicapremii = { 
["Roadtrain"] = true,  
["Tanker"] = true,  
["Linerunner"] = true, 
}  
  
czypremiakon = getVehicleName(czypremia) 
if tablicapremii[czypremiakon] then 
givePlayerMoney(client, 10000) 

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