SERVERSIDE
function alarm(thePlayer, seat)
local x,y,z = getElementPosition(source)
if isVehicleLocked (source) then
triggerClientEvent ( "Alarm", root, x, y, z ) --Quite el cancelEvent por que el vehículo ya esta bloqueado y reemplaze getRootElement por la variable 'root'.
end
end
addEventHandler("onVehicleStartEnter", root,alarm)
Clientside
function Alarm(x,y,z)
local nv = playSound3D("alarm.mp3", x,y,z, false)
setSoundVolume(nv, 0.5)
setSoundMaxDistance(nv, 20)
end
addEvent("Alarm",true)
addEventHandler( "Alarm", root, Alarm)