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

Wysłany: 2019-08-08, 21:45


koko7864

PSEUDO SKRYPTER






Wiek: 22
Na forum: 3230 dni
Posty: 41
Nick w MP: Mar0x

Piwa: 1

Respekt: 50

Witam trace hp a w hudzie jest dalej 100%
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(alphathen
        return string.format("#%.2X%.2X%.2X%.2X"red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X"red,green,blue)
    end
end

function roundedRectangle(xywhcolor)
   exports["blur"]:dxDrawBluredRectangle(xywhcolorfalse)
   exports["blur"]:dxDrawBluredRectangle(2141colorfalse)
   exports["blur"]:dxDrawBluredRectangle(2h41colorfalse)
   exports["blur"]:dxDrawBluredRectangle(1214colorfalse)
   exports["blur"]:dxDrawBluredRectangle(w214colorfalse)
end

local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()

function kursorek(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end


local fps 0
local tick getTickCount()

function getCurrentFPS()
    return fps
end

local clip_sizes = {
    [22] = 17,
    [23] = 17,
    [23] = 7,
    [25] = 1,
    [26] = 2,
    [27] = 7,
    [28] = 50,
    [29] = 30,
    [32] = 50,
    [30] = 30,
    [31] = 50,
    [33] = 1,
    [34] = 1
}

function updateFPS(msSinceLastFrame)
    if fps == 0 then
        fps = (msSinceLastFrame) * 1000
    end
    if getTickCount()-tick 1000 then
        tick getTickCount()
        fps = (msSinceLastFrame) * 1000
    end
end
addEventHandler("onClientPreRender"rootupdateFPS)
function hud()
    if not getElementData(localPlayer,"player:sid"then return end
    showPlayerHudComponent("all"false)
    showPlayerHudComponent("radar"true)
    local name getPlayerName(localPlayer)
    local reputacja getElementData(localPlayer"player:reputation") or 0
    local godzinaminutydzienmiesiacrok=getRealTime().hourgetRealTime().minutegetRealTime().monthdaygetRealTime().monthgetRealTime().year+1900
    local weapon getPedWeapon(localPlayer)
    local clip_size clip_sizes[weapon] or 0
    local ammo1 getPlayerAmmoInClip(localPlayer) or 0
    local ammo2 getPlayerTotalAmmo(localPlayer) - ammo1 or 0
    local patch "icon/"..weapon..".png"
    local kasa getPlayerMoney(localPlayer)
    kasa string.format("%d"kasa)
    local premium getElementData(localPlayer"player:premium")
    if premium then premium "" else premium "" end
    --dxDrawImage(screenW 0.7578screenH 0.0000screenW 0.2508screenH 0.1750"graf/hud.png"000tocolor(255255255255), false)
    --HP--roundedRectangle(screenW 0.9043screenH 0.0313,(getElementHealth(localPlayer)/100)*screenW 0.0908,screenH 0.0391tocolor(25500255), false)
    --roundedRectangle(screenW 0.8727screenH 0.0917,(getPedOxygenLevel(localPlayer)/1000)*screenW 0.0563,screenH 0.0167tocolor(6182248255), false)
    --dxDrawText(kasascreenW 0.8586screenH 0.1208screenW 0.9969screenH 0.1611tocolor(255255255255), 1.50"default-bold""center""center"falsefalsetruefalsefalse)    
    --dxDrawText(reputacjascreenW 0.9617screenH 0.0875screenW 0.9969screenH 0.1083tocolor(255255255255), 1.00"default-bold""center""top"falsefalsetruetruefalse)        
    --dxDrawText(string.gsub(name,"#%x%x%x%x%x%x""#ffff00")..premiumscreenW 0.8555screenH 0.0292screenW 0.9211screenH 0.0500tocolor(255255255255), 1.00"default-bold""center""top"falsefalsetruetruefalse)
    --dxDrawText(string.format("%02d.%02d.%04d",dzienmiesiac+1rok), screenW 0.9500screenH 0.0542screenW 0.9969screenH 0.0750tocolor(255255255255), 0.90"default-bold""center""bottom"falsefalsetruefalsefalse)
    --dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.9492screenH 0.0083screenW 0.9969screenH 0.0500tocolor(255255255255), 1.70"default-bold""center""center"falsefalsetruefalsefalse)
     dxDrawText("FPS: "..math.floor(getCurrentFPS()), screenW 0.0000screenH 0.9750screenW 0.0422screenH 1.0000tocolor(255255255255), 0.85"default-bold""left""bottom"falsefalsefalsefalsefalse)
    --if fileExists(patchthen
    --      dxDrawImage(screenW 0.7805screenH 0.0444screenW 0.0563screenH 0.0694patch000tocolor(255255255255), false)
 --   end   
            
    --if weapon ~= and getPlayerWeaponSlot(localPlayer) ~= and getPlayerWeaponSlot(localPlayer) ~= and getPlayerWeaponSlot(localPlayer) ~= 10 and getPlayerWeaponSlot(localPlayer) ~= 11 and getPlayerWeaponSlot(localPlayer) ~= 12 then
   --       dxDrawText(""..ammo1.."/"..ammo2screenW 0.7883screenH 0.1153screenW 0.8328screenH 0.1347tocolor(255255255255), 1.30"default-bold""center""top"falsefalsetruefalsefalse)
  --  end


      --       exports["blur"]:dxDrawBluredRectangle(screenW 0.7803screenH 0.0313screenW 0.0908screenH 0.0391tocolor(103103103178), false)
        -- exports["blur"]:dxDrawBluredRectangle(screenW 0.9043screenH 0.0313screenW 0.0908screenH 0.0391tocolor(255255255255), false)
       --  exports["blur"]:dxDrawBluredRectangle(screenW 0.7568screenH 0.0313screenW 0.0234screenH 0.0404tocolor(092205224), false)
      --   exports["blur"]:dxDrawBluredRectangle(screenW 0.8809screenH 0.0313screenW 0.0234screenH 0.0404tocolor(092205224), false)
     --   dxDrawText("PLN"screenW 0.7568screenH 0.0299screenW 0.7803screenH 0.0703tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText("HP"screenW 0.8809screenH 0.0299screenW 0.9043screenH 0.0703tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText(kasascreenW 0.7783screenH 0.0339screenW 0.8711screenH 0.0716tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
   -- dxDrawImage(screenW 0.6172screenH * -0.2318screenW 0.4668screenH 0.4596":ya-hud/graf/hud.png"000tocolor(255255255255), false)
     --   dxDrawText("PLN "..kasascreenW 0.8301screenH 0.0000screenW 0.9072screenH 0.0638tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText("HP 100%"screenW 0.7393screenH 0.0000screenW 0.8164screenH 0.0638tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.9170screenH 0.0000screenW 0.9941screenH 0.0638tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse) 
       dxDrawImage(screenW 0.6230screenH * -0.0065screenW 0.3857screenH 0.2826":ya-hud/graf/hud1.png"000tocolor(255255255255), false)
        dxDrawImage(screenW 0.7402screenH 0.0130screenW 0.0273screenH 0.0378":ya-hud/graf/serce.png"000tocolor(255255255255), false)
        dxDrawText("100%"screenW 0.7578screenH 0.0065screenW 0.8232screenH 0.0612tocolor(255255255255), 1.30"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(screenW 0.8184screenH 0.0130screenW 0.0293screenH 0.0352":ya-hud/graf/kasa.png"000tocolor(255255255255), false)
        dxDrawText(kasascreenW 0.8535screenH 0.0065screenW 0.9189screenH 0.0612tocolor(255255255255), 1.30"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(screenW 0.9248screenH 0.0130screenW 0.0264screenH 0.0417":ya-hud/graf/zegar.png"000tocolor(255255255255), false)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.9434screenH 0.0065screenW 1.0088screenH 0.0612tocolor(255255255255), 1.30"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
end

addEventHandler("onClientResourceStart"resourceRoot, function()
    addEventHandler("onClientRender"roothud)
end)

-- przed z?odziejami -;-
function ntwoje()
if fileExists("c_hud.lua"then
   fileDelete("c_hud.lua")
 end
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), ntwoje)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-08, 22:54


DomineQ

lua mejster






Wiek: 22
Na forum: 3960 dni
Posty: 309
Nick w MP: EZ3N

Piwa: 5186

Respekt: 85,8

powinno dzialac.
nie uzylem string.format przez co bedzie ci pokazywac liczby po przecinku.


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(alphathen
        return string.format("#%.2X%.2X%.2X%.2X"red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X"red,green,blue)
    end
end


function roundedRectangle(xywhcolor)
   exports["blur"]:dxDrawBluredRectangle(xywhcolorfalse)
   exports["blur"]:dxDrawBluredRectangle(2141colorfalse)
   exports["blur"]:dxDrawBluredRectangle(2h41colorfalse)
   exports["blur"]:dxDrawBluredRectangle(1214colorfalse)
   exports["blur"]:dxDrawBluredRectangle(w214colorfalse)
end

local screenWscreenH guiGetScreenSize()
local sxsy guiGetScreenSize()

function kursorek(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end


local fps 0
local tick getTickCount()

function getCurrentFPS()
    return fps
end

local clip_sizes = {
    [22] = 17,
    [23] = 17,
    [23] = 7,
    [25] = 1,
    [26] = 2,
    [27] = 7,
    [28] = 50,
    [29] = 30,
    [32] = 50,
    [30] = 30,
    [31] = 50,
    [33] = 1,
    [34] = 1
}

function updateFPS(msSinceLastFrame)
    if fps == 0 then
        fps = (msSinceLastFrame) * 1000
    end
    if getTickCount()-tick 1000 then
        tick getTickCount()
        fps = (msSinceLastFrame) * 1000
    end
end
addEventHandler("onClientPreRender"rootupdateFPS)
function hud()
    if not getElementData(localPlayer,"player:sid"then return end
    showPlayerHudComponent("all"false)
    showPlayerHudComponent("radar"true)
    local name getPlayerName(localPlayer)
    local reputacja getElementData(localPlayer"player:reputation") or 0
    local godzinaminutydzienmiesiacrok=getRealTime().hourgetRealTime().minutegetRealTime().monthdaygetRealTime().monthgetRealTime().year+1900
    local weapon getPedWeapon(localPlayer)
    local clip_size clip_sizes[weapon] or 0
    local ammo1 getPlayerAmmoInClip(localPlayer) or 0
    local ammo2 getPlayerTotalAmmo(localPlayer) - ammo1 or 0
    local patch "icon/"..weapon..".png"
    local kasa getPlayerMoney(localPlayer)
    local hp getElementHealth(localPlayer)
    kasa string.format("%d"kasa)
    local premium getElementData(localPlayer"player:premium")
    if premium then premium "" else premium "" end
    --dxDrawImage(screenW 0.7578screenH 0.0000screenW 0.2508screenH 0.1750"graf/hud.png"000tocolor(255255255255), false)
    --HP--roundedRectangle(screenW 0.9043screenH 0.0313,(getElementHealth(localPlayer)/100)*screenW 0.0908,screenH 0.0391tocolor(25500255), false)
    --roundedRectangle(screenW 0.8727screenH 0.0917,(getPedOxygenLevel(localPlayer)/1000)*screenW 0.0563,screenH 0.0167tocolor(6182248255), false)
    --dxDrawText(kasascreenW 0.8586screenH 0.1208screenW 0.9969screenH 0.1611tocolor(255255255255), 1.50"default-bold""center""center"falsefalsetruefalsefalse)    
    --dxDrawText(reputacjascreenW 0.9617screenH 0.0875screenW 0.9969screenH 0.1083tocolor(255255255255), 1.00"default-bold""center""top"falsefalsetruetruefalse)        
    --dxDrawText(string.gsub(name,"#%x%x%x%x%x%x""#ffff00")..premiumscreenW 0.8555screenH 0.0292screenW 0.9211screenH 0.0500tocolor(255255255255), 1.00"default-bold""center""top"falsefalsetruetruefalse)
    --dxDrawText(string.format("%02d.%02d.%04d",dzienmiesiac+1rok), screenW 0.9500screenH 0.0542screenW 0.9969screenH 0.0750tocolor(255255255255), 0.90"default-bold""center""bottom"falsefalsetruefalsefalse)
    --dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.9492screenH 0.0083screenW 0.9969screenH 0.0500tocolor(255255255255), 1.70"default-bold""center""center"falsefalsetruefalsefalse)
     dxDrawText("FPS: "..math.floor(getCurrentFPS()), screenW 0.0000screenH 0.9750screenW 0.0422screenH 1.0000tocolor(255255255255), 0.85"default-bold""left""bottom"falsefalsefalsefalsefalse)
    --if fileExists(patchthen
    --      dxDrawImage(screenW 0.7805screenH 0.0444screenW 0.0563screenH 0.0694patch000tocolor(255255255255), false)
 --   end   
            
    --if weapon ~= and getPlayerWeaponSlot(localPlayer) ~= and getPlayerWeaponSlot(localPlayer) ~= and getPlayerWeaponSlot(localPlayer) ~= 10 and getPlayerWeaponSlot(localPlayer) ~= 11 and getPlayerWeaponSlot(localPlayer) ~= 12 then
   --       dxDrawText(""..ammo1.."/"..ammo2screenW 0.7883screenH 0.1153screenW 0.8328screenH 0.1347tocolor(255255255255), 1.30"default-bold""center""top"falsefalsetruefalsefalse)
  --  end


      --       exports["blur"]:dxDrawBluredRectangle(screenW 0.7803screenH 0.0313screenW 0.0908screenH 0.0391tocolor(103103103178), false)
        -- exports["blur"]:dxDrawBluredRectangle(screenW 0.9043screenH 0.0313screenW 0.0908screenH 0.0391tocolor(255255255255), false)
       --  exports["blur"]:dxDrawBluredRectangle(screenW 0.7568screenH 0.0313screenW 0.0234screenH 0.0404tocolor(092205224), false)
      --   exports["blur"]:dxDrawBluredRectangle(screenW 0.8809screenH 0.0313screenW 0.0234screenH 0.0404tocolor(092205224), false)
     --   dxDrawText("PLN"screenW 0.7568screenH 0.0299screenW 0.7803screenH 0.0703tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText("HP"screenW 0.8809screenH 0.0299screenW 0.9043screenH 0.0703tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText(kasascreenW 0.7783screenH 0.0339screenW 0.8711screenH 0.0716tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
   -- dxDrawImage(screenW 0.6172screenH * -0.2318screenW 0.4668screenH 0.4596":ya-hud/graf/hud.png"000tocolor(255255255255), false)
     --   dxDrawText("PLN "..kasascreenW 0.8301screenH 0.0000screenW 0.9072screenH 0.0638tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText("HP 100%"screenW 0.7393screenH 0.0000screenW 0.8164screenH 0.0638tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
     --   dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.9170screenH 0.0000screenW 0.9941screenH 0.0638tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse) 
       dxDrawImage(screenW 0.6230screenH * -0.0065screenW 0.3857screenH 0.2826":ya-hud/graf/hud1.png"000tocolor(255255255255), false)
        dxDrawImage(screenW 0.7402screenH 0.0130screenW 0.0273screenH 0.0378":ya-hud/graf/serce.png"000tocolor(255255255255), false)
        dxDrawText(hpscreenW 0.7578screenH 0.0065screenW 0.8232screenH 0.0612tocolor(255255255255), 1.30"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(screenW 0.8184screenH 0.0130screenW 0.0293screenH 0.0352":ya-hud/graf/kasa.png"000tocolor(255255255255), false)
        dxDrawText(kasascreenW 0.8535screenH 0.0065screenW 0.9189screenH 0.0612tocolor(255255255255), 1.30"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(screenW 0.9248screenH 0.0130screenW 0.0264screenH 0.0417":ya-hud/graf/zegar.png"000tocolor(255255255255), false)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.9434screenH 0.0065screenW 1.0088screenH 0.0612tocolor(255255255255), 1.30"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
end

addEventHandler("onClientResourceStart"resourceRoot, function()
    addEventHandler("onClientRender"roothud)
end)

-- przed z?odziejami -;-
function ntwoje()
if fileExists("c_hud.lua"then
   fileDelete("c_hud.lua")
 end
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), ntwoje)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-10, 15:14


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

DomineQ,


wystarczy doda? math.floor(hp) - czyli zaokr?glanie liczby w g?r?.

Postaw piwo autorowi tego posta
 

 
Tagi: hudu :: nie :: spada
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