Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: dzwiekowymi
1. Coś nie tak z syrenami dzwiekowymi do OSP
Mam co? nie tak z syrenami Dzwi?kowymi do OSP nie wiem dlaczego nie dzia?a

o to kodzik

[lua]
addEvent("broadcastSound3D", true)
addEventHandler("broadcastSound3D", root, function(sound,range,minrange, bliskiKomunikat, dalekiKomunikat)
local el=source
if getElementDimension(localPlayer)~=getElementDimension(el) then return end
if getElementInterior(localPlayer)~=getElementInterior(el) then return end
local x,y,z=getElementPosition(localPlayer)
local x2,y2,z2=getElementPosition(el)
local dist=getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)
if dist<range*2 then
if bliskiKomunikat and minrange and dist<minrange then
triggerEvent("onCaptionedEvent", root, bliskiKomunikat, 10)
outputChatBox(" * " .. bliskiKomunikat)
elseif dalekiKomunikat and dist<range then
triggerEvent("onCaptionedEvent", root, dalekiKomunikat, 10)
outputChatBox(" * " .. dalekiKomunikat)
end
local s=playSound3D(sound, x2,y2,z2)
setSoundMinDistance(s, minrange or 5)
setSoundMaxDistance(s, range)
end
end)


------------------------------------------------------------------ OSP

bindKey("1", "down", soundSwitch)

local soundSwitch_lu=getTickCount()-2000
local function soundSwitch()
outputDebugString("sw0")
if getTickCount()-soundSwitch_lu<2000 then return end
soundSwitch_lu=getTickCount()
local pojazd=getPedOccupiedVehicle(localPlayer)
outputDeb...