Lua
function playLockSound()
local veh = getPedOccupiedVehicle ( getLocalPlayer() )
if isPedInVehicle(getLocalPlayer()) then
if getVehicleEngineState (veh) == false then
local x,y,z = getElementPosition(veh)
local sound = playSound3D("Carsys/content/EngineStart.mp3", x, y, z, false)
attachElements(sound, veh)
else
if getVehicleEngineState (veh) == true then
local sound = playSound3D("Carsys/content/EngineStop.mp3", x, y, z, false)
attachElements(sound, veh)
end
end
end
end
addEventHandler("onClientResourceStart", getRootElement(), function()
bindKey ( "M", "down", playLockSound )
end)
Alles anzeigen
Das hab ich gemacht nun spielt es nur ENGINESTART vor abber nicht enginestop bei motor aus.Wie soll ich es machen.