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

Wysłany: 2021-11-12, 21:30


Pro3west1







Wiek: 26
Na forum: 2524 dni
Posty: 37
Nick w MP: hjkh



Respekt: 50

Witam, mam problem.
Po odpaleniu tego skryptu strasznie ro?nie u?ycie ramu oraz u?ycie procesora a nawet bardzo.
Da si? to naprawi?? pozdrawiam
--[[
©️ Copyright 2021, wszelkie prawa zastrze?one. Autor: Lucky
--]]

local sw,sh guiGetScreenSize()
sx = function(value) return sw*value/1920 end 
sy = function(value) return sh*value/1080 end

local screenWscreenH guiGetScreenSize()

--local frequency 1

addEventHandler('onClientResourceStart',root,function()
    textures = {
        ['bg'] = dxCreateTexture('img/bg.png','argb',true,'clamp'),
        ['lgbt'] = dxCreateTexture('img/lgbt.png','argb',true,'clamp'),
        ['piesek'] = dxCreateTexture('img/piesek.png','argb',true,'clamp'),
        ['kizo'] = dxCreateTexture('img/kizo.png','argb',true,'clamp'),
        ['twojstary'] = dxCreateTexture('img/twojstary.png','argb',true,'clamp'),
        ['twojstaryrgb'] = dxCreateTexture('img/twojstaryrgb.png','argb',true,'clamp'),
        ['twojstary2rgb'] = dxCreateTexture('img/twojstary2rgb.png','argb',true,'clamp'),
        ['twojstary2'] = dxCreateTexture('img/twojstary2.png','argb',true,'clamp'),
        ['rgb'] = dxCreateTexture('img/rgb.png','argb',true,'clamp'),
        ['minionek'] = dxCreateTexture('img/minionek.png','argb',true,'clamp'),
        ['bg2'] = dxCreateTexture('img/bg2.png','argb',true,'clamp'),
        ['fuel'] = dxCreateTexture('img/fuel.png','argb',true,'clamp'),
        ['bateria'] = dxCreateTexture('img/bateria.png','argb',true,'clamp'),
        ['arrow'] = dxCreateTexture('img/arrow.png','argb',true,'clamp'),
        ['rower'] = dxCreateTexture('img/licznik_rower.png','argb',true,'clamp'),
        ['silnik'] = dxCreateTexture('img/engine.png','argb',true,'clamp'),
        ['lampa'] = dxCreateTexture('img/lights.png','argb',true,'clamp'),
        ['reczny'] = dxCreateTexture('img/hbrake.png','argb',true,'clamp'),
        ['font'] = dxCreateFont('normal.ttf',sx(19)),
        ['font5'] = dxCreateFont('normal.ttf',sx(12)),
        ['font6'] = dxCreateFont('normal.ttf',sx(14)),
        ['font7'] = dxCreateFont('normal.ttf',sx(11)),
        ['font4'] = dxCreateFont('kmh.ttf',sx(50)),
        ['font2'] = dxCreateFont('kmh.ttf',sx(90)),
    }
end)

-- WZI?TE Z MTA WIKI --
function getVehicleSpeed()
    if isPedInVehicle(getLocalPlayer()) then
        local sxsysz getElementVelocity(getPedOccupiedVehicle(getLocalPlayer()))
            return math.sqrt(( sx^sy^sz^2) ^(0.5)) *0.7*180*1.310
        end
    return 0
end

function getElementSpeed(theElementunit)
    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)")
    unit unit == nil and or ((not tonumber(unit)) and unit or tonumber(unit))
    local mult = (unit == or unit == "m/s") and 50 or ((unit == or unit == "km/h") and 180 or 111.84681456)
    return (Vector3(getElementVelocity(theElement)) * mult).length
end
--

