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

Wysłany: 2016-07-25, 20:08


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam pomo?e mi kto? wyskalowa? ten kod, aby licznik u ka?dego by? tam gdzie u mnie ?

local screenW, screenH = guiGetScreenSize()
local rowery = {[509]=true,[481]=true,[510]=true,}

function hud()
    local v = getPedOccupiedVehicle(localPlayer)
    if v then
        local sx,sy,sz = getElementVelocity(getPedOccupiedVehicle(localPlayer))
        local kmh = math.ceil(((sx^2+sy^2+sz^2)^(0.5))*155)
        local paliwo = getElementData(v,"pojazd_paliwo") or 0
        local przeb = getElementData(v,"pojazd_przebieg") or 0
        
        -- ogolne
        dxDrawImage(screenW * 0.6917, screenH * 0.6991, 533, 325, "images/spdmeter2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText(""..paliwo.." L", screenW * 0.7677, screenH * 0.9037, (screenW * 0.7677) + 87, ( screenH * 0.9037) + 33, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, true, false, false)
        dxDrawText(""..przeb.." km przebiegu", screenW * 0.8406, screenH * 0.9204, screenW * 0.9417, screenH * 0.9546, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText(""..kmh.." km/h", 1706, 902, 1851, 942, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, true, false, false)
        
        -- kontrolki
        if paliwo < 30 then
            r1,g1,b1 = 254,107,3
        else
            r1,g1,b1 = 255,255,255
        end
        
        if isElementFrozen(v) then
            r2,g2,b2 = 255,0,0
        else
            r2,g2,b2 = 255,255,255
        end
        
        local silnik = getVehicleEngineState(v)
        if silnik == false then
            r3,g3,b3 = 255,0,0
        else
            r3,g3,b3 = 255,255,255
        end
        
        if getVehicleOverrideLights(v) ~= 2 then
            r4,g4,b4 = 255,255,255
        else
            r4,g4,b4 = 70,184,73
        end
        

        dxDrawImage(screenW * 0.7646, screenH * 0.9481, screenW * 0.0255, screenH * 0.0306, "images/paliwo.png", 0, 0, 0, tocolor(r1, g1, b1, 255), false)
        dxDrawImage(screenW * 0.8776, screenH * 0.7389, screenW * 0.0266, screenH * 0.0407, "images/reczny.png", 0, 0, 0, tocolor(r2, g2, b2, 255), false)
        dxDrawImage(screenW * 0.8479, screenH * 0.7704, screenW * 0.0266, screenH * 0.0407, "images/silnik.png", 0, 0, 0, tocolor(r3, g3, b3, 255), false)
        dxDrawImage(screenW * 0.9094, screenH * 0.7704, screenW * 0.0266, screenH * 0.0407, "images/swiatla.png", 0, 0, 0, tocolor(r4, g4, b4, 255), false)
    end
end

addEventHandler("onClientVehicleEnter",root,function(plr)
    if plr ~= localPlayer then return end
    local v = getPedOccupiedVehicle(localPlayer)
    if rowery[getElementModel(v)] then return end
    addEventHandler("onClientRender",root,hud)
end)

addEventHandler("onClientVehicleExit",root,function(plr,seat)
    if plr ~= localPlayer then return end
    if seat ~= 0 then return end
    removeEventHandler("onClientRender",root,hud)
end)
Z g?ry dzi?ki za pomoc :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-25, 22:13


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

BlackTen, w guiEditor mo?esz tam wybra? skalowanie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 14:51


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Daje po prostu opcje "relative", bo jak tak to wlasnie nie dzia?a ;(

Postaw piwo autorowi tego posta
 

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


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

w programie np. gimp Sam licznik bez Skaz?wki przeno? po trochu i testuj a wkoncu wejdze ci idealnie

Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-27, 13:52


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Nie da si? inaczej?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-27, 14:42


Brzysiek

Skrypter pralek






Wiek: 28
Na forum: 5340 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

Niekt?re warto?ci skalujesz a niekt?re pozostawiasz absolutne. U?ywaj?c tej metody musisz wsz?dzie u?ywa? screenW * warto??, screenH * warto?? a nie warto?ci absolutnych.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 20:38


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

No to tak robie co nie?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 21:21


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

BlackTen,
 dxDrawText(""..kmh.." km/h", 1706, 902, 1851, 942, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, true, false, false)
        

Ca?y licznik ?le jest wy?wietlany ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-28, 21:31


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

sam licznik i ikonki

Postaw piwo autorowi tego posta
 

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