Ryosuke Posted October 4, 2017 Share Posted October 4, 2017 Hi, I'm trying to develop a realistic speaker system. but there is a problem, I can not move the component as it plays -- HELP ME PLS local working = true local stream = playSound("http://91.121.157.114:8421/stream") local moveOn = true function toggleRadio() working = not working if working == false then moveOn = false setSoundVolume(stream, 0) else moveOn = true setSoundVolume(stream, 1) end end bindKey("r","down",toggleRadio) function move() local theVeh = getPedOccupiedVehicle(localPlayer) local getComponent = getVehicleComponents(theVeh) if (theVeh) then for k in pairs (getComponent) do if (k == "alto") then if (not components["alto"]) then local x, y, z = getVehicleComponentPosition(theVeh, k) if (working) then local ls = getSoundLevelData(stream); if (ls ~= false) then if moveOn == true then setVehicleComponentPosition(theVeh,"alto", ls/-100, y, z) end end end end end end end end addEventHandler("onVehicleEnter",root,move) Link to comment
Mr.Loki Posted October 4, 2017 Share Posted October 4, 2017 I don't see a "components" table in your code anywhere and I also don't see any "alto" vehicle component in the vehicle components list ._. https://wiki.multitheftauto.com/wiki/Vehicle_Components Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now