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

Wysłany: 2018-08-26, 22:02


kajetan254







Wiek: 28
Na forum: 3184 dni
Posty: 42
Nick w MP: Kajetan

Piwa: 93

Respekt: 60

Witam, czy m?g?by mi kto? pom?c wstawi? 'end' aby kod dzia?a?, error z db3: https://imgur.com/Lz046fc
Za pomoc stawiam :piwo: :D
local sound = {}

function updateEngineSound() 
    local allVehicles getElementsByType("vehicle") 
    for indexveh in ipairs (allVehicles) do 
   for _,v in pairs(getElementsByType("vehicle")) do
        local model getElementModel(veh) 
        if model ==     494 then 
     if getElementData(v"vehicle:id") == 678 then
            if getVehicleEngineState(vehthen 
                if isElement(sound[veh]) then 
                    local gear getVehicleCurrentGear veh ) or 1
                    local velocityXvelocityYvelocityZ getElementVelocity(veh) 
                    local actualspeed = ((velocityX^velocityY^velocityZ^2)^(0.5)) * ((11 gear) /10)
                    local mph actualspeed 70 111.847 
                    local minSoundSpeed 0.20 
                    local soundSpeed mph/(1000+1000/minSoundSpeed) + minSoundSpeed  
                    setSoundSpeed (sound[veh], soundSpeed) 
                else
                    local xygetElementPosition(veh)
                    sound[veh] = playSound3D("sounds/engine.wav"xyztrue)
                    attachElements(sound[veh], veh)
                end 
            else
                if isElement(sound[veh]) then
                    destroyElement(sound[veh])
                end
            end
        end 
    end 
end 
addEventHandler("onClientPreRender"rootupdateEngineSound)

local sound = {}

function updateEngineSound() 
    local allVehicles getElementsByType("vehicle") 
    for indexveh in ipairs (allVehicles) do 
        local model getElementModel(veh) 
        if model ==     502 then 
            if getVehicleEngineState(vehthen 
                if isElement(sound[veh]) then 
                    local gear getVehicleCurrentGear veh ) or 1
                    local velocityXvelocityYvelocityZ getElementVelocity(veh) 
                    local actualspeed = ((velocityX^velocityY^velocityZ^2)^(0.5)) * ((11 gear) /10)
                    local mph actualspeed 70 111.847 
                    local minSoundSpeed 0.20 
                    local soundSpeed mph/(1000+1000/minSoundSpeed) + minSoundSpeed  
                    setSoundSpeed (sound[veh], soundSpeed) 
                else
                    local xygetElementPosition(veh)
                    sound[veh] = playSound3D("sounds/engine2.wav"xyztrue)
                    attachElements(sound[veh], veh)
                end 
            else
                if isElement(sound[veh]) then
                    destroyElement(sound[veh])
                end
            end
        end 
    end 
end 
addEventHandler("onClientPreRender"rootupdateEngineSound)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-26, 22:06


NyAngel







Wiek: 22
Na forum: 3950 dni
Posty: 128
Nick w MP: NyAngel

Piwa: 556

Respekt: 86,8


local sound = {}

function updateEngineSound() 
    local allVehicles getElementsByType("vehicle") 
    for indexveh in ipairs (allVehicles) do 
   for _,v in pairs(getElementsByType("vehicle")) do
        local model getElementModel(veh) 
        if model ==     494 then 
     if getElementData(v"vehicle:id") == 678 then
            if getVehicleEngineState(vehthen 
                if isElement(sound[veh]) then 
                    local gear getVehicleCurrentGear veh ) or 1
                    local velocityXvelocityYvelocityZ getElementVelocity(veh) 
                    local actualspeed = ((velocityX^velocityY^velocityZ^2)^(0.5)) * ((11 gear) /10)
                    local mph actualspeed 70 111.847 
                    local minSoundSpeed 0.20 
                    local soundSpeed mph/(1000+1000/minSoundSpeed) + minSoundSpeed  
                    setSoundSpeed (sound[veh], soundSpeed) 
                else
                    local xygetElementPosition(veh)
                    sound[veh] = playSound3D("sounds/engine.wav"xyztrue)
                    attachElements(sound[veh], veh)
                end 
            else
                if isElement(sound[veh]) then
                        destroyElement(sound[veh])
                    end
                    end
            end 
        end 
    end
end 
addEventHandler("onClientPreRender"rootupdateEngineSound)


Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: end
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » end 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