xXMADEXx Posted January 30, 2013 Posted January 30, 2013 Hey guys, im making a GUI radio system, and i cannot get this script to work. I tried to edit the script, from another script i have, but cannot get it, any advice? radios = { {"Hot 108 Jamz","http://scfire-dtc-aa01.stream.aol.com:80/stream/1038"} } function use2() local row, col = guiGridListGetSelectedItem(rog_ucp_radio_grid) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(rog_ucp_radio_grid, row, 1)) if model ~= "" then playSound(row, col) end end end addEventHandler("onClientGUIClick", rog_ucp_radio_button_stream, use2, false) The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted January 30, 2013 Posted January 30, 2013 That doesn't make any sense, what are you trying to do? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted January 30, 2013 Author Posted January 30, 2013 That doesn't make any sense, what are you trying to do? Make it so that when, you click an option in the GUI that it will start to play the link. The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted January 31, 2013 Posted January 31, 2013 And, where do you save the URL at? grid list item data or item text? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted January 31, 2013 Author Posted January 31, 2013 And, where do you save the URL at? grid list item data or item text? radios = { {"Hot 108 Jamz","http://scfire-dtc-aa01.stream.aol.com:80/stream/1038"} } The url is the second part, "http://scfire-dtc-aa01.stream.aol.com:80/stream/1038" The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted January 31, 2013 Posted January 31, 2013 So, that would be item data, try this: radios = { {"Hot 108 Jamz","http://scfire-dtc-aa01.stream.aol.com:80/stream/1038"} } function use2 ( ) local row, col = guiGridListGetSelectedItem ( rog_ucp_radio_grid) if ( row and col and row ~= -1 and col ~= -1 ) then local url = guiGridListGetItemData ( rog_ucp_radio_grid, row, 1 ) if ( url ~= "" ) then playSound ( url ) end end end addEventHandler ( "onClientGUIClick", rog_ucp_radio_button_stream, use2, false ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted January 31, 2013 Author Posted January 31, 2013 Thank you works great. The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted January 31, 2013 Posted January 31, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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