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

Wysłany: 2016-05-07, 07:17


amama5







Wiek: 39
Na forum: 4886 dni
Posty: 57
Nick w MP: kamiloooswas

Piwa: 2

Respekt: 40,5

Ostrzeżeń: 100%
Temat do zamkni?cia.

Ostatnio zmieniony przez amama5 2016-05-07, 12:27, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-07, 08:41


Emm

***** ***






Wiek: 32
Na forum: 4021 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6171

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
            if getElementData(v,"dokupienia1") then return end

W c-side zmie? to na swoj? elementDat? pojazd?w, kt?re s? w salonie do kupienia. Je?eli takowej nie maj? - nadaj j?.

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-07, 09:51


amama5







Wiek: 39
Na forum: 4886 dni
Posty: 57
Nick w MP: kamiloooswas

Piwa: 2

Respekt: 40,5

Ostrzeżeń: 100%
Dzi?ki za pomoc

Ostatnio zmieniony przez amama5 2016-05-07, 12:28, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-07, 12:20


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
amama5, C-Side



local w,h = guiGetScreenSize()
local rowery = {[509]=true,[481]=true,[510]=true}

function gui()
    local v = getPedOccupiedVehicle(localPlayer)
    if getVehicleOverrideLights(v) ~= 2 then
        w1 = "Zapal ?wiat?a"
    else
        w1 = "Zga? ?wiat?a"
    end
        
    local silnik = getVehicleEngineState(v)
    if silnik == false then
        w2 = "Zapal silnik"
    else
        w2 = "Zga? silnik"
    end
        
    local drzwi = isVehicleLocked(v)
    if drzwi == true then
        w3 = "Otw?rz drzwi"
    else
        w3 = "Zamknij drzwi"
    end
    
    if isElementFrozen(v) then
        w4 = "Spu?? r?czny"
    else
        w4 = "Zaci?gnij r?czny"
    end
    
    if getVehicleDoorOpenRatio(v,0) == 0 then
        w5 = "Otw?rz mask?"
    else
        w5 = "Zamknij mask?"
    end
    
    if getVehicleDoorOpenRatio(v,1) == 0 then
        w6 = "Otw?rz baga?nik"
    else
        w6 = "Zamknij baga?nik"
    end

    r1,r2,r3,r4,r5,r6 = 2,2,2,2,2,2
    local wybor = getElementData(localPlayer,"wybor")
    if wybor == 1 then
        r1 = 2.5
    elseif wybor == 2 then
        r2 = 2.5
    elseif wybor == 3 then
        r3 = 2.5
    elseif wybor == 4 then
        r4 = 2.5
    elseif wybor == 5 then
        r5 = 2.5
    elseif wybor == 6 then
        r6 = 2.5
    end
    
    dxDrawText(w1, w * 0.0000, h * 0.30, w * 0.2266, h * 0.3278, tocolor(255, 255, 255, 255), r1, "default", "center", "top", false, false, false, false, false)
    dxDrawText(w2, w * 0.0000, h * 0.35, w * 0.2266, h * 0.3278, tocolor(255, 255, 255, 255), r2, "default", "center", "top", false, false, false, false, false)
    dxDrawText(w3, w * 0.0000, h * 0.40, w * 0.2266, h * 0.3278, tocolor(255, 255, 255, 255), r3, "default", "center", "top", false, false, false, false, false)
    
    local sx,sy,sz = getElementVelocity(v)
    local kmhs = math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
    if kmhs < 20 then
        setElementData(localPlayer,"maxwybor",6)
        dxDrawText(w4, w * 0.0000, h * 0.45, w * 0.2266, h * 0.3278, tocolor(255, 255, 255, 255), r4, "default", "center", "top", false, false, false, false, false)
        dxDrawText(w5, w * 0.0000, h * 0.50, w * 0.2266, h * 0.3278, tocolor(255, 255, 255, 255), r5, "default", "center", "top", false, false, false, false, false)
        dxDrawText(w6, w * 0.0000, h * 0.55, w * 0.2266, h * 0.3278, tocolor(255, 255, 255, 255), r6, "default", "center", "top", false, false, false, false, false)
    else
        setElementData(localPlayer,"maxwybor",3)
    end
end

function wybor1(key,state)
    if state == "down" then
        if getElementData(localPlayer,"wybor") == 1 then return end
        setElementData(localPlayer,"wybor",getElementData(localPlayer,"wybor")-1)
    end
end
function wybor2(key,state)
    if state == "down" then
        if getElementData(localPlayer,"wybor") == getElementData(localPlayer,"maxwybor") then return end
        setElementData(localPlayer,"wybor",getElementData(localPlayer,"wybor")+1)
    end
end

function pokazinterakcje(value)
    local v = getPedOccupiedVehicle(localPlayer)
    if v and getVehicleController(v) == localPlayer then
        if getElementData(v,'vehicle.selling') then return end
        if rowery[getElementModel(v)] then return end
        if value == true then
            if getElementData(v,"dokupienia1") then return end
            addEventHandler("onClientRender",root,gui)
            bindKey("arrow_u","both",wybor1)
            bindKey("arrow_d","both",wybor2)
        elseif value == false then
            if getElementData(v,"dokupienia1") then return end
            removeEventHandler("onClientRender",root,gui)
            unbindKey("arrow_u","both",wybor1)
            unbindKey("arrow_d","both",wybor2)
        end
    end
end
bindKey("lshift", "both", function(key,state)
    if state == "down" then
        pokazinterakcje(true)
        setElementData(localPlayer,"wybor",1)
    elseif state == "up" then
        wybierz()
        pokazinterakcje(false)
    end
end)

function wybierz()
    local wybrano = getElementData(localPlayer,"wybor")
    local v = getPedOccupiedVehicle(localPlayer)
    if not v then return end
    if v and getVehicleController(v) == localPlayer then
        if wybrano == 1 then
            triggerServerEvent("?wiat?a", localPlayer)
        elseif wybrano == 2 then
            triggerServerEvent("silnik", localPlayer)    
        elseif wybrano == 3 then
            triggerServerEvent("drzwi", localPlayer)
        elseif wybrano == 4 then
            triggerServerEvent("r?czny", localPlayer)
        elseif wybrano == 5 then
            triggerServerEvent("maska", localPlayer)
        elseif wybrano == 6 then
            triggerServerEvent("baga?nik", localPlayer)
        end
    end
end

function zamknij(plr,seat)
    if plr ~= localPlayer then return end
    if seat ~= 0 then return end
    removeEventHandler("onClientRender",root,gui)
    unbindKey("arrow_u","both",wybor1)
    unbindKey("arrow_d","both",wybor2)
end
addEventHandler("onClientVehicleStartExit",root,zamknij)
addEventHandler("onClientVehicleExit",root,zamknij)

fileDelete("c.lua")


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-05-07, 12:27


amama5







Wiek: 39
Na forum: 4886 dni
Posty: 57
Nick w MP: kamiloooswas

Piwa: 2

Respekt: 40,5

Ostrzeżeń: 100%
_Wicek_,
Dzi?kuj? za pomoc masz :piwo:

Postaw piwo autorowi tego posta
 

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