Anubhav Posted June 24, 2014 Share 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 Link to comment
xXMADEXx Posted June 24, 2014 Share 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 Link to comment
Anubhav Posted June 24, 2014 Author Share 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 Link to comment
Moderators IIYAMA Posted June 24, 2014 Moderators Share Posted June 24, 2014 Probably because code doesn't get executed or you empty the combobox directy. Must be working otherwise. Link to comment
Anubhav Posted June 24, 2014 Author Share Posted June 24, 2014 I din't empty the combobox! Link to comment
Moderators IIYAMA Posted June 24, 2014 Moderators Share Posted June 24, 2014 I din't empty the combobox! Then the code isn't executed. Link to comment
Anubhav Posted June 24, 2014 Author Share 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 . 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