Jump to content

Help with GUI Radio


xXMADEXx

Recommended Posts

Posted

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) 

Posted

That doesn't make any sense, what are you trying to do?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

And, where do you save the URL at? grid list item data or item text?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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