-
Posts
369 -
Joined
-
Last visited
-
Days Won
4
Everything posted by WorthlessCynomys
-
Oh... I get it. Okay. I'll look into that too.
-
Yes. And you have to make a handling for the vehicle so its a bit slippery
-
songs = {} SongNum = 5 songs[1] = "sounds/1.mp3" songs[2] = "sounds/2.mp3" songs[3] = "sounds/3.mp3" songs[4] = "sounds/4.mp3" songs[5] = "sounds/5.mp3" --Login Sounds function PlayLoginSound() local randomSong = math.random (1, SongNum)--Get a random song from table sound = playSound(tostring(songs[randomSong]), true) --Play the song if (sound) then soundLength = getSoundLength ( sound ) setSoundVolume(sound, 0.2) --Set the sound volume to 20% if (soundLength) then setTimer(nextSound, soundLength*1000, 1) end else outputDebugString("error") end end addEventHandler ( "onClientResourceStart", resourceRoot, PlayLoginSound) function nextSound() destroyElement(sound) -- This is a new line local randomSong = math.random (1, SongNum) -- This is a new line too sound = playSound(tostring(songs[randomSong]), true) soundLength = getSoundLength ( sound ) -- This function returns the lenght in seconds if (sound) then setSoundVolume(sound, 0.2) if (soundLength) then setTimer(nextSound, soundLength*1000, 1) -- setTimer uses miliseconds. 1 second = 1000 miliseconds end end end Here it is. It is working. It was a tiny mistake. Edit: I would expand the code with a check so it can't play the same song twice.
-
You can do it with handling
-
You have to declare dxVisible. Your problem is that dxVisible is nil, so when you press the key it is set to false. When you press the key again it is set to true. So at the beginning if the code, put dxVisible = false
-
Have you managed to fix it? Because i was helping from phone the whole time but if you really want to solve this, i can debug it on my PC
-
Exactly. If you fill in the buttons arguments too then you'll have a clickable button. Have you made GUIs before? Do you need help?
-
Throw that module in the trash can and use MTA's built in db functions. Btw you can send data back (if you have): triggerClientEvent(elementToSendTo((client)), "eventName", sourceElement((resourceRoot)), additional, variables)
-
Are your timers set in a variable? Btw the function i sent isnt an internal function. Theres a windiw called code source or something. You have to paste that in your scriot to get it to work
-
Well you can use dxFunctions to make a button in that case you have to use the onClientClick event or you can create a gui button and then you have to use the onClientGUIClick event. button = guiCreateButton() addEventHandler("onClientGUIClick", button, function() -- do something end )
-
https://wiki.multitheftauto.com/wiki/IsSoundFinished
-
loading custom infernus models for each player.
WorthlessCynomys replied to King12's topic in Scripting
Shaders are what you looking for. They can be applied for a single object and if you set the shader for a car for all the clients then it will be synced. -
table1 = { label = guiCreateLabel() } guiGetText(table1["label"]) I can't really understand what your problem is, but maybe your looking for this ^^^
-
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
I would make those objects scripted. On client side. So i would create the objects in code on client side, so if any problem occours then you don't need to load a whole map. -
Hey. Give a variable to your playSounds and use that variable to stop or pause the current sound.
-
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
For PUBG i would use either dimensions or more servers. Not a players in range. You can count players in dimensions too. I'll make my function on PC if you still need it and send the working one. -
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
Feel free to ask about this. -
Hey. You have to make that random number again. Your randomSong variable will always be the same since the random runs when the program gets there and after that the randomSong variable is set So put a randomizer in nextsong function and use that
-
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
It gives reputation points based on likes that comments have. I haven't tested the function but it should work. Try to debug it. Output the elements of the player table with a for loop. Or maybe you can not "return #players" so you have to do sg like this local count = #players return count -
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
function countPlayersInRange(x,y,z, range) local tempCol = createColSphere(x,y,z,range) players = getElementsWithinColShape(tempCol, "player") destroyElement(tempCol) return #players end -
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
Well you probably found it under the useful functions tab, so if you copy the function into your script then it'll work. Otherwise, you can count players in a range with a colshape and a count (#) -
help Help with function "countPlayersInRange"
WorthlessCynomys replied to Odonton's topic in Scripting
It is simple. The countPlayersInRange function is not existing. -
Well... you can make a gui button, and there's an event onClientGUIClick to detect clicks on GUI buttons. If you want to make a dx button, you have to draw the dx and then detect the click with onClientClick. Everything that happens after the detection of the click, is on you.
-
So I found a problem. When you trigger the onRequestLogin, you send the localPlayer, the username and the password but the server side needs the username, the password and the checkbox state. Basically it handles username as the player element, password as the username and checkbox state as the password.
-
First of all. Those guis are absolute, so on other screens they may not be on the display. On the other hand... What is your question, it is too messy.