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

Wysłany: 2017-10-25, 15:58


TheAxoTV







Wiek: 25
Na forum: 3796 dni
Posty: 4
Nick w MP: TheAxoTV



Respekt: 55,3

Witam, mam pytanie jak zrobi? aby ten kod dzia?a? tylko podczas pracowania na danej pracy.

local streamedInVehicles = { }

function onStreamIn ( )
    if ( getElementType source ) == "vehicle" then
        for indexvehicle in ipairs streamedInVehicles ) do
            if ( isElementCollidableWith vehiclesource ) ) then
                setElementCollidableWith vehiclesourcefalse )
            end
        end
        table.insert streamedInVehiclessource )
    end
end
addEventHandler "onClientElementStreamIn"rootonStreamIn )

function onStreamOut ( )
    if ( getElementType source ) == "vehicle" then
        for indexvehicle in ipairs streamedInVehicles ) do
            if ( source == vehicle then
                table.remove streamedInVehiclesindex )
            end
        end
    end
end
addEventHandler "onClientElementStreamOut"rootonStreamOut )


Komentarz _Haze dodany 2017-10-25, 16:01dodano tag [lua][/lua]
Ostatnio zmieniony przez _Haze 2017-10-25, 16:00, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-25, 16:02


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

usu? table.insert ( streamedInVehicles, source ) i w pracy dodawaj do tabeli auto

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-25, 16:19


TheAxoTV







Wiek: 25
Na forum: 3796 dni
Posty: 4
Nick w MP: TheAxoTV



Respekt: 55,3

Ten kod ju? dzia?a, ale wywala b??d w linijce 6

 local streamedInVehicles = { }

function onStreamIn ( )
    if ( getElementType source ) == "vehicle" then
        for indexvehicle in ipairs streamedInVehicles ) do
            if ( isElementCollidableWith vehiclesource ) ) then
                setElementCollidableWith vehiclesourcefalse )
            end
        end
        table.insert streamedInVehiclessource )
    end
end
addEventHandler "onClientElementStreamIn"resourceRootonStreamIn )

function onStreamOut ( )
    if ( getElementType source ) == "vehicle" then
        for indexvehicle in ipairs streamedInVehicles ) do
            if ( source == vehicle then
                table.remove streamedInVehiclesindex )
            end
        end
    end
end
addEventHandler "onClientElementStreamOut"resourceRootonStreamOut 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-26, 16:43


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

podaj tre?? b??du

Postaw piwo autorowi tego posta
 

 
Tagi: przenikanie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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