Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-09-23, 03:52


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2968 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Mam co? nie tak z syrenami Dzwi?kowymi do OSP nie wiem dlaczego nie dzia?a

o to kodzik


addEvent("broadcastSound3D"true)
addEventHandler("broadcastSound3D"root, function(sound,range,minrangebliskiKomunikatdalekiKomunikat)
    local el=source
    if getElementDimension(localPlayer)~=getElementDimension(elthen return end
    if getElementInterior(localPlayer)~=getElementInterior(elthen 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"rootbliskiKomunikat10)
            outputChatBox(" * " .. bliskiKomunikat)
        elseif dalekiKomunikat and dist<range then
            triggerEvent("onCaptionedEvent"rootdalekiKomunikat10)
            outputChatBox(" * " .. dalekiKomunikat)
        end
        local s=playSound3D(soundx2,y2,z2)
        setSoundMinDistance(sminrange or 5)
        setSoundMaxDistance(srange)
    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)
    outputDebugString("sw2")
    if pojazd and getVehicleController(pojazd)==localPlayer then
        local em=getElementModel(pojazd)
        if em==573 then
            triggerServerEvent("toggleVehicleSound"pojazd"PSP.mp3"225)
            cancelEvent()
            return
        end
    end
end


a o to db3

Kod:


waring: [Frakcje]/osp-syrenki/sirens.lua:26: Bad argument @ 'bindKey' [Expected player at argument 1,got string '1']


i meta

Kod:


<meta>

<script src="sirens.lua" type="server" />

</meta>


Za pomoc respekcik i zmine :piwo:

a jak kod jest z?y prosi? bym o dodanie lub danie jakiego? innego pod id pojazdu 573 (dune) b?d? wdzi?czny :D

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-23, 08:35


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Zobacz to

local soundSwitch_lu=getTickCount()-2000

bindKey("1""down", function()
    outputDebugString("sw0")
    if getTickCount()-soundSwitch_lu<2000 then return end
    soundSwitch_lu=getTickCount()
    local pojazd=getPedOccupiedVehicle(localPlayer)
    outputDebugString("sw2")
    if pojazd and getVehicleController(pojazd)==localPlayer then
        local em=getElementModel(pojazd)
        if em==573 then
            triggerServerEvent("toggleVehicleSound"pojazd"PSP.mp3"225)
            cancelEvent()
            return
        end
    end
end


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-23, 14:03


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2968 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Nie dzia?a

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-23, 14:28


Allansso







Wiek: 24
Na forum: 3938 dni
Posty: 386

Piwa: 1537

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 100%
Podmie? sobie po to i powinno dzia?a? :eye:

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)
    outputDebugString("sw2")
    if pojazd and getVehicleController(pojazd)==localPlayer then
        local em=getElementModel(pojazd)
        if em==596 then -- 596 zmieniasz na swoje id pojazdu
            triggerServerEvent("toggleVehicleSound"pojazd"300-90.ogg"225) -- 300-90.ogg zmieniasz na sw?j plik dzwi?kowy
            cancelEvent()
            return
        end
    end
end
bindKey("1""down"soundSwitch)


Podpis
https://www.youtube.com/TheMikol
https://www.facebook.com/TheMikol1337
Postaw piwo autorowi tego posta
 

 
Tagi: coś :: nie :: tak :: syrenami :: dzwiekowymi :: osp
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku