-
Posts
53 -
Joined
-
Last visited
Everything posted by koeno100
-
Still not working.
-
No one..?
-
theSounds is a table filled with all sounds from gMap that code will basically take every single sound in the table and set the volume to 50%
-
Okay so I've done a test with just this clientside script: function showPlayerMoney() theMoney = getPlayerMoney() outputChatBox(theMoney) end addEventHandler("onClientRender", getRootElement(), showPlayerMoney) If I give myself by example $100 it will spam "100" in the chatbox, UNTIL a new map starts, then it will spam 0 again. Could I fix this by choosing something else than "getRootElement()"?
-
You have to put it inside a function like this: Skins = { {"Native Rancher", 128}, {"Furys Trucker", 133}, {"Beer Trucker", 202}, {"Money Trucker", 206} } function createWindow ( ) local sWidth, sHeight, X, Y = guiGetScreenSize ( ) local Width, Height = 500, 350 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) takeJobWindow = guiCreateWindow ( X, Y, Width, Height, "Trucker Job", false ) takeSkinGrid = guiCreateGridList ( 340, 30, 150, 310, false, takeJobWindow ) guiGridListAddColumn ( takeSkinGrid, "Skin Name" , 0.6 ) guiGridListAddColumn ( takeSkinGrid, "ID", 0.28 ) jobButton = guiCreateButton ( 0, 310, 150, 50, "Take Job", false, takeJobWindow ) cancelButton = guiCreateButton ( 175, 310, 150, 50, "Cancel", false, takeJobWindow ) fillTheGrid() end addEventHandler ( "onClientResourceStart", getResourceRootElement (), createWindow ) function fillTheGrid() for i,v in ipairs (Skins) do local row = guiGridListAddRow ( takeSkinGrid ) guiGridListSetItemText ( takeSkinGrid, row, 1, v[1], false, true ) guiGridListSetItemText ( takeSkinGrid, row, 2, v[2], false, true ) end end
-
Almost. local gMap = exports.mapmanager:getRunningGamemodeMap() local mapRoot = getResourceRootElement(gMap) theSounds = getElementsByType("sound", mapRoot) for placeNumber,sound in ipairs(theSounds) do setSoundVolume(theSound, 0.5) end
-
setSoundVolume(theSound, 0.5)
-
That's because you've put the outputChatBox within onClientRender, so it will output the string every time the client renders. Take the addEventHandler("onClientMarkerHit") out of the onClientRender event and put it underneath it like this: function timePassed () if not systemUpTime then systemUpTime = getTickCount () end current = getTickCount () local res = math.floor((current - systemUpTime)/1000) dxDrawText (res, x/3, y/3, x, y, tocolor (255, 255, 255, 255), 1.5, "clear") end addEventHandler ("onClientMarkerHit", getRootElement(), function () outputChatBox (getPlayerName (localPlayer).." has finished the map in: "..res.." mins.", source) end )
-
Use this event: onClientPlayerWasted The paramters you can get from it are: element killer, int weapon, int bodypart "weapon: An integer representing the killer weapon or the death reason. " Here's a list with all death reasons: https://wiki.multitheftauto.com/wiki/Death_Reasons
-
I disabled every setPlayerMoney but it still happens. It's like when a new map starts, the server resets the player's clientside money to 0, but when a player is given money, it does update the money...
-
Hello! I've made a clientside script with the "onClientRender"event and the "getPlayerMoney" function to display a player's money. (It's in a race server) Whenever the map changes, the player's money turns 0, untill the player's money gets updated. Does anyone know how to fix this?
-
Use this: function radioset() if radioplaying then ... killTimer(timer) else ... timer = setTimer(function --[[Your code]] end, 2000, 0) end end
-
I want it to time the outputchatbox to output the music every 2mins. Use setTimer
-
What timer..?
-
Okay, so let's see: 1. Use the script below and it should be fixed. 2 and 3. That's a problem that can't be fixed within the LUA script. It's something in your radio that isn't working right. Either the internet connection is really slow, so it takes really long to send the meta tags, and the problem with the stream title is also within the stream itself, not the script. function radiotest() if radioplaying then radioplaying = false destroyElement(radioSound) outputChatBox("#D27350[RADIO] #FFFFFFYou have stopped the radio.",176,0,57,true) removeEventHandler("onClientSoundChangedMeta", getRootElement(), radioName) else radioplaying = true radioSound = playSound("http://listen.HouseTime.fm/dsl.pls") setSoundVolume(radioSound,1) outputChatBox("#D27350[RADIO] #FFFFFFYou have started the radio.",176,0,57,true) addEventHandler("onClientSoundChangedMeta", getRootElement(), radioName) end end addCommandHandler("radio", radiotest) function radioName() local meta = getSoundMetaTags(radioSound) if meta.stream_title then outputChatBox("#D27350[RADIO] #FFFFFFCurrent Music : "..(meta.stream_title).."!", 176, 0, 57, true) else outputChatBox("No song title found!") end end addEventHandler("onClientSoundFinishedDownload", getRootElement(), radioName) EDIT: There was an error in the script, fixed it.
-
Post your whole script please.
-
function radiotest() radio = playSound ("http://listen.HouseTime.fm/dsl.pls") end addCommandHandler("radio", radiotest) function radioName() local meta = getSoundMetaTags(radio) if meta.stream_title then outputChatBox("Current Music : "..(meta.stream_title).."!", 255, 0, 0, true) else outputChatBox("No song title found!") end end addEventHandler("onClientSoundChangedMeta", getRootElement(), radioName) This should work. Just replace the stream URL with your stream URL.
-
I just want to get this value It says your stream is private. I also can't hear anything when I play the stream, so I think there's something wrong with your stream...
-
This means that the URL isn't providing any stream_title.
-
Forgot to add: In race mode.
-
Have you put it in like this under the Admin group? [b]<group name="Admin">[/b] <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> [b]<object name="resource.login_panel"></object>[/b] </group>
-
Hello, I've made a login panel and I want to put players who aren't logged in in spectate mode. Is there a way I can do this?
-
1. Is your script clientside or serverside (Regarding your script I guess clientside?) 2. Where does it create a file, clientside or serverside?
-
Hello everyone! I'm making a login panel for a race server, and I wonder how I can prevent players from spawning (So putting them in spectate mode) as long as they aren't logged in? (As long as the login window is visible)
