• Vehicle List Woes
    1 replies, posted
So I have this function which stores car names in a database. I use list.get to get the name of the vehicle by its model like so: [code] local modelOfCar = hitEnt:GetModel() for k, v in pairs (list.Get("Vehicles")) do if (modelOfCar == v.Model) then print("Found!") nameOfCar = v.Name end end [/code] Thing is, the model of the car IS in the list.Get("Vehicles") table (I printed the table out before the for loop to see what was in there and I found it multiple times) unyet, for some reason my if statement doesnt respond to it at all. Like I have said, I have printed out v.Model and modelOfCar together in the loop and found several matches unyet, as soon as I put that if statement in there, it does absolutely nothing. Any ideas?
I'm not getting any problems: [code] ] lua_run_cl for k,v in pairs(list.Get("Vehicles")) do if (v.Model == LocalPlayer():GetEyeTrace().Entity:GetModel()) then print("found") break end end found [/code] Are you 100% sure that the casing is the same? Strings with different casing ("a" and "A") will evaluate to false when compared.
Sorry, you need to Log In to post a reply to this thread.