Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. drk

    Deleted

    Triple Post If you don't understand much of Lua, use the examples shaders from the mta sa wiki ( https://wiki.multitheftauto.com/wiki/Shader_Examples ) and change the fxp files from.
  2. drk

    car respawn

    LOL? Use respawnVehicle. https://wiki.multitheftauto.com/wiki/RespawnVehicle
  3. table.insert? .-. Like this? local example = { } local guiElements = { [1] = 'example = guiCreateWindow(-------------)', [2] = 'exampletw = guiCreateButton(--------------)' } function createElements() for i, elements in ipairs(guiElements) do table.insert(example, elements) end end addEventHandler('onClientResourceStart', resourceRoot, createElements) Sorry for noob lua '-'
  4. I created inside this: addEventHandler("onClientResourceStart", g_RootE, function() -- array ) I defined g_RootE = getResourceRootElement(getThisResource())
  5. It's possible to create GUI elements in a table and use that to set's visible/invisible all the elements like that? local example = { theButton = guiCreateButton(234,567,123,394,"Start!",true), theWindow = guiCreateStaticImage(234,234,234,234,"images/window.png",false) } I think that array isn't right but it possible to create elements in a table like this? I tried to make like this, but got nil.
  6. I know that won't make any difference. It's just to know
  7. e.g: guiOff = true; guiOn = false; showChat(false); ??
  8. Post the resource code here and we can help you finding bugs.
  9. But if live streams don't have length how TG owner has made the random music for the radio of the server clan? '-'
  10. Try selecting a music on the gridlist, wait for the end and see debugscript
  11. Line 113: currentSound = playSound(theSound, true) In debugscript appears this line...
  12. LOL Here not works... Edit: But I have to create a timer to when the random music end's starts another, right? And you know why I get the error 'attemp to index field '?'' ??
  13. Double click play sound: addEventHandler('onClientGUIDoubleClick', root, function() if source == music_grid then local row, col = guiGridListGetSelectedItem(source) if row and col and row ~= -1 and col ~= -1 then local name = guiGridListGetItemText(source, row, music_grid_column) local song = guiGridListGetItemData(source, row, music_grid_column) if isElement(currentSound) then destroyElement(currentSound) end currentSound = playSound(song, true) guiSetText(music_name, tostring(name)) else if not source then setRandomMusic() end end end end ) Tables: local musics = { [ 'David Guetta - Where Dem Girls At' ] = 'http://199.167.195.194/wdga.mp3', [ 'Coldplay - Paradise' ] = 'http://199.167.195.194/pd.mp3', [ 'Coldplay - Viva la Vida' ] = 'http://199.167.195.194/vlv.mp3', [ 'Ana Malhoa - Danza Kuduro' ] = 'http://199.167.195.194/dk.mp3', [ 'Klaas - The Way' ] = 'http://199.167.195.194/tw.mp3', [ 'Basshunter - All I ever wanted' ] = 'gfx/music/bh-aiew.mp3', [ 'Whiz Khalifa - Black and Yellow' ] = 'gfx/music/wk-bay.mp3', [ 'Skrillex - My name is Skrillex ( Remix )' ] = 'gfx/music/sx-mnis.mp3', [ 'Italobrothers - Stamp on the Ground' ] = 'gfx/music/ib-sotg.mp3', [ 'Madcon - Freaky like Me' ] = 'gfx/music/mc-flm.mp3', [ 'Cut the Music - Greatest Deejay' ] = 'gfx/music/ctm-gd.mp3', [ 'No Name - Time`s Vortex' ] = 'gfx/music/tv.mp3', [ 'Manian - Welcome to the Club' ] = 'gfx/music/wttc.mp3', [ 'Bon Jovi - It`s my Life' ] = 'gfx/music/iml.mp3', [ 'Example - Changed the Way you Kissed Me' ] = 'gfx/music/ctwykm.mp3', [ 'Example - Kickstart ( Bar 9 Remix )' ] = 'gfx/music/e-ksb9rx.mp3', [ 'Ellie Goulding - Lights ( Remix )' ] = 'http://199.167.195.194/Lights.mp3', [ 'Arkasia - New World Disorder' ] = '', [ 'ATB - You are not Alone ( Remix )' ] = '' } local randoms = { 'http://199.167.195.194/wdga.mp3', 'http//199.167.195.194/pd.mp3' } setRandomMusic function: function setRandomMusic () local theSound = randoms[math.random(#randoms)] currentSound = playSound(theSound, true) setTimer(currentSound, 1000, 1) guiSetText(music_name, tostring(name)) end It's not the full code, only a part.
  14. Ah. I've not seen this I will try Edit: Same error, on line 113.
  15. Hey, now I get this error on line 103: attemp to index field '?'(a nil value) line 113: currentSound = playSound(theSound, true) theSound variable is local theSound = sounds[math.random(2, #randoms)] When the music will change I get this error and the music started plays again =s Edit: Oh, and the #randoms table is local randoms = { 'http://199.167.195.194/wdga.mp3', 'http//199.167.195.194/pd.mp3' }
  16. That [1], [2], [3], ... is index, yee?
  17. LOL '-' I will try. Edit: Don't work. Same error but on the argument 1.
  18. Line 107 ( the line of the error ): local random = math.random(1, #musics) #musics is: local musics = { [ 'David Guetta - Where Dem Girls At' ] = 'http://199.167.195.194/wdga.mp3', [ 'Coldplay - Paradise' ] = 'http://199.167.195.194/pd.mp3', [ 'Coldplay - Viva la Vida' ] = 'http://199.167.195.194/vlv.mp3', [ 'Ana Malhoa - Danza Kuduro' ] = 'http://199.167.195.194/dk.mp3', [ 'Klaas - The Way' ] = 'http://199.167.195.194/tw.mp3', [ 'Basshunter - All I ever wanted' ] = 'gfx/music/bh-aiew.mp3', [ 'Whiz Khalifa - Black and Yellow' ] = 'gfx/music/wk-bay.mp3', [ 'Skrillex - My name is Skrillex ( Remix )' ] = 'gfx/music/sx-mnis.mp3', [ 'Italobrothers - Stamp on the Ground' ] = 'gfx/music/ib-sotg.mp3', [ 'Madcon - Freaky like Me' ] = 'gfx/music/mc-flm.mp3', [ 'Cut the Music - Greatest Deejay' ] = 'gfx/music/ctm-gd.mp3', [ 'No Name - Time`s Vortex' ] = 'gfx/music/tv.mp3', [ 'Manian - Welcome to the Club' ] = 'gfx/music/wttc.mp3', [ 'Bon Jovi - It`s my Life' ] = 'gfx/music/iml.mp3', [ 'Example - Changed the Way you Kissed Me' ] = 'gfx/music/ctwykm.mp3', [ 'Example - Kickstart ( Bar 9 Remix )' ] = 'gfx/music/e-ksb9rx.mp3', [ 'Ellie Goulding - Lights ( Remix )' ] = 'http://199.167.195.194/Lights.mp3', [ 'Arkasia - New World Disorder' ] = '', [ 'ATB - You are not Alone ( Remix )' ] = '' } Why I get this error?
  19. Thanks 50p Problem solved. Please lock this topic.
  20. LOL It isn't to play all the music. It's a radio, when a player double click the music it start. But when the player changes the music on the GUI I don't know how to stop the music that is playing. understand?
  21. function startSound(url, row) local stopTheMusic = isSoundPaused(tostring(url)) if (stopTheMusic == false) then for i, song in ipairs(musics) do stopSound(song) playSound(url) end elseif (stopTheMusic == true) then playSound(url) end end function setMusic() for name, url in pairs(musics) do if guiGridListGetSelectedItem(music_grid) ~= 1 then local row, column = guiGridListGetSelectedItem(music_grid) startSound(tostring(url), row, column, row) end end end addEventHandler('onClientGUIDoubleClick', music_grid, setMusic) I know that startSound is wrong but before the 'for i, song in ipairs(musics) do' ... it starts the music, but don't stop the music when the player start's other. The table is local musics = { [ 'David Guetta - Where Dem Girls At' ] = 'gfx/music/dg-wdga.mp3', [ 'Coldplay - Paradise' ] = 'gfx/music/cp-pd.mp3', [ 'Coldplay - Viva la Vida' ] = 'gfx/music/cp-vlv.mp3', [ 'Ana Malhoa - Danza Kuduro' ] = 'gfx/music/am-dk.mp3', [ 'No Name - Jamming' ] = 'gfx/music/jm.mp3', [ 'Klaas - Make you Feel' ] = 'gfx/music/ks-myf.mp3', [ 'No Name - Vitality' ] = 'gfx/music/vy.mp3', [ 'Basshunter - All I ever wanted' ] = 'gfx/music/bh-aiew.mp3', [ 'Whiz Khalifa - Black and Yellow' ] = 'gfx/music/wk-bay.mp3', [ 'Skrillex - My name is Skrillex ( Remix )' ] = 'gfx/music/sx-mnis.mp3', [ 'Italobrothers - Stamp on the Ground' ] = 'gfx/music/ib-sotg.mp3', [ 'Madcon - Freaky like Me' ] = 'gfx/music/mc-flm.mp3', [ 'Cut the Music - Greatest Deejay' ] = 'gfx/music/ctm-gd.mp3', [ 'No Name - Time`s Vortex' ] = 'gfx/music/tv.mp3', [ 'Manian - Welcome to the Club' ] = 'gfx/music/wttc.mp3', [ 'Bon Jovi - It`s my Life' ] = 'gfx/music/iml.mp3', [ 'Example - Changed the Way you Kissed Me' ] = 'gfx/music/ctwykm.mp3', [ 'Example - Kickstart ( Bar 9 Remix )' ] = 'gfx/music/e-ksb9rx.mp3', [ 'Ellie Goulding - Lights ( Remix )' ] = 'http://199.167.195.194/Lights.mp3' }
  22. Now the song don't start Don't appear any erros on console or debugscript
×
×
  • Create New...