Jump to content

Mawmad

Members
  • Posts

    3
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mawmad

  1. I Changed playSound("beep.mp3", false) to playSound("beep.mp3", true) And I even tried to increase the getNearestElement limit to 300 but it didn't work
  2. Wow , Thanks a Lot Mate ! Sorry and it still doesn't work... Everything seems fine, I don't know what the problem is
  3. Hello I'm Working On a Parking Sensor For MTA:SA Also I'm New To MTA And Scripting My problem is that when I start the resource and move the car in reverse gear, there is no sound Parkings.lua -- parking sensor for mta:sa function isVehicleReversing(theVehicle) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local getMatrix = getElementMatrix (theVehicle) local getVelocity = Vector3 (getElementVelocity(theVehicle)) local getVectorDirection = (getVelocity.x * getMatrix[2][1]) + (getVelocity.y * getMatrix[2][2]) + (getVelocity.z * getMatrix[2][3]) if (getVectorDirection < 0) then return true function getDistanceBetweenElements(arg1, arg2) local car = Vector3(getPedOccupiedVehicle( arg1 )) local nearObject = Vector3(getNearestElement( arg2 )) local distance = getDistanceBetweenPoints3D( car,nearObject ) if vehicle then local sound = playSound("beep.mp3") setSoundVolume(sound, 0.5) setSoundProperties(sound, 48000.0, 128.00, distance, false) return distance addEventHandler("onClientResourceStart", resourceRoot, isVehicleReversing, getDistanceBetweenElements) -- meta.xml <meta> <script src="parkings.lua" type="client" /> <file src="beep.mp3" type="client" /> </meta> What is wrong with my script?
×
×
  • Create New...