-
Posts
656 -
Joined
-
Days Won
9
Everything posted by SpecT
-
That random map part is in the race gamemode. Xiti's edited race gamemode is connected with the userpanel. Take a look at the racevoting_server.lua. EDIT: Ops my bad ... it's in this file. Edit the function updateMapQueueOnMapStart to: function updateMapQueueOnMapStart() --randomMap = randomMap + 1 --if randomMap ~= 4 then if #mapQueue ~= 0 then if #mapQueue == 1 then table.remove(mapQueue,1) else table.remove(mapQueue,1) triggerEvent("onUserpanelWantNextmap",getRootElement(),mapQueue[1]) outputDebugString("Calling next map to race",1,255,255,255) end end --else --randomMap = 0 --triggerEvent("onUserpanelWantNextmap",getRootElement(),'Random map') --end sentMapQueueToClients() end addEvent("onRaceCallNextMap",true) addEventHandler("onRaceCallNextMap",getRootElement(),updateMapQueueOnMapStart)
-
I just found nonsense code in the server-side. Also the client contains "getPlayerSerial" and if its ... serial then outputs insults in a unknown for me language. He is known with these sh**s in his scripts. That's why all of them are compiled. URL: https://community.multitheftauto.com/in ... s&id=11233 DONE
-
Oh lol lol lol lol and LOL. Finally it worked! Everything works now - length and played time! LOVE YA MATE !!! And again I'm sorry for the time you wasted on this ...
-
Got errors on the server side: Bad argument @ 'xmlNodeGetAttribute' [Expected xml-node at argument 1, got function] EDIT: On the local name, length, played = xmlNodeGetAttribute ( v, "name" ), xmlNodeGetAttribute ( v, "length" ), tonumber ( xmlNodeGetAttribute ( v, "played" )) @I'm sorry dude for the wasted time ...
-
Why don't you search for the game and find if there is a forum and ask. Or ask the authors for it.
-
It outputs a message: "table"
-
Already tried that ... still nothing in the gridlist. Lel
-
function loadSongsInGridlist() for name, v in pairs ( songList ) do table.insert(musicStore.songName,name) table.insert(musicStore.songCache,name) end end (If you want to know: I need the songCache for search function)
-
The gridlist is empty ... no errors.
-
Clientside: songList = { } function loadTable(table) local name, length, played = xmlNodeGetAttribute ( table, "name" ), xmlNodeGetAttribute ( table, "length" ), tonumber ( xmlNodeGetAttribute ( table, "played" )) songList[name] = {length, played} end addEvent("onLoadTable",true) addEventHandler("onLoadTable",localPlayer,loadTable) Serverside: songList = { } function updateSongs ( ) local file = xmlLoadFile ( "songs.xml" ) for _, v in ipairs ( xmlNodeGetChildren ( file ) ) do triggerClientEvent("onLoadTable",getRootElement(),v) end xmlUnloadFile ( file ) end addEventHandler("onResourceStart",getRootElement(),updateSongs) I'm sure that it's wrong but I don't know what.
-
I'm trying to trigger from serverside to clientside but it tells me that there is no such event .. Tried so much things and again the same
-
Is it a problem that that it's used by clientside and serverside? Maybe I should move the whole load part to serverside and then to send the data to client ... I don't know.
-
Ye I load it clientside. When click the button it calls the server to edit the played value. And when click on a song it loads the length and played times. EDIT:So if it shows 0 then probably something sets it to be 0.
-
Client side ? --on click event local songName = get the song name local length = songList[songName][1] local played = songList[songName][2] musicStore.length = length musicStore.played = played outputChatBox(""..songName.."|"..played.."") It gives me the song name and 0 Load part (client): songList = { } function updateSongs ( ) local file = xmlLoadFile ( "songs.xml" ) for _, v in ipairs ( xmlNodeGetChildren ( file ) ) do local name, length, played = xmlNodeGetAttribute ( v, "name" ), xmlNodeGetAttribute ( v, "length" ), tonumber ( xmlNodeGetAttribute ( v, "played" )) songList[name] = {length, played} end xmlUnloadFile ( file ) end function loadSongsInGridlist() updateSongs ( ) for name, v in pairs ( songList ) do table.insert(musicStore.songName,name) table.insert(musicStore.songCache,name) end end
-
Oh .. really. That pisses me off. Now for every song it tells me that it's played 0 times which is wrong. There is problem with the played value .. Tried to fix it with tonumber but didn't help.
-
Oh GAWD ... seriously It worked ... Thanks man again for the great help!
-
Ops .. my mistake. Didn't save the file. Okay now there are no errors but actually it doesn't update the played value. It's still 0. The info about the songs.xml shows that it was changed seconds ago but when I check the song the played value is still 0.
-
The same ... Again errors in the debugscript.
-
Nope ... there is no message.
-
function updatePlayed (songName) local file = xmlLoadFile ( "songs.xml" ) for _, v in ipairs ( xmlNodeGetChildren ( file ) ) do if ( xmlNodeGetAttribute ( v, "name" ) == songName ) then xmlNodeSetAttribute ( v, "played", xmlNodeGetAttribute ( v, "played" ) + 1 ) end xmlSaveFile ( file ) xmlUnloadFile ( file ) end end That's in the server-side. Client side: song = getSongName ... callServerFunction("updatePlayed ",songName) I have used the callServerFunction which is in the code.
-
Got lots of erros in debugscript when call it - looks like the count of the songs ... Bad argument @ "xmlNodeGetAttribute" [Expected xml-node at argument 1] Bad argument @ "xmlSaveFile" [Expected xml-node at argument 1] Bad argument @ "xmlUnloadFile" [Expected xml-node at argument 1]
-
Hey. I added a call to the server to update the file then it calls back the client to update the interface. The problem is that that I don't know how to get the song index for xmlFindChild. I should get the song and then it's row and then send it to the server-side to update the value.