function licznik_Lucky()
    if not getElementData(localPlayer,'player:logged'then return end
        local vehicle getPedOccupiedVehicle(localPlayer)
        if not isElement(vehiclethen return end
        if getElementData(vehicle,"recznySalonData"then return end

        local speedkmh getElementSpeed(vehicle1)
                local r,g,getVehicleHeadLightColor(vehicle)
                local lgbt getElementData(vehicle"vehicle:lgbt") or 0
                local piesek getElementData(vehicle"vehicle:piesek") or 0
                local minionek getElementData(vehicle"vehicle:minionek") or 0
                local rgb getElementData(vehicle"vehicle:rgb") or 0
                local twojstary2rgb getElementData(vehicle"vehicle:twojstary2rgb") or 0
                local twojstaryrgb getElementData(vehicle"vehicle:twojstaryrgb") or 0
                local twojstary2 getElementData(vehicle"vehicle:twojstary2") or 0
                local twojstary getElementData(vehicle"vehicle:twojstary") or 0
                local rgb getElementData(vehicle"vehicle:rgb") or 0



        
        if isPedInVehicle(localPlayerthen
            veh getPedOccupiedVehicle(localPlayer)
            local speedkmh getElementSpeed(vehicle1)
            predkosc_ar =getElementSpeed(vehicle1)/1
            if speedkmh 296 then predkosc_ar 296
            end
        end
        
        local przebieg getElementData(vehicle,'vehicle:mileage') or 0
        local fuel getElementData(vehicle,'vehicle:fuel')
        local lpg getElementData(vehicle,'gaz')
        speedkmh getElementSpeed(vehicle1)
        speedkmh2 speedkmh 3

        if getVehicleOverrideLights(vehicle) == and lgbt == and piesek == and minionek == and kizo == and rgb == and twojstary == 0  and twojstary2 == and twojstary2rgb == and twojstaryrgb == 0 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg2'],0,0,0,tocolor(r,g,b,255),false)
        end
        if lgbt == 1 then
            local curtime getTickCount() / 1000
            r math.floor(math.sin(curtime lgbt 0) * 127 128)
            math.floor(math.sin(curtime lgbt 2) * 127 128)
            math.floor(math.sin(curtime lgbt 4) * 127 128)
        else
            rggetVehicleHeadLightColor(vehicle)
        end
        if piesek == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['piesek'],0,0,0,tocolor(255,255,255,255),false)
        end

        if minionek == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['minionek'],0,0,0,tocolor(255,255,255,255),false)
        end        
        if rgb == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['rgb'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
        end
        if kizo == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['kizo'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
            
        dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
        end
        if twojstary == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['twojstary'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
        dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
        end
        if twojstary2 == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['twojstary2'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
        dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
        end
        if twojstary2rgb == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['twojstary2rgb'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
        dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
        end
        if twojstaryrgb == 1 then
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['twojstaryrgb'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
        dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
    end


    dxDrawImage(sx(1520),sy(710),sx(380),sy(380),textures['bg'],0,0,0,tocolor(255,255,255,255),false)
    dxDrawImage(sx(1520),sy(730),sx(400),sy(400),textures['arrow'],predkosc_ar*0.75,0,0,tocolor(255,255,255,255),false)
    
    if not getVehicleEngineState(vehiclethen
        dxDrawImage(sx(1860),sy(785),sx(40),sy(40),textures['silnik'],0,0,0,tocolor(255,0,0,255),false)
    else
        dxDrawImage(sx(1860),sy(785),sx(40),sy(40),textures['silnik'],0,0,0,tocolor(255,255,255,255),false)
    end
    
    if getVehicleOverrideLights(vehicle) ~= 2 then
        dxDrawImage(sx(1818),sy(740),sx(40),sy(40),textures['lampa'],0,0,0,tocolor(255,255,0,255),false)
    else
        dxDrawImage(sx(1818),sy(740),sx(40),sy(40),textures['lampa'],0,0,0,tocolor(255,255,255,255),false)
    end
    
    if isElementFrozen(vehthen
        dxDrawImage(sx(1760),sy(715),sx(40),sy(40),textures['reczny'],0,0,0,tocolor(255,0,0,255),false)
    else
        dxDrawImage(sx(1760),sy(715),sx(40),sy(40),textures['reczny'],0,0,0,tocolor(255,255,255,255),false)
    end
                
        -- Paliwo LPG --
        if getElementData(vehicle,"vehicle:elektryk") == 1 then
             dxDrawImage(sx(1390),sy(1000),sx(160),sy(70),textures['bateria'],0,0,0,tocolor(255,255,255,255),false)
        dxDrawText(('%01d'):format(math.floor(fuel)).."%", (screenW 0.6252) + 1, (screenH 0.9640) + 1, (screenW 0.9093) + 1, (screenH 0.9713) + 1tocolor(000255), 0.2textures['font2'], "center""center"falsefalsetruefalsefalse)
        dxDrawText(('%01d'):format(math.floor(fuel)).."%"screenW 0.6252screenH 0.9640screenW 0.9093screenH 0.9713tocolor(255255255255), 0.2textures['font2'], "center""center"falsefalsetruefalsefalse)
        else
            if getElementData(vehicle,'vehicle:fuel') >= 10 then
            dxDrawImage(sx(1390),sy(980),sx(125),sy(125),textures['fuel'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1390),sy(985),sx(130),sy(130),textures['arrow'],42+fuel*1.84,0,0,tocolor(255,255,255,255),false)
            dxDrawText("PB"sx(2300)+1,sy(1430)+1,sx(612)+1,sy(612)+1tocolor(000255), 1textures['font7'], "center""center"truetruetruetruetrue)
            dxDrawText("PB"sx(2300),sy(1430),sx(612),sy(612), tocolor(255255255255), 1textures['font7'], "center""center"truetruetruetruetrue)
        end
            dxDrawImage(sx(1390),sy(980),sx(125),sy(125),textures['fuel'],0,0,0,tocolor(255,255,255,255),false)
            dxDrawImage(sx(1390),sy(985),sx(130),sy(130),textures['arrow'],42+fuel*1.84,0,0,tocolor(255,255,255,255),false)
            dxDrawText("PB"sx(2300)+1,sy(1430)+1,sx(612)+1,sy(612)+1tocolor(000255), 1textures['font7'], "center""center"truetruetruetruetrue)
            dxDrawText("PB"sx(2300),sy(1430),sx(612),sy(612), tocolor(255255255255), 1textures['font7'], "center""center"truetruetruetruetrue)
        end
        if getElementData(vehicle"Zamontowane:LPG") == "Tak" then    
            if getElementData(vehicle,'gaz') >= 10 then
                dxDrawImage(sx(1390),sy(880),sx(125),sy(125),textures['fuel'],0,0,0,tocolor(255,255,255,255),false)
                dxDrawImage(sx(1390),sy(885),sx(130),sy(130),textures['arrow'],42+lpg*1.84,0,0,tocolor(255,255,255,255),false)
                dxDrawText("LPG"sx(2300)+1,sy(1230)+1,sx(612)+1,sy(612)+1tocolor(000255), 1textures['font7'], "center""center"truetruetruetruetrue)
                dxDrawText("LPG"sx(2300),sy(1230),sx(612),sy(612), tocolor(255255255255), 1textures['font7'], "center""center"truetruetruetruetrue)
            else
                dxDrawImage(sx(1390),sy(880),sx(125),sy(125),textures['fuel'],0,0,0,tocolor(255,255,255,255),false)
                dxDrawImage(sx(1390),sy(885),sx(130),sy(130),textures['arrow'],42+lpg*1.84,0,0,tocolor(255,255,255,255),false)
                dxDrawText("LPG"sx(2300)+1,sy(1230)+1,sx(612)+1,sy(612)+1tocolor(000255), 1textures['font7'], "center""center"truetruetruetruetrue)
                dxDrawText("LPG"sx(2300),sy(1230),sx(612),sy(612), tocolor(255255255255), 1textures['font7'], "center""center"truetruetruetruetrue)
            end
        end
        
        if getElementData(vehicle"lpg:off") and getElementData(vehicle"Zamontowane:LPG") == "Tak" then
            dxDrawText("#00cc00•"sx(2330),sy(1430),sx(612),sy(612), tocolor(255255255255), 1.1textures['font7'], "center""center"truetruetruetruetrue)
        elseif not getElementData(vehicle"lpg:off") and getElementData(vehicle"Zamontowane:LPG") == "Tak" then
            dxDrawText("#00cc00•"sx(2340),sy(1230),sx(612),sy(612), tocolor(255255255255), 1.1textures['font7'], "center""center"truetruetruetruetrue)
        end
        
        -- Reszta rzeczy --
        if speedkmh 10 then
            dxDrawText(string.format('%01d',math.floor(speedkmh)).."",sx(1550)+1,sy(960)+1,sx(1872)+1,sy(612)+1tocolor(000255), 0.7textures['font2'], "right""top"truetruetruetruetrue) 
            dxDrawText(string.format('%01d',math.floor(speedkmh)).."",sx(1550),sy(960),sx(1872),sy(612) , tocolor(255255255255), 0.7textures['font2'], "right""top"truetruetruetruetrue) 
        else
            dxDrawText(string.format('%01d',math.floor(speedkmh2)).."",sx(1550)+1,sy(960)+1,sx(1872)+1,sy(612)+1tocolor(000255), 0.7textures['font2'], "right""top"truetruetruetruetrue) 
            dxDrawText(string.format('%01d',math.floor(speedkmh2)).."",sx(1550),sy(960),sx(1872),sy(612) , tocolor(255255255255), 0.7textures['font2'], "right""top"truetruetruetruetrue) 
        end
        
        dxDrawText(""..string.format('%01d',math.floor(przebieg)).." km"sx(2820)+1,sy(1080)+1,sx(612)+1,sy(612)+1tocolor(000255), 1textures['font6'], "center""center"truetruetruetruetrue)
        dxDrawText(""..string.format('%01d',math.floor(przebieg)).." km"sx(2820),sy(1080),sx(612),sy(612), tocolor(255255255255), 1textures['font6'], "center""center"truetruetruetruetrue)
end
addEventHandler('onClientRender',root,licznik_Lucky)


function RGBToHex(redgreenbluealpha)
    if ( (red or red 255 or green or green 255 or blue or blue 255) or (alpha and (alpha or alpha 255) ) ) then
        return nil
    end
    if ( alpha then
        return string.format("#%.2X%.2X%.2X%.2X"red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X"red,green,blue)
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-11-12, 23:07


_jvneczek







Wiek: 22
Na forum: 4325 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

b??dy z debugscript 3 pokaz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-11-13, 10:27


Pro3west1







Wiek: 26
Na forum: 2524 dni
Posty: 37
Nick w MP: hjkh



Respekt: 50

"svt.n" napisał/a:

b??dy z debugscript 3 pokaz


B??d?w brak.

[ Dodano: 2021-11-19, 13:28 ]
ref

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-12-12, 23:24


_jvneczek







Wiek: 22
Na forum: 4325 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Pode?lij ca?y spakowany skrypt, sprawdz? u siebie.

Postaw piwo autorowi tego posta
 

 
Tagi: skrypt :: laguje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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