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

Wysłany: 2017-06-12, 21:38


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

pokaz ca?y ten kod wy?wietlania

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-12, 21:41


Janusz_GRA

NO NAME






Wiek: 26
Na forum: 3857 dni
Posty: 223
Nick w MP: michalMonster

Piwa: 175

Respekt: 85,8

amited,
local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,function()
    if getPedOccupiedVehicle(localPlayer) then
        if getVehicleController(getPedOccupiedVehicle(localPlayer))==localPlayer then
            local paliwo=getElementData(getPedOccupiedVehicle(localPlayer),"pojazd_paliwo") or "Brak"
            local przebieg=getElementData(getPedOccupiedVehicle(localPlayer),"pojazd_przebieg") or "Brak"
            local id=getElementData(getPedOccupiedVehicle(localPlayer),"car_id") or "Brak"
            speedx, speedy, speedz = getElementVelocity (getPedOccupiedVehicle(localPlayer))
            actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
            kmh = actualspeed * 180
            dxDrawRectangle(screenW * 0.751, screenH * 0.751, screenW * 0.264, screenH * 0.210, tocolor(69, 77, 185, 120), false)
            dxDrawText(getVehicleName(getPedOccupiedVehicle(localPlayer)).." ID : "..id, screenW * 0.776, screenH * 0.728, screenW * 0.930, screenH * 0.744, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
            dxDrawText("Pr?dko?? : "..math.floor(kmh).." km/h", screenW * 0.776, screenH * 0.786, screenW * 0.930, screenH * 0.832, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false)
            dxDrawText("Paliwo : "..math.floor(paliwo).." L", screenW * 0.776, screenH * 0.839, screenW * 0.930, screenH * 0.886, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false)
            local przebieg = tonumber(getElementData(pojazd, "pojazd:przebieg")) or 0
            local przebieg = math.floor(przebieg) or "n/a"
            dxDrawText("Przebieg: "..przebieg.."km", screenW * 0.776, screenH * 0.891, screenW * 0.930, screenH * 0.938, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false)
        end
    end
end)


Podpis
Jeśli nie możesz czegoś zrobić dobrze, przynajmniej spraw, żeby wyglądało dobrze.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-13, 00:11


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


addEventHandler("onClientRender", root,function()
    if getPedOccupiedVehicle(localPlayer) then
        if getVehicleController(getPedOccupiedVehicle(localPlayer))==localPlayer then
            local paliwo=getElementData(getPedOccupiedVehicle(localPlayer),"pojazd_paliwo") or "Brak"
            local przebieg=getElementData(getPedOccupiedVehicle(localPlayer),"pojazd_przebieg") or "Brak"
            local id=getElementData(getPedOccupiedVehicle(localPlayer),"car_id") or "Brak"
            speedx, speedy, speedz = getElementVelocity (getPedOccupiedVehicle(localPlayer))
            actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
            kmh = actualspeed * 180
            dxDrawRectangle(screenW * 0.751, screenH * 0.751, screenW * 0.264, screenH * 0.210, tocolor(69, 77, 185, 120), false)
            dxDrawText(getVehicleName(getPedOccupiedVehicle(localPlayer)).." ID : "..id, screenW * 0.776, screenH * 0.728, screenW * 0.930, screenH * 0.744, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)
            dxDrawText("Pr?dko?? : "..math.floor(kmh).." km/h", screenW * 0.776, screenH * 0.786, screenW * 0.930, screenH * 0.832, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false)
            dxDrawText("Paliwo : "..math.floor(paliwo).." L", screenW * 0.776, screenH * 0.839, screenW * 0.930, screenH * 0.886, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false)
            local przebieg = tonumber(getElementData(getPedOccupiedVehicle(localPlayer), "pojazd:przebieg")) or 0
            local przebieg = math.floor(przebieg) or "n/a"
            dxDrawText("Przebieg: "..przebieg.."km", screenW * 0.776, screenH * 0.891, screenW * 0.930, screenH * 0.938, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, true, false, false)
        end
    end
end)

dales pojazd jak tutaj nigdzie nie jest on opisany...

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-13, 15:06


Janusz_GRA

NO NAME






Wiek: 26
Na forum: 3857 dni
Posty: 223
Nick w MP: michalMonster

Piwa: 175

Respekt: 85,8

amited, Teraz ju? ?aden b??d nie wyskakuje ale nie nalicza si? przebieg.

[ Dodano: 2017-06-13, 15:36 ]
ju? nalicza przebieg. Pomo?e kto? z tym drugim problemem z prawej jazdy?

Podpis
Jeśli nie możesz czegoś zrobić dobrze, przynajmniej spraw, żeby wyglądało dobrze.
Postaw piwo autorowi tego posta
 

 
Tagi: przebieg :: oraz :: prawko
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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