Witam serdecznie. Co jest nie tak, ?e jak w??czam pod bindem 1 syren? to zamiast w??czy? si? jedna syrena w??czaj? si? dwie. Tak samo mam jak przycisn? bind 2. W??cza si? druga jak i pierwsza. Za pomoc oczywi?cie
addEvent("onPlaySound3D",true)
addEventHandler("onPlaySound3D",root,function(veh)
for _, player in ipairs(getElementsByType("player")) do
local x,y,z = getElementPosition(veh)
snd = playSound3D ("GCBA/syrena1.mp3", x, y, z)
setSoundMaxDistance(snd, 350)
attachElements(snd,veh)
end
end
)
addEvent("onPlaySound3D_2",true)
addEventHandler("onPlaySound3D_2",root,function(auto)
for _, player in ipairs(getElementsByType("player")) do
local x,y,z = getElementPosition(auto)
cnd = playSound3D ("GCBA/syrena3.mp3", x, y, z)
setSoundMaxDistance(cnd, 350)
attachElements(cnd,auto)
end
end
)
I klapa. Klikam bind 1 w??cza si? syrena1, klikam bind 2 to te? si? w??cza syrena 1.
auta = { [407] = true }
addEventHandler("onPlayerVehicleEnter", root, function(pojazd)
if auta[getElementModel(pojazd)] then
bindKey(source, "1", "down", dzwiek, source)
end
end)
function dzwiek(gracz)
local veh = getPedOccupiedVehicle(gracz)
triggerClientEvent("onPlaySound3D",root,veh)
end
addEventHandler("onPlayerVehicleEnter", root, function(pojazd)
if auta[getElementModel(pojazd)] then
bindKey(source, "2", "down", sygnal, source)
end
end)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach