Jump to content

مششكلة


Recommended Posts

السسلام عليكم

انا عندي مششكلة بذا الكود

  
-- Sound's 
songs = { 
    {"Sound","http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
} 
  
for _,song in ipairs(songs) do 
    row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,song[1],false,false) 
    guiGridListSetItemData(GUIEditor.gridlist[1],row,1,song[2]) 
end 
  
-- Start \ Sound  
addEventHandler("onClientGUIClick", root, 
    function() 
        if (source == GUIEditor.button[2]) then 
            if(sound)then return end 
                 local statioURL = guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
                sound = playSound ( stationURL ) 
                        elseif(source == GUIEditor.button[1])then 
  if isElement(sound) then 
  destroyElement(sound) 
  sound = nil 
  end 
   
Link to comment

-- Sound's 
songs = { 
    {"Sound","http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
} 
  
for _,song in ipairs(songs) do 
    row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,song[1],false,false) 
    guiGridListSetItemData(GUIEditor.gridlist[1],row,1,song[2]) 
end 
  
-- Start \ Sound 
  
addEventHandler( "onClientGUIClick", resourceRoot, function (   ) 
     if ( source == GUIEditor.button[2] ) then 
        if ( guiGridListGetSelectedItem ( UIEditor.gridlist[1] ) ~= -1 ) then 
           local statioURL = guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
           if ( statioURL ~= "" ) then 
             if ( isElement ( SoundURL ) ) then destroyElement ( SoundURL ) end 
                   SoundURL = playSound ( stationURL ) 
               end 
           end           
       elseif ( source == GUIEditor.button[1] )then 
         if ( isElement ( SoundURL ) ) then  
            destroyElement ( SoundURL )  
        end 
    end 
end ) 
Link to comment

تآكدت من الاسم صحيح

الديبق يقول لي

Bad argument @ 'guiGridListAddRow' [Expected gui-element at argument 1, got nill]

+

Bad argument @ 'guiGridListSetItemText' [Expected gui-element at argument 1, got nill]

+

Bad argument @ 'guiGridListSetItemData' [Expected gui-element at argument 1, got nill]

Link to comment

مآفيهه آي شي نفس الاسماء

        GUIEditor.gridlist[1] = guiCreateGridList(9, 19, 217, 285, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9)     
    end 
) 
  
    -- Sound's 
    songs = { 
        {"Sound","http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
    } 
      
    for _,song in ipairs(songs) do 
        row = guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1],row,1,song[1],false,false) 
        guiGridListSetItemData(GUIEditor.gridlist[1],row,1,song[2]) 
    end 
      
    -- Start \ Sound 
      
    addEventHandler( "onClientGUIClick", resourceRoot, function (   ) 
         if ( source == GUIEditor.button[2] ) then 
            if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 ) then 
               local statioURL = guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
               if ( statioURL ~= "" ) then 
                 if ( isElement ( SoundURL ) ) then destroyElement ( SoundURL ) end 
                       SoundURL = playSound ( stationURL ) 
                   end 
               end          
           elseif ( source == GUIEditor.button[1] )then 
             if ( isElement ( SoundURL ) ) then 
                destroyElement ( SoundURL ) 
            end 
        end 
    end ) 
Link to comment
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
        GUIEditor.window[1] = guiCreateWindow(282, 130, 236, 396, "Window", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
  
        GUIEditor.button[1] = guiCreateButton(9, 345, 217, 37, "Stop / آيقاف", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[2] = guiCreateButton(9, 308, 217, 37, "Start / تشغيل", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 19, 217, 285, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9)     
  
    -- Sound's 
    songs = { 
        {"Sound","http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
    } 
      
    for _,song in ipairs(songs) do 
        row = guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1],row,1,song[1],false,false) 
        guiGridListSetItemData(GUIEditor.gridlist[1],row,1,song[2]) 
    end 
      
    -- Start \ Sound 
      
    addEventHandler( "onClientGUIClick", resourceRoot, function (   ) 
         if ( source == GUIEditor.button[2] ) then 
            if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 ) then 
               local statioURL = guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
               if ( statioURL ~= "" ) then 
                 if ( isElement ( SoundURL ) ) then destroyElement ( SoundURL ) end 
                       SoundURL = playSound ( stationURL ) 
                   end 
               end          
           elseif ( source == GUIEditor.button[1] )then 
             if ( isElement ( SoundURL ) ) then 
                destroyElement ( SoundURL ) 
            end 
        end 
    end ) 

Meta

Link to comment

