Jump to content

Crook4Money

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by Crook4Money

  1. Crook4Money

    GUI skin?

    How do you get a panel to look like this. I've seen a few vids and screenshots of this design, but can't figure out how to get it.
  2. Thanks. I know booleans = true/false, but I'm still not familiar when you can use them outside of elements, but this gave me a bit of a better understanding as to how that was incorporated to prevent the event from triggering again before finished. The script works and now I am familiar with isMoving as I didn't know that was a thing. Hopefully should help me fix other scripts I run into with this issue.
  3. I asked this question not even a week ago, but might as well ask it again since it's been plaguing all of my scripts. The question was "how do I stop a script from repeating before it's finished." I didn't give any details as to what it was, but I was trying to make a custom siren for police vehicles. I've been working on it for literally weeks and still can't find a solution and have remade the script several times over it trying to figure out how to stop it. This is what I have so far if you're interested. function startMySound() local driver = getVehicleOccupant ( source ) if ( driver ) then sound = playSound( "sound1.mp3", true ) end end addEventHandler( "onClientVehicleEnter", root, startMySound ) addCommandHandler ( "siren", startMySound) function stopMySound() stopSound( sound ) end addCommandHandler ( "stopsound", stopMySound ) addEventHandler( "onClientVehicleStartExit", root, stopMySound ) function bindTheKeys () bindKey ( "1", "up", startMySound ) bindKey ( "2", "up", stopMySound ) end addCommandHandler ( "bindme", bindTheKeys ) addEventHandler("onClientResourceStart", resourceRoot, bindTheKeys) function disableSirens ( theVehicle, seat ) local id = getElementModel ( theVehicle ) if id == 596 or id == 598 or id == 597 then toggleControl ( "horn", false ) else toggleControl ( "horn", true ) end end addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer(), disableSirens ) The sound just goes on top of eachother everytime it is activated and I don't know how to prevent it. This script is far from complete, but just trying to make out my question clearly this time around with video this time . The script I'm working on and also having this problem with is my toll both script. I've spent almost a week on this as well and barely got it functioning correctly today, but I'm still having the same problem with no solution. The main command activates over and over again and I don't know how to prevent it and can't find a solution. local gate1 = createObject(968, 1544.6999511719, -1623.9000244141, 13, 0, 89.1, 270) local marker1 = createMarker(1544.5, -1628, 13.5, "cylinder",6,225,225,255,25) function moveToll(player) local player if source == marker1 then moveObject(gate1, 2000, 1544.6999511719, -1623.9000244141, 13, 0, -89.1, 0) if moveObject then setTimer(gate2, 4000, 1, true) end end end addEventHandler("onClientMarkerHit", root, moveToll) function gate2() moveObject(gate1, 2000, 1544.6999511719, -1623.9000244141, 13, 0, 89.1, 0) end
  4. Thanks. I set it to one earlier and it didn't do anything. Idk why I didn't try another 255.
  5. Yeah, it was client sided. I realized that I had the object value in the "x" value by mistake. I added the local player and fixed the values, but the markers are still invisible. I got it to work anyways. I had a few values that were incorrect. Thanks for the help.
  6. I'm trying to create a toll booth like script, but the marker isn't working with the object and I'm not getting any visible errors. I also don't know how to create a visible marker to check if it's even there. local gate1 = createObject(968, 1544.6999511719, -1623.9000244141, 13, 0, 89.1, 270) local marker1 = createMarker(1540.8000488281, -1627.4000244141, 12.303552627563, "corona",5,225,225,255,0) local marker2 = createMarker(1546.8000488281, -1627.1999511719, 12.303552627563, "corona",5,225,225,255,0) function moveToll(player) if player == localPlayer then return end if source == marker1 then moveObject(gate1, 2000, 968, 1544.6999511719, -1623.9000244141, 13, 0, 270) elseif source==marker2 then moveObject(gate1, 2000, 968, 1544.6999511719, -1623.9000244141, 13, 0, 270) end end addEventHandler("onClientMarkerHit", root, moveToll)
  7. I meant deny a command as in active command not sound. Probably shouldn't have put "Sounds", but that's what I'm trying to use it for. For example if you play "sound" using command "play" If you used the command "play" again it would duplicate the sound, triplicate, ect. which is what I'd be trying to prevent.
  8. If you create a command to play a sound how do you stop the sound from being played again and overlapping? Basically asking how do you deny a command that is already active.
×
×
  • Create New...