DzMGZXL Posted October 15, 2014 Share Posted October 15, 2014 Hello! So i want make the script when player lock car it's play sound anyone can help me?This is the part from my car lock script!Anyone can script in it lock sound please? function lockUnlockOutside(vehicle) if (not source or exports.global:isPlayerAdmin(source)) or ( getElementData(vehicle, "Impounded") or 0 ) == 0 then local dbid = getElementData(vehicle, "dbid") if (isVehicleLocked(vehicle)) then setVehicleLocked(vehicle, false) exports.global:sendLocalMeAction(source, "presses on the key to unlock the vehicle. ((" .. getVehicleName(vehicle) .. "))") exports.logs:dbLog(source, 31, { vehicle }, "UNLOCK FROM OUTSIDE") if not (exports.global:hasItem(source, 3, dbid) or (getElementData(source, "faction") > 0 and getElementData(source, "faction") == getElementData(vehicle, "faction"))) then exports.logs:logMessage("[CAR-UNLOCK] car #" .. dbid .. " was unlocked by " .. getPlayerName(source), 21) end else setVehicleLocked(vehicle, true) exports.global:sendLocalMeAction(source, "presses on the key to lock the vehicle. ((" .. getVehicleName(vehicle) .. "))") exports.logs:dbLog(source, 31, { vehicle }, "LOCK FROM OUTSIDE") if not (exports.global:hasItem(source, 3, dbid) or (getElementData(source, "faction") > 0 and getElementData(source, "faction") == getElementData(vehicle, "faction"))) then exports.logs:logMessage("[CAR-LOCK] car #" .. dbid .. " was locked by " .. getPlayerName(source), 21) end end if (storeTimers[vehicle] == nil) or not (isTimer(storeTimers[vehicle])) then storeTimers[vehicle] = setTimer(storeVehicleLockState, 180000, 1, vehicle, dbid) end end end addEvent("lockUnlockOutsideVehicle", true) addEventHandler("lockUnlockOutsideVehicle", getRootElement(), lockUnlockOutside) Link to comment
#RooTs Posted October 15, 2014 Share Posted October 15, 2014 you can use what is already ready viewtopic.php?f=108&t=81322 Link to comment
#RooTs Posted October 15, 2014 Share Posted October 15, 2014 Download in https://community.multitheftauto.com/ind ... s&id=10194 Link to comment
-.Paradox.- Posted October 16, 2014 Share Posted October 16, 2014 LekRoots don't post if you don't know how you're going to help him Get the position of the car with getElementPosition play the locking sound using playSound3D Also use this to change max sound distance so it will not be heard by all the players around the server setSoundMaxDistance and finally use this to attach the 3d sound to the car attachElements 1 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