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

Wysłany: 2019-12-04, 14:52


kewciu1217







Wiek: 24
Na forum: 3424 dni
Posty: 35
Nick w MP: MrKewciu

Piwa: 7

Respekt: 50

local m_dostep="mechanik-sf1"
local m_maluje=false
local m=createMarker(2058.35, -1834.8413.55-1"cylinder"1.5,255,215,0,75)
local m2=createMarker(2058.35, -1832.6413.55-1"cylinder"1.5,255,215,0,75)
local m3=createMarker(2058.35, -1830.413.55-1"cylinder"1.5,255,215,0,75)
local m4=createMarker(2058.35, -1828.2513.55-1"cylinder"1.5,255,215,0,75)
local cs=createColCuboid2053.32, -1837.131218,11,10)

local t=createElement("text")
    setElementData(t,"name","Lakiernia\nKolor 1")
    setElementData(t,"scale",0.9)
    setElementPosition(t,2058.35, -1834.8413.55+1)
local t2=createElement("text")
    setElementData(t2,"name","Lakiernia\nKolor 2")
    setElementData(t2,"scale",0.9)
    setElementPosition(t2,2058.27, -1832.6413.55+1)
local t3=createElement("text")
    setElementData(t3,"name","Lakiernia\nFelgi\n[PREMIUM,PREMIUM+]")
    setElementData(t3,"scale",0.9)
    setElementPosition(t3,2058.19, -1830.413.55+1)
local t4=createElement("text")
    setElementData(t4,"name","Lakiernia\nRanty Felg\n[PREMIUM,PREMIUM+]")
    setElementData(t4,"scale",0.9)
    setElementPosition(t4,2058.16, -1828.2513.55+1)


-- Functions
addEventHandler("onClientColShapeHit"cs, function(el,md)
    if not md or el~=localPlayer then return end
    toggleControl("aim_weapon",true)
    toggleControl("fire",true)
    m_maluje=true
end)

addEventHandler("onClientColShapeLeave"cs, function(el,md)
    if not md or el~=localPlayer then return end
    toggleControl("aim_weapon",false)
    toggleControl("fire",false)
    triggerServerEvent("takeSpray"localPlayer)
    m_maluje=false
    closePicker(el)
end)

addEventHandler("onClientMarkerHit"m, function(el,md)
    if not m or el~=localPlayer then return end
    openPicker(el"#FFFFFF""Wybierz kolor lakierowania")
    triggerServerEvent("giveSpray"localPlayer)
    
    addEventHandler("onColorPickerOK"root, function(elhexrgb)
        if el == localPlayer then
            setElementData(localPlayer,"spray:color4",false)
            setElementData(localPlayer,"spray:color2",false)
            setElementData(localPlayer,"spray:color3",false)
            setElementData(el,"spray:color",{r,g,b})
        end
    end)
end)

addEventHandler("onClientMarkerHit"m2, function(el,md)
    if not m2 or el~=localPlayer then return end
    openPicker(el"#FFFFFF""Wybierz kolor lakierowania")
    triggerServerEvent("giveSpray"localPlayer)

    addEventHandler("onColorPickerOK"root, function(elhexrgb)
        if el == localPlayer then
            setElementData(localPlayer,"spray:color3",false)
            setElementData(localPlayer,"spray:color4",false)
            setElementData(localPlayer,"spray:color",false)
            setElementData(el,"spray:color2",{r,g,b})
        end
    end)
end)

