Jump to content

I need help


Anubhav

Recommended Posts

Posted

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 
  

Posted

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 
  

Posted

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 :/

  • Moderators
Posted

Probably because code doesn't get executed or you empty the combobox directy.

Must be working otherwise.

Posted

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

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