Anubhav Posted June 24, 2014 Posted June 24, 2014 Hello guyz, I am back to MTA. I have got a problem. I am using loops to add players in combobox but they don't get added. I got no error! function addPlayero() for id,playeritem in ipairs(getElementsByType("player")) do guiComboBoxAddItem(combo, playeritem) end end See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xXMADEXx Posted June 24, 2014 Posted June 24, 2014 It looks like you're trying to add the player element. Use getPlayerName function addPlayero() for id,playeritem in ipairs(getElementsByType("player")) do guiComboBoxAddItem(combo, getPlayerName ( playeritem ) ) end end The Ultimate Lua Tutorial! | MTA PHP SDK
Anubhav Posted June 24, 2014 Author Posted June 24, 2014 Whoops! I had forget my alot scripting part as I left MTA and i din't script anything of MTA. I will try it and tell you it works or not. EDIT: Doesn't work no debug script error and combo box is still empty as before See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Moderators IIYAMA Posted June 24, 2014 Moderators Posted June 24, 2014 Probably because code doesn't get executed or you empty the combobox directy. Must be working otherwise. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Anubhav Posted June 24, 2014 Author Posted June 24, 2014 I din't empty the combobox! See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Moderators IIYAMA Posted June 24, 2014 Moderators Posted June 24, 2014 I din't empty the combobox! Then the code isn't executed. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Anubhav Posted June 24, 2014 Author Posted June 24, 2014 What should i do theN? EDIT: Please lock the topic! I used setTimer and cleared it when it run and add the players it made it work! Thanks for help guyz . See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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