addEventHandler("onClientMarkerHit"m3, function(el,md)
    if not m3 or el~=localPlayer then return end
    if getElementData(player"player:vip") or getElementData(player"player:svip"then
    openPicker(el"#FFFFFF""Wybierz kolor lakierowania")
    triggerServerEvent("giveSpray"localPlayer)

    addEventHandler("onColorPickerOK"root, function(elhexrgb)
        if el == localPlayer then
            setElementData(localPlayer,"spray:color",false)
            setElementData(localPlayer,"spray:color2",false)
            setElementData(localPlayer,"spray:color4",false)
            setElementData(el,"spray:color3",{r,g,b})
        end
    end)
end)

addEventHandler("onClientMarkerHit"m4, function(el,md)
    if not m4 or el~=localPlayer then return end
    if getElementData(player"player:vip") or getElementData(player"player:svip"then
    openPicker(el"#FFFFFF""Wybierz kolor lakierowania")
    triggerServerEvent("giveSpray"localPlayer)

    addEventHandler("onColorPickerOK"root, function(elhexrgb)
        if el == localPlayer then
            setElementData(localPlayer,"spray:color",false)
            setElementData(localPlayer,"spray:color2",false)
            setElementData(localPlayer,"spray:color3",false)
            setElementData(el,"spray:color4",{r,g,b})
        end
    end)
end)


addEventHandler("onClientPlayerWeaponFire"localPlayer, function(weapon,_,_,_,_,_,el)
    if source~=localPlayer then return end
    if weapon ~= 41 then return end
    if not el then return end
    if getElementType(el) == "vehicle" and m_maluje == true then
        local spraycolor=getElementData(localPlayer,"spray:color")
        local spraycolor2=getElementData(localPlayer,"spray:color2")
        local spraycolor3=getElementData(localPlayer,"spray:color3")
        local spraycolor4=getElementData(localPlayer,"spray:color4")
        if spraycolor then
        triggerServerEvent("montazElementu"rootel"kolor", {spraycolor[1],spraycolor[2],spraycolor[3]},0)
        return end
        if spraycolor2 then
        triggerServerEvent("montazElementu"rootel"kolor2", {spraycolor2[1],spraycolor2[2],spraycolor2[3]},0)
        end
        if spraycolor3 then
        triggerServerEvent("montazElementu"rootel"kolor3", {spraycolor3[1],spraycolor3[2],spraycolor3[3]},0)
        end
        if spraycolor4 then
        triggerServerEvent("montazElementu"rootel"kolor4", {spraycolor4[1],spraycolor4[2],spraycolor4[3]},0)
        end
    end
end)


Prosze o pomoc wywala w linijce 97 jako ) co? z endami zwali?em pomo?e kto? jak powinny endy wygl?da??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-12-04, 16:54


Karolowatyy







Wiek: 25
Na forum: 3286 dni
Posty: 117
Nick w MP: Ripley

Piwa: 826

Respekt: 90

Ostrzeżeń: 20%
Zamie?
addEventHandler("onClientMarkerHit"m4, function(el,md)
    if not m4 or el~=localPlayer then return end
    if getElementData(player"player:vip") or getElementData(player"player:svip"then
    openPicker(el"#FFFFFF""Wybierz kolor lakierowania")
    triggerServerEvent("giveSpray"localPlayer)

    addEventHandler("onColorPickerOK"root, function(elhexrgb)
        if el == localPlayer then
            setElementData(localPlayer,"spray:color",false)
            setElementData(localPlayer,"spray:color2",false)
            setElementData(localPlayer,"spray:color3",false)
            setElementData(el,"spray:color4",{r,g,b})
        end
    end)
end)


Na

addEventHandler("onClientMarkerHit"m4, function(el,md)
    if not m4 or el~=localPlayer then return end
    if getElementData(player"player:vip") or getElementData(player"player:svip"then
    openPicker(el"#FFFFFF""Wybierz kolor lakierowania")
    triggerServerEvent("giveSpray"localPlayer)
    end

    addEventHandler("onColorPickerOK"root, function(elhexrgb)
        if el == localPlayer then
            setElementData(localPlayer,"spray:color",false)
            setElementData(localPlayer,"spray:color2",false)
            setElementData(localPlayer,"spray:color3",false)
            setElementData(el,"spray:color4",{r,g,b})
        end
    end)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-12-04, 17:45


kewciu1217







Wiek: 24
Na forum: 3424 dni
Posty: 35
Nick w MP: MrKewciu

Piwa: 7

Respekt: 50

zmieni?em dalej nic lecz da?em jeszcze przy m3 oraz przy premium musi by? el zamiast player ju? dzia?a thx

Postaw piwo autorowi tego posta
 

 
Tagi: zakończenia :: end :: proszę
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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