GUIEditor.window[1] = guiCreateWindow(282, 130, 236, 396, "Window", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
GUIEditor.button[1] = guiCreateButton(9, 345, 217, 37, "Stop / آيقاف", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
GUIEditor.button[2] = guiCreateButton(9, 308, 217, 37, "Start / تشغيل", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
elementlist = guiCreateGridList(9, 19, 217, 285, false, GUIEditor.window[1]) 
guiGridListAddColumn(elementlist, "#", 0.9)     
-- Sound's 
songs = { 
  {"Sound","http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
} 
  
for _,song in ipairs(songs) do 
    row = guiGridListAddRow(elementlist) 
    guiGridListSetItemText(elementlist,row,1,song[1],false,false) 
    guiGridListSetItemData(elementlist,row,1,song[2]) 
end 
      
-- Start \ Sound 
      
addEventHandler( "onClientGUIClick", resourceRoot, function (   ) 
   if ( source == GUIEditor.button[2] ) then 
     if ( guiGridListGetSelectedItem ( elementlist ) ~= -1 ) then 
        local statioURL = guiGridListGetItemData ( elementlist, guiGridListGetSelectedItem ( elementlist ), 1 ) 
         if ( statioURL ~= "" ) then 
            if ( isElement ( SoundURL ) ) then destroyElement ( SoundURL ) end 
                    SoundURL = playSound ( stationURL ) 
                 end 
           end         
          elseif ( source == GUIEditor.button[1] )then 
            if ( isElement ( SoundURL ) ) then 
             destroyElement ( SoundURL ) 
        end 
    end 
end ) 
Link to comment
Bad argument @ 'playSound' [Expected string at argument 1, got nill] :(

---ClientSide

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
        GUIEditor.window[1] = guiCreateWindow(282, 130, 236, 396, "Window", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        GUIEditor.button[1] = guiCreateButton(9, 345, 217, 37, "Stop / آيقاف", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[2] = guiCreateButton(9, 308, 217, 37, "Start / تشغيل", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 19, 217, 285, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.9)     
  
    -- Sound's 
    songs = { 
        {"http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
    } 
      
    for _,song in ipairs(songs) do 
        row = guiGridListAddRow(GUIEditor.gridlist[1]) 
        guiGridListSetItemText(GUIEditor.gridlist[1],row,1,song[1],false,false) 
        guiGridListSetItemData(GUIEditor.gridlist[1],row,1,song[2]) 
        end 
      
    -- Start \ Sound 
      
    addEventHandler( "onClientGUIClick", resourceRoot, function (   ) 
         if ( source == GUIEditor.button[2] ) then 
            if ( guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 ) then 
               local statioURL = guiGridListGetItemData ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
               if ( statioURL ~= "" ) then 
                 if ( isElement ( SoundURL ) ) then destroyElement ( SoundURL ) end 
                 SoundURL = playSound ( stationURL ) 
                   end 
               end         
           elseif ( source == GUIEditor.button[1] )then 
             if ( isElement ( SoundURL ) ) then 
                destroyElement ( SoundURL ) 
            end 
        end 
    end ) 
Link to comment

جرب

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
GUIEditor.window[1] = guiCreateWindow(282, 130, 236, 396, "Window", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetAlpha(GUIEditor.window[1], 1.00) 
GUIEditor.button[1] = guiCreateButton(9, 345, 217, 37, "Stop / آيقاف", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
GUIEditor.button[2] = guiCreateButton(9, 308, 217, 37, "Start / تشغيل", false, GUIEditor.window[1]) 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
elementlist = guiCreateGridList(9, 19, 217, 285, false, GUIEditor.window[1]) 
guiGridListAddColumn(elementlist, "#", 0.9)     
-- Sound's 
songs = { 
  {"Sound","http://cdn.top4top.net/d_11668d4a9b1.mp3"}, 
} 
  
for _,song in ipairs(songs) do 
    row = guiGridListAddRow(elementlist) 
    guiGridListSetItemText(elementlist,row,1,song[1],false,false) 
    guiGridListSetItemData(elementlist,row,1,song[2]) 
end 
      
-- Start \ Sound 
      
addEventHandler( "onClientGUIClick", resourceRoot, function (   ) 
   if ( source == GUIEditor.button[2] ) then 
     if ( guiGridListGetSelectedItem ( elementlist ) ~= -1 ) then 
        local statioURL = guiGridListGetItemData ( elementlist, guiGridListGetSelectedItem ( elementlist ), 2 ) 
         if ( statioURL ~= "" ) then 
            if ( isElement ( SoundURL ) ) then destroyElement ( SoundURL ) end 
                    SoundURL = playSound ( stationURL ) 
                 end 
           end         
          elseif ( source == GUIEditor.button[1] )then 
            if ( isElement ( SoundURL ) ) then 
             destroyElement ( SoundURL ) 
        end 
    end 
end ) 

Link to comment

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