Jump to content

SjoerdPSV

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by SjoerdPSV

  1. Is anyone able to fix the download page on the site?
  2. I want to thank everyone for the help, I already fixed it.
  3. Thanks for the quick response, but I still have the same error.
  4. Hello, I've got this speaker script: (Client:) ------------------------------------------ -- Author: xXMADEXx -- -- Name: 3D Speakers 2.0 -- -- File: client.lua -- -- Copywrite 2013 ( C ) Braydon Davis -- ------------------------------------------ -- Decompile Security -- sec = {{{{{{},{},{},{}}}}}} -- ------------------------------ -- Variables -- ------------------------------ local subTrackOnSoundDown = 0.1 -- The volume that goes down, when the player clicks "Volume -" local subTrackOnSoundUp = 0.1 -- The volume that goes up, when the player clicks "Volume +" ------------------------------ -- The GUI -- ------------------------------ local rx, ry = guiGetScreenSize ( ) button = { } window = guiCreateWindow( ( rx - 295 ), ( ry / 2 - 253 / 2 ), 293, 253, "Speakers", false) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) CurrentSpeaker = guiCreateLabel(8, 33, 254, 17, "Do you have a currently have a speaker: No", false, window) volume = guiCreateLabel(10, 50, 252, 17, "Current Volume: 100%", false, window) pos = guiCreateLabel(10, 66, 252, 15, "X: 0 | Y: 0 | Z: 0", false, window) guiCreateLabel(11, 81, 251, 15, "URL:", false, window) url = guiCreateEdit(11, 96, 272, 23, "", false, window) --url = guiCreateEdit(11, 96, 272, 23, "http://roscripts.netau.net/sound.mp3", false, window) -- (This link may not work, by the time you get the script) button["place"] = guiCreateButton(9, 129, 274, 20, "Create Speaker", false, window) button["remove"] = guiCreateButton(9, 159, 274, 20, "Destroy Speaker", false, window) button["v-"] = guiCreateButton(9, 189, 128, 20, "Volume -", false, window) button["v+"] = guiCreateButton(155, 189, 128, 20, "Volume +", false, window) button["close"] = guiCreateButton(9, 219, 274, 20, "Exit", false, window) -------------------------- -- My sweet codes -- -------------------------- local isSound = false addEvent ( "onPlayerViewSpeakerManagment", true ) addEventHandler ( "onPlayerViewSpeakerManagment", root, function ( current ) local toState = not guiGetVisible ( window ) guiSetVisible ( window, toState ) showCursor ( toState ) if ( toState == true ) then guiSetInputMode ( "no_binds_when_editing" ) local x, y, z = getElementPosition ( localPlayer ) guiSetText ( pos, "X: "..math.floor ( x ).." | Y: "..math.floor ( y ).." | Z: "..math.floor ( z ) ) if ( current ) then guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true else guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == button["close"] ) then guiSetVisible ( window, false ) showCursor ( false ) elseif ( source == button["place"] ) then if ( isURL ( ) ) then triggerServerEvent ( "onPlayerPlaceSpeakerBox", localPlayer, guiGetText ( url ), isPedInVehicle ( localPlayer ) ) guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true guiSetText ( volume, "Current Volume: 100%" ) else outputChatBox ( "You need to enter a URL.", 255, 0, 0 ) end elseif ( source == button["remove"] ) then triggerServerEvent ( "onPlayerDestroySpeakerBox", localPlayer ) guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) isSound = false guiSetText ( volume, "Current Volume: 100%" ) elseif ( source == button["v-"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) - subTrackOnSoundDown, 2 ) if ( toVol > 0.0 ) then outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" ) else outputChatBox ( "The volume cannot go any lower.", 255, 0, 0 ) end end elseif ( source == button["v+"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) + subTrackOnSoundUp, 2 ) if ( toVol < 1.1 ) then outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" ) else outputChatBox ( "The volume cannot go any higher.", 255, 0, 0 ) end end end end ) speakerSound = { } addEvent ( "onPlayerStartSpeakerBoxSound", true ) addEventHandler ( "onPlayerStartSpeakerBoxSound", root, function ( who, url, isCar ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end local x, y, z = getElementPosition ( who ) speakerSound [ who ] = playSound3D ( url, x, y, z, true ) setSoundVolume ( speakerSound [ who ], 1 ) setSoundMinDistance ( speakerSound [ who ], 13 ) local int = getElementInterior ( who ) setElementInterior ( speakerSound [ who ], int ) setElementDimension ( speakerSound [ who ], getElementDimension ( who ) ) if ( isCar ) then local car = getPedOccupiedVehicle ( who ) attachElements ( speakerSound [ who ], car, 0, 5, 1 ) end end ) addEvent ( "onPlayerDestroySpeakerBox", true ) addEventHandler ( "onPlayerDestroySpeakerBox", root, function ( who ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end end ) -------------------------- -- Volume -- -------------------------- addEvent ( "onPlayerChangeSpeakerBoxVolumeC", true ) addEventHandler ( "onPlayerChangeSpeakerBoxVolumeC", root, function ( who, vol ) if ( isElement ( speakerSound [ who ] ) ) then setSoundVolume ( speakerSound [ who ], tonumber ( vol ) ) end end ) function isURL ( ) if ( guiGetText ( url ) ~= "" ) then return true else return false end end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function maxdistanceFunc(command, param) setSoundMaxDistance( speakerSound, tonumber(param)) end addCommandHandler("distance", maxdistanceFunc) (Didn't add the server script, because it's not necessary.) I want to set the MaxDistance with a command, so I added this at the bottom of the script: function maxdistanceFunc(command, param) setSoundMaxDistance( speakerSound, tonumber(param)) end addCommandHandler("distance", maxdistanceFunc) But it gives an error when I'm using /distance . I also tested it on an other script (with an other command) and in that script it works fine. SS of the error:
  5. Hello, Yesterday I downloaded a speaker script and I made some changes for the distance etc. But today I was thinking of a new option in the GUI to set the distance, so I added the an edit box to enter the distance for the speaker and tried some things in the script but it isn't working. What should I add? This is the whole client side: ------------------------------------------ -- Author: xXMADEXx -- -- Name: 3D Speakers 2.0 -- -- File: client.lua -- -- Copywrite 2013 ( C ) Braydon Davis -- ------------------------------------------ -- Decompile Security -- sec = {{{{{{},{},{},{}}}}}} -- ------------------------------ -- Variables -- ------------------------------ local subTrackOnSoundDown = 0.1 -- The volume that goes down, when the player clicks "Volume -" local subTrackOnSoundUp = 0.1 -- The volume that goes up, when the player clicks "Volume +" ------------------------------ -- The GUI -- ------------------------------ local rx, ry = guiGetScreenSize ( ) button = { } window = guiCreateWindow( ( rx - 295 ), ( ry / 2 - 253 / 2 ), 293, 313, "Speakers", false) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) CurrentSpeaker = guiCreateLabel(8, 33, 254, 17, "Do you have a currently have a speaker: No", false, window) volume = guiCreateLabel(10, 50, 252, 17, "Current Volume: 100%", false, window) pos = guiCreateLabel(10, 66, 252, 15, "X: 0 | Y: 0 | Z: 0", false, window) guiCreateLabel(11, 81, 251, 15, "URL:", false, window) url = guiCreateEdit(11, 96, 272, 23, "", false, window) --url = guiCreateEdit(11, 96, 272, 23, "http://roscripts.netau.net/sound.mp3", false, window) -- (This link may not work, by the time you get the script) button["place"] = guiCreateButton(9, 129, 274, 20, "Create Speaker", false, window) button["remove"] = guiCreateButton(9, 159, 274, 20, "Destroy Speaker", false, window) button["v-"] = guiCreateButton(9, 189, 128, 20, "Volume -", false, window) button["v+"] = guiCreateButton(155, 189, 128, 20, "Volume +", false, window) button["close"] = guiCreateButton(9, 219, 274, 20, "Exit", false, window) guiCreateLabel(9, 249, 284, 20, "Reach:", false, window) reach = guiCreateEdit(11, 269, 284, 20, "", false, window) -------------------------- -- My sweet codes -- -------------------------- local isSound = false addEvent ( "onPlayerViewSpeakerManagment", true ) addEventHandler ( "onPlayerViewSpeakerManagment", root, function ( current ) local toState = not guiGetVisible ( window ) guiSetVisible ( window, toState ) showCursor ( toState ) if ( toState == true ) then guiSetInputMode ( "no_binds_when_editing" ) local x, y, z = getElementPosition ( localPlayer ) guiSetText ( pos, "X: "..math.floor ( x ).." | Y: "..math.floor ( y ).." | Z: "..math.floor ( z ) ) if ( current ) then guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true else guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == button["close"] ) then guiSetVisible ( window, false ) showCursor ( false ) elseif ( source == button["place"] ) then if ( isURL ( ) ) then triggerServerEvent ( "onPlayerPlaceSpeakerBox", localPlayer, guiGetText ( url ), isPedInVehicle ( localPlayer ) ) guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true guiSetText ( volume, "Current Volume: 100%" ) else outputChatBox ( "You need to enter a URL.", 255, 0, 0 ) end elseif ( source == button["remove"] ) then triggerServerEvent ( "onPlayerDestroySpeakerBox", localPlayer ) guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) isSound = false guiSetText ( volume, "Current Volume: 100%" ) elseif ( source == button["v-"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) - subTrackOnSoundDown, 2 ) if ( toVol > 0.0 ) then outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" ) else outputChatBox ( "The volume cannot go any lower.", 255, 0, 0 ) end end elseif ( source == button["v+"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) + subTrackOnSoundUp, 2 ) if ( toVol < 1.1 ) then outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" ) else outputChatBox ( "The volume cannot go any higher.", 255, 0, 0 ) end end end end ) speakerSound = { } addEvent ( "onPlayerStartSpeakerBoxSound", true ) addEventHandler ( "onPlayerStartSpeakerBoxSound", root, function ( who, url, isCar ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end local x, y, z = getElementPosition ( who ) speakerSound [ who ] = playSound3D ( url, x, y, z, true ) setSoundVolume ( speakerSound [ who ], 1 ) setSoundMinDistance ( speakerSound [ who ], 13 ) setSoundMaxDistance ( speakerSound [ who ], reach ) local int = getElementInterior ( who ) setElementInterior ( speakerSound [ who ], int ) setElementDimension ( speakerSound [ who ], getElementDimension ( who ) ) if ( isCar ) then local car = getPedOccupiedVehicle ( who ) attachElements ( speakerSound [ who ], car, 0, 5, 1 ) end end ) addEvent ( "onPlayerDestroySpeakerBox", true ) addEventHandler ( "onPlayerDestroySpeakerBox", root, function ( who ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end end ) -------------------------- -- Volume -- -------------------------- addEvent ( "onPlayerChangeSpeakerBoxVolumeC", true ) addEventHandler ( "onPlayerChangeSpeakerBoxVolumeC", root, function ( who, vol ) if ( isElement ( speakerSound [ who ] ) ) then setSoundVolume ( speakerSound [ who ], tonumber ( vol ) ) end end ) function isURL ( ) if ( guiGetText ( url ) ~= "" ) then return true else return false end end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end And I changed some things in this part: addEvent ( "onPlayerStartSpeakerBoxSound", true ) addEventHandler ( "onPlayerStartSpeakerBoxSound", root, function ( who, url, isCar ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end local x, y, z = getElementPosition ( who ) speakerSound [ who ] = playSound3D ( url, x, y, z, true ) setSoundVolume ( speakerSound [ who ], 1 ) setSoundMinDistance ( speakerSound [ who ], 13 ) setSoundMaxDistance ( speakerSound [ who ], reach ) local int = getElementInterior ( who ) setElementInterior ( speakerSound [ who ], int ) setElementDimension ( speakerSound [ who ], getElementDimension ( who ) ) if ( isCar ) then local car = getPedOccupiedVehicle ( who ) attachElements ( speakerSound [ who ], car, 0, 5, 1 ) end end )
  6. Hello, I want to make special Car Spawners for some teams, I have the script for the spawners, but now it's working for everybody who wants to use it. Could somebody help me with this? Client: local marker = createMarker(1983.4064941406, -2811.4008789063, 3.9365081787109, 'cylinder', 1.5, 255, 255, 255, 255) local vehicles = {"S.W.A.T.", "Enforcer"} function createVehGui () MainGui = guiCreateWindow(408,203,240,349,"Spawn bike",false) guiWindowSetSizable ( MainGui, false ) VehGrid = guiCreateGridList(14,32,180,256,false,MainGui) guiGridListSetSelectionMode(VehGrid,2) _bikes = guiGridListAddColumn(VehGrid,"Bikes",0.85) Spawn = guiCreateButton(15,305,96,35,"Spawn",false,MainGui) guiSetFont(Spawn,"clear-normal") Cancel = guiCreateButton(128,305,96,35,"Cancel",false,MainGui) guiSetFont(Cancel,"clear-normal") for index, vehicle in ipairs(vehicles) do local row = guiGridListAddRow (VehGrid) guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false ) end end addEventHandler ( "onClientMarkerHit", marker, function ( hitElement ) if ( hitElement == localPlayer ) then createVehGui ( hitElement ) if ( MainGui ~= nil ) then guiSetVisible ( MainGui, true ) showCursor ( true ) guiSetInputEnabled ( true ) setElementFrozen ( hitElement, true ) end end end ) addEventHandler("onClientGUIClick", root, addEventHandler("onClientGUIDoubleClick", root, function () if (source == Spawn) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName == "S.W.A.T." then triggerServerEvent("spawnvehicle",localPlayer,601) elseif vehicleName == "Car" then triggerServerEvent("spawnvehicle",localPlayer,481) end else outputChatBox("Error: Please, select a vehicle of list.",255,0,0) end elseif (source == Cancel) then triggerEvent("closeWindow", root ) end end ) addEventHandler("onClientGUIClick", root, addEventHandler("onClientGUIDoubleClick", root, function () if ( source == VehGrid ) then local row,col = guiGridListGetSelectedItem(VehGrid) if (row and col and row ~= -1 and col ~= -1) then local vehicleName = guiGridListGetItemText(VehGrid, row, 1) if vehicleName == "Hydra" then triggerServerEvent("spawnvehicle",localPlayer,427) elseif vehicleName == "Car" then triggerServerEvent("spawnvehicle",localPlayer,481) end end end end ) addEventHandler("onClientMarkerLeave", marker, function () triggerEvent("closeWindow", root ) end ) addEvent("closeWindow", true) addEventHandler("closeWindow", root, function () guiSetVisible(MainGui, false) showCursor(false) guiSetInputEnabled(false) setElementFrozen(localPlayer, false) end ) Server: local vehicles = { } addEvent ( "spawnvehicle", true ) addEventHandler ( "spawnvehicle", root, function ( vehID ) if ( isElement ( vehicles [ source ] ) ) then destroyElement ( vehicles [ source ] ) end vehicles [ source ] = createVehicle ( vehID, getElementPosition ( source ) ) if ( vehicles [ source ] ) then setVehicleColor ( vehicles [ source ], 255, 255, 255 ) end setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) triggerClientEvent ( source, "closeWindow", root ) end )
  7. Hello, If a car explodes in my servers the wreck stays in the map. Is there a script that removes all the wrecks automically? Thanks
  8. Thanks for the help, it works
  9. Hey all, I got this script. When I start this the object is created but if I type /carrier1, notthing happens. Does anybody know what's wrong in this script? local gate = createObject(3115, -1456.8000488281, 501.39999389648, 9.8999996185303, 0, 0, 0) function moveGate(psource) local Deadusergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Admin")) then moveObject(gate, 8000, -1456.8000488281, 501.39999389648, 9.89999961853) setTimer(moveBack, 20000, 1) end end addCommandHandler('carrier1', moveGate) function moveBack() moveObject(gate, 8000, -1456.8000488281, 501.39999389648, 9.8999996185303) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStartup)
  10. Hello, I've got a problem with my map/gamemode manager in the admin panel. If I'm in the tab maps it's blank like this: Does anybody know how to fix this?
×
×
  • Create New...