Tony Brand

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tony Brand

  • Rank
    Square
  1. channelTable = { ["The Beat FM"] = "http://thebeat.no/thebeatlisten.m3u", [1] = "The Beat FM", ["101.9FM Chicago - The Mix"] = "http://playerservices.streamtheworld.com/pls/WTMXFM.pls", [2] = "101.9FM Chicago - The Mix", ["100.3FM Chicago - Rewind"] = "http://playerservices.streamtheworld.com/pls/WILVFM.pls", [3] = "100.3FM Chicago - Rewind", } local veh = getPedOccupiedVehicle(localPlayer) function onClientChangeStreamState_Handler() local veh = getPedOccupiedVehicle(localPlayer) if isPedInVehicle(localPlayer) then if getVehicleController(veh) == localPlayer then if(source == radioPlayerPlayButton) then if iAllowed == false then showWarning("Please Wait few seconds!") return false end iAllowed = false setTimer(setAllowed, 5000, 1) if Stream[veh] == nil then triggerServerEvent("sendSoundForAll", localPlayer, veh, currentChannel, radioVolume) guiSetVisible(radioPlayerPlayButton, false) guiSetVisible(radioPlayerStopButton, true) isMouseOverStop = true end elseif(source == radioPlayerStopButton) then if Stream[veh] then triggerServerEvent("getSoundStopForAll", veh) guiSetVisible(radioPlayerStopButton, false) guiSetVisible(radioPlayerPlayButton, true) guiSetText(radioMetaArtistLabel, "Artist: "..streamArtist) guiSetText(radioMetaTitleLabel, "Title: "..streamTitle) end end end end end addEventHandler("onClientGUIClick", getRootElement(), onClientChangeStreamState_Handler)
  2. errors solved but now there are 4 warnings in debugscript gui and music doesn't play! https://pasteboard.co/HDRcH1e.png the part of that client side that made errors: addEvent("syncradio", true) addEventHandler("syncradio", root, function( ) local x, y, z = getElementPosition(source) Stream[source] = playSound3D(channelTable[channelTable[path]], x, y, z) setSoundEffectEnabled ( Stream[source], "compressor", true ) sPath[source] = path setSoundVolume(Stream[source], volume) setSoundMaxDistance(Stream[source], 50) attachElements(Stream[source], source) end)
  3. hi, i am newbie in lua, i want to make a radio system that plays sound from vehicle for all players so i downloaded radio :O system from here but it doesn't have server side, so i made it my problem is that i get error when running resource but i think i don't have any mitake... error is Bad argument radio/server.lua:2 @ 'addEventHandler' [Expected function at argument 3, got nill] & radio/server.lua:10@ 'addEventHandler' [Expected function at argument 3, got nill] whole the server side is this: addEvent("getSoundStopForAll", true) addEventHandler("getSoundStopForAll", root, getSoundStopForAll ) function getSoundStopForAll( ) stopSound(Stream[source]) Stream[source] = nil sPath[source] = nil end addEvent("sendSoundForAll", true) addEventHandler("sendSoundForAll", root, sendSoundForAll ) function sendSoundForAll( ) triggerClientEvent(root, "syncradio", sendSoundForAll) end also here is syncradio ClientEvent addEvent("syncradio", true) addEventHandler("syncradio", root, function( ) local x, y, z = getElementPosition(source) Stream[source] = playSound3D(channelTable[channelTable[path]], x, y, z) setSoundEffectEnabled ( Stream[source], "compressor", true ) sPath[source] = path setSoundVolume(Stream[source], volume) setSoundMaxDistance(Stream[source], 50) attachElements(Stream[source], source) end)
  4. Tony Brand

    setSoundMaxDistance Problem

    tnx ❤️ fixed
  5. Tony Brand

    setSoundMaxDistance Problem

    it has no error but again whole the server can hear the sound
  6. Tony Brand

    setSoundMaxDistance Problem

    addEvent("syncSong", true) addEventHandler("syncSong", root, function( ) local x,y,z = getElementPosition( ) local song = playSound3D("data/sound.mp3", x, y, z, false) setSoundVolume(song, 0.9) setSoundMaxDistance( song, 100 ) end) where i did wrong?
  7. Tony Brand

    setSoundMaxDistance Problem

    There is currently no text in this page , it is what i see in getPlayerPosition
  8. Tony Brand

    setSoundMaxDistance Problem

    so it must change to local song = playSound3D("data/sound.mp3", false)
  9. Tony Brand

    setSoundMaxDistance Problem

    Hi, i made a function called syncSong it works like this: addEvent("syncSong", true) addEventHandler("syncSong", root, function( ) local song = playSound("data/sound.mp3", false) setSoundVolume(song, 0.9) setSoundMaxDistance(song, 2) end) as you see i setSoundMaxDistance(song, 2) so now sound must be played in a short range!but problem is when players use that command thats trigger this event,sound plays for whole server in every place! also here is the CommandHandler addCommandHandler( "alarm", triggerClientEvent("syncSong", getRootElement()) etc(another codes under this line...)
  10. Tony Brand

    [REL]A Dynamic MySQL based housesystem

    can you add any cmd or option for house owners to change House Price & make House for sell for another players?
  11. Tony Brand

    [REL] Business System v1.3.1 - OOP, MySQL

    bad argument #1 to 'ipairs' (table expected, got boolean) i have this error on resource start and resource won't work! it happens on Sqlite & Sql