roaddog Posted February 1, 2015 Share Posted February 1, 2015 jobSheet = { ['fisherman'] = "Fisherman", ['medic'] = "Paramedic", ['lumberjack'] = "Lumber Jack", } function thisshit() jobitself = getKeyFromValueInTable(jobSheet, "Fisherman") outputChatBox(tostring(jobitself)) end addEventHandler("onResourceStart", getRootElement(), thisshit) function getKeyFromValueInTable(a, b) for k,v in ipairs(a) do if v == b then return k end end return false end So I used a function which is https://wiki.multitheftauto.com/wiki/Ge ... lueInTable , but I got a problem using this function, from code above it always returns false. Why is that so? Link to comment
roaddog Posted February 1, 2015 Author Share Posted February 1, 2015 Oh goddamn, Thanks TAPL Never thought of that before. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now