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

Wysłany: 2017-02-04, 19:59


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Witam mam taki kawa?ek kodu :


    

addEventHandler ("onClientResourceStart"resourceRoot,
function wlaczauta1()
        -- Version check
        if getVersion ().sortable "1.1.0" then
            outputChatBox"Resource is not compatible with this client." )
            return
        end

        -- Create shader
        local shadertec dxCreateShader "roadshine.fx" )

        if not shader then
            outputChatBox"Could not create shader. Please use debugscript 3" )
        else
            outputChatBox"Using technique " .. tec )

            -- Apply shader to all world textures
            engineApplyShaderToWorldTexture shader"*" )
        end
    end
)



function wylaczauta1()
engineRemoveShaderFromWorldTexture (shader"*" )

            
            destroyElement(shader)
            autoshader=nil
end






        function hehe() 
    if source==GUIEditor.checkbox[2then
    
        if guiCheckBoxGetSelected(GUIEditor.checkbox[2])==true then 
        wlaczauta1()
        elseif guiCheckBoxGetSelected(GUIEditor.checkbox[2])==false then
        wylaczauta1()
        end
        end
    end



ale wyskakuje mi w db3 takie cu?:

68 '(' expected near "wlaczauta1"

[ Dodano: 2017-02-04, 19:59 ]
Dodam, ?e 68 linijka to ta pierwsza

Ostatnio zmieniony przez venzikk 2017-02-04, 20:12, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:12


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

venzikk,
        if getVersion ().sortable "1.1.0" then
            outputChatBox"Resource is not compatible with this client." )
            return
        end
to nie jest potrzebne. Ten b??d pojawia si? jak co? jest nie tak z nawiasami poszukaj przed tym kodem co nam poda?e? bo wed?ug mnie jest dobrze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:18


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240




addEventHandler ("onClientResourceStart"resourceRoot,

    function xD()


        local shadertec dxCreateShader "roadshine.fx" )

        if not shader then

        else
            outputChatBox"Using technique " .. tec )

            engineApplyShaderToWorldTexture shader"*" )
        end
    

)

function wylaczauta1()
engineRemoveShaderFromWorldTexture (shader"*" )

            
            destroyElement(shader)
            autoshader=nil
end



    addEventHandler "onClientGUIClick",root,
    function lel() 
    if source==GUIEditor.checkbox[2then
    
        if guiCheckBoxGetSelected(GUIEditor.checkbox[2])==true then 
        xD()
        elseif guiCheckBoxGetSelected(GUIEditor.checkbox[2])==false then
        wylaczauta1()
        end
        end
    end)




Og??em to ten b??d pokazuje to w linijce nad kt?r? jest w?a?nie to:

addEventHandler ("onClientResourceStart"resourceRoot,


Gdzie bym jej nie przeni?s? tam znajdzie si? b??d.

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:24


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

venzikk, nie dziwi? si?

addEventHandler ("onClientResourceStart"resourceRoot, function ()


        local shadertec dxCreateShader "roadshine.fx" )

        if not shader then

        else
            outputChatBox"Using technique " .. tec )

            engineApplyShaderToWorldTexture shader"*" )
        end
   
)
nie dzi?kuj :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:27


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

A jak nazwa? t? funkcj? teraz ? bo mi nie idzie a potrzebuj? do checkbox'a :V

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:31


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

venzikk, to wtedy
        function nazwa()
            local shadertec dxCreateShader "roadshine.fx" )
            if not shader then
            else
                outputChatBox"Using technique " .. tec )

                engineApplyShaderToWorldTexture shader"*" )
              end
        end
   addEventHandler ("onClientResourceStart"resourceRoot,nazwa)
nie mo?esz jednocze?nie zaczyna? od addEventHandlera i deklarowa? nazwy funkcji.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:35


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

OK, a patrz jak mam teraz ten kod:

     function nazwa()
            local shadertec dxCreateShader "roadshine.fx" )
            if not shader then
            else

                engineApplyShaderToWorldTexture shader"*" )
              end
        end
   addEventHandler ("onClientResourceStart"resourceRoot,nazwa)


function wylaczauta1()
engineRemoveShaderFromWorldTexture (shader"*" )

            
            destroyElement(shader)
            autoshader=nil
end






Tutaj jest jak checkbox oznaczony jest to dzia?a shader a jak nie jesto to nie dzia?a :

addEventHandler "onClientGUIClick",root,
    function() 
    if source==GUIEditor.checkbox[2then
    
        if guiCheckBoxGetSelected(GUIEditor.checkbox[2])==true then 
        nazwa()
        elseif guiCheckBoxGetSelected(GUIEditor.checkbox[2])==false then
        wylaczauta1()
        end
        end
    end)


Co zrobi? by dzia?a?o bo si? m?cz? troch? z tym ju?

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:37


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

venzikk, a nie dzia?a ten kod? powinien chyba dzia?a?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:40


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

W?a?nie na karoserie mi dzia?a a tu jak jest pusty dzia?a i zaznaczony dzia?a :/

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:46


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

function wylaczauta1()
if shader then
engineRemoveShaderFromWorldTexture (shader"*" )    
destroyElement(shader)
autoshader=nil
end
end
i zamiast
 elseif guiCheckBoxGetSelected(GUIEditor.checkbox[2])==false then 
wystarczy else

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:50


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Dalej nic :/

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 20:56


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

venzikk,
shadertec nil
     function nazwa()
            local shadertec dxCreateShader "roadshine.fx" )
            if not shader then
            else

                engineApplyShaderToWorldTexture shader"*" )
              end
        end
   addEventHandler ("onClientResourceStart"resourceRoot,nazwa)


function wylaczauta1()
if shader then
engineRemoveShaderFromWorldTexture (shader"*" )    
destroyElement(shader)
autoshader=nil
end
end

addEventHandler "onClientGUIClick",root,
    function() 
    if source == GUIEditor.checkbox[2then
    
        if guiCheckBoxGetSelected(GUIEditor.checkbox[2]) then 
            nazwa()
        else
              wylaczauta1()
        end
        end
    end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 21:02


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Nie dzia?a wy??czenie shaderu i przy odpaleniu skryptu jest on w??czony odrazu :V

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 21:06


_Haze

Peace Yo!






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

Piwa: 2628

Respekt: 1020
Respekt: 1020

venzikk, spr?buj
shadertec nil
     function nazwa()
            local shadertec dxCreateShader "roadshine.fx" )
            if engineApplyShaderToWorldTexture shader"*" then return true end
            return false
        end


function wylaczauta1()
if shader then
engineRemoveShaderFromWorldTexture (shader"*" )    
destroyElement(shader)
shader nil
return true
end
return false
end

addEventHandler "onClientGUIClick",root,
    function() 
    if source == GUIEditor.checkbox[2then
    
        if guiCheckBoxGetSelected(sourcethen 
            if nazwa() then
                outputChatBox("daje shader")
            end
        else
              if wylaczauta1() then
                outputChatBox("usuwa shader")
            end
        end
        end
    end)
jak to nie podzia?a to nie wiem

Ostatnio zmieniony przez _Haze 2017-02-04, 21:13, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-02-04, 21:08


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Daje shader, lecz go nie usuwa potem

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Tagi: function
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