Jump to content

SpecT

Members
  • Posts

    656
  • Joined

  • Days Won

    9

Everything posted by SpecT

  1. Okay, but then I should move the XML load part in server-side. It should edit the file which has to be loaded by everyone. Hm .. I think I will do it. If I have again problems I will write. Thanks again for the help!
  2. Thanks guys! It worked !! Another question to update the played times I should use xmlNodeSetAttribute ?
  3. The script bugged at all ... Now the gridlist is empty. Also why in the function loadSongsInGridlist the name = i ? Instead song names it shows numbers ...
  4. Yey .. that's what I wanted. I'm not in hurry so I will wait you to come. I can't do it because I'm not that "skilled" to work with tables - I know just basic scriting with tables ...
  5. I can't get it ... *facepalm* songs.xml "Feint And Boyinaband - Time Bomb" length="3:32" played="0" /> "Skillet - Rise" length="3:32" played="0" /> "Skillet - Not Gonna Die" length="3:32" played="0" /> So (btw there are more songs) can I get the song info using the song name ? Gridlist (DX): Feint And Boyinaband - Time Bomb Skillet - Rise Skillet - Not Gonna Die When I click on a song it should get it's name (the DX library has that so I already use it to play the song) then get the info about it - length and played. There should be a way to do it ... Here is the XML load part (used Madex code): function getSongs ( ) local songList = { } local file = xmlLoadFile ( "songs.xml" ) for i, v in ipairs ( xmlNodeGetChildren ( file ) ) do table.insert ( songList, { tostring ( xmlNodeGetAttribute ( v, "name" ) ), xmlNodeGetAttribute ( v, "length"), tonumber ( xmlNodeGetAttribute ( v, "played" ) ) } ) end xmlUnloadFile ( file ) return songList end function loadSongsInGridlist() for i, v in ipairs ( getSongs ( ) ) do local name, length, played = unpack ( v ) table.insert(songListGridlist,name) end end addEventHandler("onClientResourceStart",getRootElement(),loadSongsInGridlist) I want to make it like this because right now the script (song lines) is kinda long. For every song I have to set the artist and length ... 665 lines for 120 songs ... guess what would happen when I add more songs
  6. It's okay for the length but what about the times played? It should be saved somehow ...
  7. The problem is that that I'm using dx library which doesn't have that.
  8. Oh hey WhoAmI ... Soo the script is loading the songs in a table (from XML) which is used by the gridlist. Ok ... but I want to get length and played times when I click on the song (For now it loads the song name and artist - get them from the name). I can put length and played times in separate tables but later how could I get the information for the clicked song? BTW the length and played times is storaged in the XML file too. Really bad explained ... hope you will understand
  9. Yey .. I made it! I have another problem - its about the tables should I keep posting here or to make a new topic for it ?
  10. Oh thanks for the example! I'm gonna try!
  11. Hello again guys ... I hope that I won't get hated for that but ... yeah. So I'm kinda newbie with the xml scripting. I was looking at another scripts to try to get it but I just can't. I want to use a xml file to storage songs - song name, length and played times. The xml file (example) should looks like this: "Feint And Boyinaband - Time Bomb" length="3:32" played="2" /> Could you guys help me with it ? There will be needed 2 things: 1) Load the songs from the xml then send it to the client as a table 2) Edit the played value. I hope that I'm not too impudent and you guys are gonna help me... @If I'm not allowed to ask such things I will delete the topic!
  12. Use setAccountData . You will need to get player's account. Then to load use getAccountData. If you don't know how to make it give a look on the wiki https://wiki.multitheftauto.com/wiki/SetAccountData
  13. Thanks MrTasty!!! That's what I actually needed. But it returns: beforeHyphen = Someone afterHyphen = ft FIXED IT .. For these who need it too: local songname = "Someone ft Someone else - Song name" local beforeHyphen = gettok(songname, 1, 45) local afterHyphen = gettok(songname, 2, 45) 45 = "-" I used this >>https://wiki.multitheftauto.com/wiki/ASCII
  14. Hello guys! So I'm working on a music panel and I wanted to know if it is possible to do something. Hope you will understand it! Example (song name): Someone ft. someone - The someone song Is it possible to get the text before the "-" and after the "-" ? Thanks in advance guys!
  15. https://community.multitheftauto.com/in ... s&id=10604
  16. SpecT

    Script help

    Open mtaserver.conf with a text editor. Then scroll down till you see something like this: then should add your resources there: @Replace resourceName with the resource name.
  17. Just edit the meta to: "Einheit-101" type="script" name="vreload" version="3.2" /> client="1.3.0-9.06990" server="1.3.0-9.06990" /> I don't think that there will be any problem ...
  18. SpecT

    playSound

    I don't think that there is any fast converting Youtube to MP3 API.
  19. SpecT

    playSound

    That's from the Youtube to MP3 player that is in the community. The API he used is down so you no longer can use it.
  20. SpecT

    On playSound

    Dude thanks for all of that Really ... but maybe you don't know that the DM maps have custom scripts. I mean .lua files for markers ... onClientHitMarker , playSound etc ... So if it will remove all the .lua files from the meta .. probably the map will be buggy as fu**. Nevermind, as gallardo said I will try to make a scriptloader, I have ideas and examples so yea. Thanks again for all of that, WhoAmI !
  21. SpecT

    On playSound

    I will try it later cuz right now I can't. Btw there is a script of loading the song ...... Most times it's song.lua or music.lua ... It will send errors in the debugscript cuz the .mp3 isnt added in meta.
  22. SpecT

    On playSound

    Nevermind, I will try to figure it out. Maybe I will download them from the FTP and then extract all of them and re-upload ... that may take really long time but .. there is no other way to do it.
  23. SpecT

    On playSound

    It does, but the problem is that the maps are in .zip. And the maps count is ~1600. And meta editing works only for maps that are in folder.
  24. SpecT

    On playSound

    Oh I didn't got the idea of changing the meta with script. Thank you guys! You saved me so much work ... I appreciate it ! The other problem is that that the most maps are in .zip ... Is it possible to edit the meta when they are archived in .zip ?
×
×
  • Create New...