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

Wysłany: 2020-01-11, 12:54


hm..







Wiek: 26
Na forum: 2568 dni
Posty: 50
Nick w MP: Pan_Cebulka_YT

Piwa: 3

Respekt: 50,5

Ostrzeżeń: 20%
Witam chcia?bym doda? na sw?j serwer pojazd elektryczny mam ju? stacje ?adowania ale jak kupuje pojazd z salonu to jak wyjmuje z przecho to nie pokazuje % a pokazuje L a w liczniku mam ustawione na eletryka % L ((licznik z devnera)) prosze o pomoc respekt i :piwo:

Kontakt : Pan_Cebulka_YT#0802

Podpis
Aktualny Serwer : --
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-01-11, 13:38


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

No to poka? kod tego, gdzie ustalasz jaki pojazd to pojazd elektryczny i kod licznika, gdzie rozr??niasz typ pojazdu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-01-11, 14:49


hm..







Wiek: 26
Na forum: 2568 dni
Posty: 50
Nick w MP: Pan_Cebulka_YT

Piwa: 3

Respekt: 50,5

Ostrzeżeń: 20%
Wilq, ale w?a?nie nie wiem gdzie to jest

[ Dodano: 2020-01-11, 16:28 ]

local sx,sy guiGetScreenSize()
local px,py= (sx/1920), (sy/1080)

screenW,screenH guiGetScreenSize()

local animsbuiltins = {}, {"Linear""InQuad""OutQuad""InOutQuad""OutInQuad""InElastic""OutElastic""InOutElastic""OutInElastic""InBack""OutBack""InOutBack""OutInBack""InBounce""OutBounce""InOutBounce""OutInBounce""SineCurve""CosineCurve"}

function table.find(tv)
    for ka in ipairs(t) do
        if == v then
            return k
        end
    end
    return false
end

function animate(fteasingdurationonChangeonEnd)
    assert(type(f) == "number""Bad argument @ 'animate' [expected number at argument 1, got "..type(f).."]")
    assert(type(t) == "number""Bad argument @ 'animate' [expected number at argument 2, got "..type(t).."]")
    assert(type(easing) == "string" or (type(easing) == "number" and (easing >= or easing <= #builtins)), "Bad argument @ 'animate' [Invalid easing at argument 3]")
    assert(type(duration) == "number""Bad argument @ 'animate' [expected function at argument 4, got "..type(duration).."]")
    assert(type(onChange) == "function""Bad argument @ 'animate' [expected function at argument 5, got "..type(onChange).."]")
    table.insert(anims, {from fto teasing table.find(builtinseasing) and easing or builtins[easing], duration durationstart getTickCount( ), onChange onChangeonEnd onEnd})
    return #anims
end

function destroyAnimation(a)
    if anims[athen
        table.remove(animsa)
    end
end

addEventHandler("onClientRender"root, function( )
    local now getTickCount( )
    for k,v in ipairs(anims) do
        v.onChange(interpolateBetween(v.from00v.to00, (now v.start) / v.durationv.easing))
        if now >= v.start+v.duration then
            if type(v.onEnd) == "function" then
                v.onEnd( )
            end
            table.remove(animsk)
        end
    end
end)


fonts = {
    dxCreateFont("Roboto-Bold.ttf"15),
    dxCreateFont("Roboto-Light.ttf"17),

}

speedo = {

    dxCreateTexture(":pystories-licznik/bg.png","argb"true"clamp"),

}


function math.round(numberdecimalsmethod)
    decimals decimals or 0
    local factor 10 decimals
    if (method == "ceil" or method == "floor"then return math[method](number factor) / factor
    else return tonumber(("%."..decimals.."f"):format(number)) end
end

function getElementSpeed(theElementunit)
    -- Check arguments for errors
    assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")
    local elementType getElementType(theElement)
    assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile""Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")")
    assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == or tonumber(unit) == or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")
    -- Default to m/if no unit specified and 'ignore' argument type if the string contains a number
    unit unit == nil and or ((not tonumber(unit)) and unit or tonumber(unit))
    -- Setup our multiplier to convert the velocity to the specified unit
    local mult = (unit == or unit == "m/s") and 50 or ((unit == or unit == "km/h") and 180 or 111.84681456)
    -- Return the speed by calculating the length of the velocity vectorafter converting the velocity to the specified unit
    return (Vector3(getElementVelocity(theElement)) * mult).length
end

local sw,sh guiGetScreenSize()
local scale 1920 sw
addEventHandler("onClientRender"getRootElement(), function()
    local pojazd getPedOccupiedVehicle(localPlayer)
    if pojazd then
        if getVehicleName(pojazd) == "Reefer" then return end
        if getElementData(pojazd"vehicle.selling"then return end
        id getElementData(pojazd"vehicle:id") 
        local sxsysz getElementVelocity(pojazd)
        local predkosc math.ceil(((sx^2+sy^2+sz^2)^(0.5)) * 171)
        local nazwa getVehicleName(pojazd)
        local poj getElementData(pojazd"vehicle:pojemnosc") or ""
    --local speed GetVehicleSpeed() > 285 and math.random(279,280) or GetVehicleSpeed()
        local km getElementData(pojazd"vehicle:mileage") or 0
        if poj == 2 then poj 1.4 end 
        if poj == 3 then poj 1.6 end 
        if poj == 4 then poj 1.8 end 
        if poj == 5 then poj 2.2 end 
        if poj == 6 then poj 2.4 end 
        jednostka "L"
        if getVehicleName(pojazd) == "Alpha" then jednostka "%" end
        local bak getElementData(pojazd"bak") or 100

            local paliwo getElementData(pojazd"vehicle:fuel") or 100

        r,g,230230230

dxDrawImage(1398/scale970/scale522/scale90/scalespeedo[1], 000tocolor(255255255255), false)

dxDrawText(string.format('%03d'predkosc).." km/h"1409/scale1151/scale1585/scale884/scaletocolor(0,0,0255), 1.00fonts[1], "center""center"falsefalsefalsefalsefalse)
dxDrawText(string.format('%.0f'km).." km"1552/scale1151/scale1779/scale884/scaletocolor(0,0,0255), 1.00fonts[1], "center""center"falsefalsefalsefalsefalse)
dxDrawText(string.format('%.0f'paliwo).."/"..bak.." "..jednostka1701/scale1151/scale1945/scale884/scaletocolor(0,0,0255), 1.00fonts[1], "center""center"falsefalsefalsefalsefalse)

dxDrawText(string.format('%03d'predkosc).." km/h"1408/scale1150/scale1584/scale883/scaletocolor(r,g,b255), 1.00fonts[1], "center""center"falsefalsefalsefalsefalse)
dxDrawText(string.format('%.0f'km).." km"1552/scale1150/scale1778/scale883/scaletocolor(r,g,b255), 1.00fonts[1], "center""center"falsefalsefalsefalsefalse)
dxDrawText(string.format('%.0f'paliwo).."/"..bak.." "..jednostka1700/scale1150/scale1944/scale883/scaletocolor(r,g,b255), 1.00fonts[1], "center""center"falsefalsefalsefalsefalse)
    end
end)


[ Dodano: 2020-01-11, 16:28 ]
to jest licznik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-01-12, 18:17


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Pojazd, kt?ry musisz mie? ?eby pokazywa?y si? procenty pod Alpha. Zobacz pod co masz podmienion? Tesl? albo zmie? nazw? na ID pojazdu w odpowiedniej linijce.

Postaw piwo autorowi tego posta
 

 
Tagi: pojazd :: zwany :: teslą
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Pojazd zwany Teslą Odpowiedz do tematu

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