[YARDIM] Hud Düzenleme

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 177
  • Lowide Freeroam
: 22 Ekim 2017, 21:23:57
Altta kodlarını verdiğim hudu editledim fakat sonradan birşey fark ettim F11 tuşuna basınca normalde kapanan hud bunda kapanmıyor  ve login panelin filan önüne geçiyor bunu düzenleyebilecek varsa şimdiden teşekkürler.

Kod: lua
--# Resolution fix
local screenW,screenH = guiGetScreenSize()
local resW,resH = 1366,768
local sW,sH =  (screenW/resW), (screenH/resH)

    function drawHUD()
    --# Can
    local playerHealth = math.floor (getElementHealth( getLocalPlayer() ))
addOutlines ((320/resW)*screenW, (563/resH)*screenH, (10/resW)*screenW, (150/resH)*screenH, tocolor (0, 0, 0, 255), 1);
            dxDrawRectangle(315*sW, screenH-210*sH, 35*sW, 185*sH, tocolor(0, 0, 0, 150), true)
            dxDrawImage(320*sW, screenH-45*sH, 10*sW, 10*sH, "img/health.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
            dxDrawRectangle(320*sW, screenH-205*sH, 10*sW, 150*sH, tocolor(90, 12, 14, 255), true)
            dxDrawRectangle(320*sW, 613+(100-(playerHealth*1.5))*sH, 10*sW, playerHealth*1.5*sH, tocolor(180, 25, 29, 255), true)
        --# Zırh
    local playerArmor = math.floor (getPedArmor( getLocalPlayer() ))
addOutlines ((335/resW)*screenW, (563/resH)*screenH, (10/resW)*screenW, (150/resH)*screenH, tocolor (0, 0, 0, 255), 1);
            dxDrawImage(335*sW, screenH-45*sH, 10*sW, 10*sH, "img/sheild.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
            dxDrawRectangle(335*sW, screenH-205*sH, 10*sW, 150*sH, tocolor(112, 112, 112, 255), true)
            dxDrawRectangle(335*sW, 613+(100-(playerArmor*1.5))*sH, 10*sW, playerArmor*1.5*sH, tocolor(255, 255, 255, 255), true)
--# Oksijen
--math.ceil(current oxygen / 100)
local playerOxygen = math.floor( getPedOxygenLevel( getLocalPlayer() ))
        if ( playerOxygen < 1000 or isElementInWater( getLocalPlayer() )) then
addOutlines ((15/resW)*screenW, (753/resH)*screenH, (290/resW)*screenW, (5/resH)*screenH, tocolor (0, 0, 0, 255), 1);
        dxDrawRectangle(10*sW, screenH-20*sH, 300*sW, 15*sH, tocolor(0, 0, 0, 150), true)
            dxDrawRectangle(15*sW, screenH-15*sH, 290*sW, 5*sH, tocolor(86, 101, 120, 255), true)
            dxDrawRectangle(15*sW, screenH-15*sH, 290*sW/1000*playerOxygen, 5*sH, tocolor(173, 203, 241, 255), true)
end
--# Para
local moneyY = 0
local SAFEZONE_X = screenW*0.05
local SAFEZONE_Y = screenH*0.05
local cash = ("%008d"):format(getPlayerMoney(getLocalPlayer()))
cash = "$"..cash
local r1,g1,b1
if (getPlayerMoney() >= 0) then
r1,g1,b1 = 54,104,44
else
cash = string.gsub(cash, "%D", "")
cash = "-$"..cash
r1,g1,b1 = 180,25,29
end
local dX,dY,dW,dH = screenW-6,35+moneyY,screenW-6,30
local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
dxDrawText(cash, dX+2,dY,dW+2,dH, tocolor(0,0,0,255), 1.35, "pricedown", "right")
dxDrawText(cash, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.35, "pricedown", "right")
dxDrawText(cash, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.35, "pricedown", "right")
dxDrawText(cash, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.35, "pricedown", "right")
dxDrawText(cash, dX,dY,dW,dH, tocolor(r1,g1,b1,255), 1.35, "pricedown", "right")
--# Silah
local weapon = getPedWeapon(localPlayer)
local clip = getPedAmmoInClip(localPlayer)
local ammo = getPedTotalAmmo(localPlayer)
if (weapon == 0 or weapon == 1 or ammo == 0) then moneyY = 0 return end
moneyY = 35
local len = #tostring(clip)
if string.find(tostring(clip), 1) then len = len - 0.5 end
local xoff = (len*17) + 10

local len2 = #tostring(ammo-clip)
if string.find(tostring(ammo-clip), 1) then len2 = len2 - 0.5 end
local weapLen = ((len+len2)*17) + 20

if (weapon >= 15 and weapon ~= 40 and weapon <= 44 or weapon >= 46) then
local dX,dY,dW,dH = screenW-6,-10,screenW-6,-10
local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
dxDrawText(clip, dX+2,dY,dW+2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(clip, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(clip, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(clip, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(clip, dX,dY,dW,dH, tocolor(110,110,110,255), 1.25, "pricedown", "right")
-- Total Ammo
local dX,dY,dW,dH = screenW-6-xoff,-10,screenW-6-xoff,-10
local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
dxDrawText(ammo-clip, dX+2-xoff,dY,dW+2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(ammo-clip, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(ammo-clip, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(ammo-clip, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
dxDrawText(ammo-clip, dX,dY,dW,dH, tocolor(220,220,220,255), 1.25, "pricedown", "right")
else
xoff = 0
weapLen = 0
end
if (weapon == 0 or weapon == 1) then return end
local img = "img/weapons/"..weapon..".png"
local dX,dY,dW,dH = screenW-133-weapLen,-5,130,50
local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH
dxDrawImage(dX, dY, dW, dH, img)
end
addEventHandler( "onClientRender", root, drawHUD)


function addOutlines(screenW, screenH, width, height, lineColor, lineSize, postGUI)
    dxDrawLine(screenW - 1, (screenH - lineSize), screenW - 1, screenH + height + (lineSize - 1), lineColor, lineSize, postGUI); --left
    dxDrawLine(screenW + width, (screenH) - 1, (screenW) - 1, (screenH) - 1, lineColor, lineSize, postGUI); -- top
    dxDrawLine((screenW) - 1, screenH + height, screenW + width, screenH + height, lineColor, lineSize, postGUI); -- bottom
    dxDrawLine(screenW + width, screenH - lineSize, screenW + width, screenH + height + (lineSize - 1), lineColor, lineSize, postGUI); -- right
end

addEventHandler( "onClientPlayerWasted", root,
    function()
    removeEventHandler("onClientRender", root, drawHUD)
    end);

addEventHandler( "onClientPlayerSpawn", root,
    function()
    addEventHandler( "onClientRender", root, drawHUD)
end);

addEventHandler( "onClientResourceStart", resourceRoot,
function()
setPlayerHudComponentVisible ( "weapon", false )
setPlayerHudComponentVisible ( "ammo", false )
setPlayerHudComponentVisible ( "health", false )
setPlayerHudComponentVisible ( "clock", false )
setPlayerHudComponentVisible ( "money", false )
setPlayerHudComponentVisible ( "armour", false )
    setPlayerHudComponentVisible ( "area_name", false )
    setPlayerHudComponentVisible ( "radar", false )
    setPlayerHudComponentVisible ( "vehicle_name", false )
end);

addEventHandler( "onClientResourceStop", resourceRoot,
function()
    setPlayerHudComponentVisible ( "weapon", true )
setPlayerHudComponentVisible ( "ammo", true )
setPlayerHudComponentVisible ( "health", true )
setPlayerHudComponentVisible ( "clock", true )
setPlayerHudComponentVisible ( "money", true )
setPlayerHudComponentVisible ( "armour", true )
    setPlayerHudComponentVisible ( "area_name", true )
    setPlayerHudComponentVisible ( "radar", true )
    setPlayerHudComponentVisible ( "vehicle_name", true )
end)

function f11kapat()
        toggleControl("radar", false)
end
addEventHandler ( "onClientResourceStart", getRootElement(  ), f11kapat )


addEvent("onClientSettingChange", true)
addEventHandler("onClientSettingChange", localPlayer,
function (setting, oldVal, newVal)
local setting = exports.GTIsettings:getSetting("hud")
if (not hudEnabled) and (setting == "GTI Hud")  then
for i,hud in ipairs(disabledHUD) do
setPlayerHudComponentVisible(hud, false)
end
hudEnabled = true
elseif ( hudEnabled ) and ( setting == "GTA Hud" ) then
for i,hud in ipairs(disabledHUD) do
setPlayerHudComponentVisible(hud, true)
end
hudEnabled = nil
else -- if not, set it as default (GTI's hud)
for i,hud in ipairs(disabledHUD) do
setPlayerHudComponentVisible(hud, false)
end
hudEnabled = true
end
end
)
 


MTASATURK

[YARDIM] Hud Düzenleme
« : 22 Ekim 2017, 21:23:57 »

Çevrimdışı Paradox

  • Kurucu
  • *
    • İleti: 684
  • SH Gaming
Yanıtla #1 : 22 Ekim 2017, 21:42:55
Buyur:

Kod: lua
--# Resolution fix
local screenW,screenH = guiGetScreenSize()
local resW,resH = 1366,768
local sW,sH =  (screenW/resW), (screenH/resH)
 
    function drawHUD()
if isPlayerMapVisible () then return end
            --# Can
            local playerHealth = math.floor (getElementHealth( getLocalPlayer() ))
                        addOutlines ((320/resW)*screenW, (563/resH)*screenH, (10/resW)*screenW, (150/resH)*screenH, tocolor (0, 0, 0, 255), 1);
            dxDrawRectangle(315*sW, screenH-210*sH, 35*sW, 185*sH, tocolor(0, 0, 0, 150), true)                 
            dxDrawImage(320*sW, screenH-45*sH, 10*sW, 10*sH, "img/health.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
            dxDrawRectangle(320*sW, screenH-205*sH, 10*sW, 150*sH, tocolor(90, 12, 14, 255), true)                     
            dxDrawRectangle(320*sW, 613+(100-(playerHealth*1.5))*sH, 10*sW, playerHealth*1.5*sH, tocolor(180, 25, 29, 255), true)                       
        --# Zırh
            local playerArmor = math.floor (getPedArmor( getLocalPlayer() ))
                        addOutlines ((335/resW)*screenW, (563/resH)*screenH, (10/resW)*screenW, (150/resH)*screenH, tocolor (0, 0, 0, 255), 1);
            dxDrawImage(335*sW, screenH-45*sH, 10*sW, 10*sH, "img/sheild.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)     
            dxDrawRectangle(335*sW, screenH-205*sH, 10*sW, 150*sH, tocolor(112, 112, 112, 255), true)   
            dxDrawRectangle(335*sW, 613+(100-(playerArmor*1.5))*sH, 10*sW, playerArmor*1.5*sH, tocolor(255, 255, 255, 255), true)
                --# Oksijen
                --math.ceil(current oxygen / 100)
                local playerOxygen = math.floor( getPedOxygenLevel( getLocalPlayer() ))
        if ( playerOxygen < 1000 or isElementInWater( getLocalPlayer() )) then
                        addOutlines ((15/resW)*screenW, (753/resH)*screenH, (290/resW)*screenW, (5/resH)*screenH, tocolor (0, 0, 0, 255), 1);
                dxDrawRectangle(10*sW, screenH-20*sH, 300*sW, 15*sH, tocolor(0, 0, 0, 150), true)                       
            dxDrawRectangle(15*sW, screenH-15*sH, 290*sW, 5*sH, tocolor(86, 101, 120, 255), true)       
            dxDrawRectangle(15*sW, screenH-15*sH, 290*sW/1000*playerOxygen, 5*sH, tocolor(173, 203, 241, 255), true)                   
                end     
                --# Para
                local moneyY = 0
                local SAFEZONE_X = screenW*0.05
                local SAFEZONE_Y = screenH*0.05
                local cash = ("%008d"):format(getPlayerMoney(getLocalPlayer()))
                cash = "$"..cash
                local r1,g1,b1
                if (getPlayerMoney() >= 0) then
                r1,g1,b1 = 54,104,44
                else
                cash = string.gsub(cash, "%D", "")
                cash = "-$"..cash
                r1,g1,b1 = 180,25,29
                end
                local dX,dY,dW,dH = screenW-6,35+moneyY,screenW-6,30
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
                dxDrawText(cash, dX+2,dY,dW+2,dH, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX,dY,dW,dH, tocolor(r1,g1,b1,255), 1.35, "pricedown", "right")
                --# Silah
                local weapon = getPedWeapon(localPlayer)
                local clip = getPedAmmoInClip(localPlayer)
                local ammo = getPedTotalAmmo(localPlayer)
                if (weapon == 0 or weapon == 1 or ammo == 0) then moneyY = 0 return end
        moneyY = 35
                local len = #tostring(clip)
                if string.find(tostring(clip), 1) then len = len - 0.5 end
                local xoff = (len*17) + 10
       
                local len2 = #tostring(ammo-clip)
                if string.find(tostring(ammo-clip), 1) then len2 = len2 - 0.5 end
                local weapLen = ((len+len2)*17) + 20
               
                if (weapon >= 15 and weapon ~= 40 and weapon <= 44 or weapon >= 46) then
                local dX,dY,dW,dH = screenW-6,-10,screenW-6,-10
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
                dxDrawText(clip, dX+2,dY,dW+2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX,dY,dW,dH, tocolor(110,110,110,255), 1.25, "pricedown", "right")
                -- Total Ammo
                local dX,dY,dW,dH = screenW-6-xoff,-10,screenW-6-xoff,-10
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
                dxDrawText(ammo-clip, dX+2-xoff,dY,dW+2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX,dY,dW,dH, tocolor(220,220,220,255), 1.25, "pricedown", "right")
                else
                xoff = 0
                weapLen = 0
                end
                if (weapon == 0 or weapon == 1) then return end
                local img = "img/weapons/"..weapon..".png"
                local dX,dY,dW,dH = screenW-133-weapLen,-5,130,50
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH
                dxDrawImage(dX, dY, dW, dH, img)       
end
addEventHandler( "onClientRender", root, drawHUD)
 
 
function addOutlines(screenW, screenH, width, height, lineColor, lineSize, postGUI)
    dxDrawLine(screenW - 1, (screenH - lineSize), screenW - 1, screenH + height + (lineSize - 1), lineColor, lineSize, postGUI); --left
    dxDrawLine(screenW + width, (screenH) - 1, (screenW) - 1, (screenH) - 1, lineColor, lineSize, postGUI); -- top
    dxDrawLine((screenW) - 1, screenH + height, screenW + width, screenH + height, lineColor, lineSize, postGUI); -- bottom
    dxDrawLine(screenW + width, screenH - lineSize, screenW + width, screenH + height + (lineSize - 1), lineColor, lineSize, postGUI); -- right
end
 
addEventHandler( "onClientPlayerWasted", root,
    function()
            removeEventHandler("onClientRender", root, drawHUD)
    end);
 
addEventHandler( "onClientPlayerSpawn", root,
    function()
            addEventHandler( "onClientRender", root, drawHUD)
        end);
 
addEventHandler( "onClientResourceStart", resourceRoot,
        function()
                setPlayerHudComponentVisible ( "weapon", false )       
                setPlayerHudComponentVisible ( "ammo", false ) 
                setPlayerHudComponentVisible ( "health", false )       
                setPlayerHudComponentVisible ( "clock", false )
                setPlayerHudComponentVisible ( "money", false )
                setPlayerHudComponentVisible ( "armour", false )
            setPlayerHudComponentVisible ( "area_name", false )
            setPlayerHudComponentVisible ( "radar", false )
            setPlayerHudComponentVisible ( "vehicle_name", false )             
        end);
       
addEventHandler( "onClientResourceStop", resourceRoot,
        function()
            setPlayerHudComponentVisible ( "weapon", true )     
                setPlayerHudComponentVisible ( "ammo", true )   
                setPlayerHudComponentVisible ( "health", true )
                setPlayerHudComponentVisible ( "clock", true )
                setPlayerHudComponentVisible ( "money", true )
                setPlayerHudComponentVisible ( "armour", true )
            setPlayerHudComponentVisible ( "area_name", true )
            setPlayerHudComponentVisible ( "radar", true )
            setPlayerHudComponentVisible ( "vehicle_name", true )
        end)
 
function f11kapat()
        toggleControl("radar", false)
end
addEventHandler ( "onClientResourceStart", getRootElement(  ), f11kapat )
 
 
addEvent("onClientSettingChange", true)
addEventHandler("onClientSettingChange", localPlayer,
        function (setting, oldVal, newVal)
                local setting = exports.GTIsettings:getSetting("hud")
                if (not hudEnabled) and (setting == "GTI Hud")  then
                        for i,hud in ipairs(disabledHUD) do
                                setPlayerHudComponentVisible(hud, false)
                        end
                        hudEnabled = true
                elseif ( hudEnabled ) and ( setting == "GTA Hud" ) then
                                for i,hud in ipairs(disabledHUD) do
                                        setPlayerHudComponentVisible(hud, true)
                                end
                        hudEnabled = nil
                else -- if not, set it as default (GTI's hud)
                        for i,hud in ipairs(disabledHUD) do
                                setPlayerHudComponentVisible(hud, false)
                        end
                        hudEnabled = true
                end
        end
)       
Linki görebilmek için Kayıt olun yada Giriş yapın.
« Son Düzenleme: 25 Ekim 2017, 18:24:41 Gönderen: Narkoz »
 


Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 177
  • Lowide Freeroam
Yanıtla #2 : 26 Ekim 2017, 15:34:39
Yardımın için Teşekkürler. F11 tuşuna basınca artık kapanıyor fakat bu seferde hud login panelin önüne geçiyor
(Para kısmı ve silah kısmı gelmiyor sadece can zırh ve oksijen barları geliyor.)


Resim;
 


Çevrimdışı Paradox

  • Kurucu
  • *
    • İleti: 684
  • SH Gaming
Yanıtla #3 : 26 Ekim 2017, 20:11:54
Linki görebilmek için Kayıt olun yada Giriş yapın.
Yardımın için Teşekkürler. F11 tuşuna basınca artık kapanıyor fakat bu seferde hud login panelin önüne geçiyor
(Para kısmı ve silah kısmı gelmiyor sadece can zırh ve oksijen barları geliyor.)


Bunu dene;


Kod: lua
--# Resolution fix
local screenW,screenH = guiGetScreenSize()
local resW,resH = 1366,768
local sW,sH =  (screenW/resW), (screenH/resH)
 
    function drawHUD()
        if isPlayerMapVisible () then return end
            --# Can
            local playerHealth = math.floor (getElementHealth( getLocalPlayer() ))
                        addOutlines ((320/resW)*screenW, (563/resH)*screenH, (10/resW)*screenW, (150/resH)*screenH, tocolor (0, 0, 0, 255), 1);
            dxDrawRectangle(315*sW, screenH-210*sH, 35*sW, 185*sH, tocolor(0, 0, 0, 150))                 
            dxDrawImage(320*sW, screenH-45*sH, 10*sW, 10*sH, "img/health.png", 0, 0, 0, tocolor(255, 255, 255, 255))
            dxDrawRectangle(320*sW, screenH-205*sH, 10*sW, 150*sH, tocolor(90, 12, 14, 255))                     
            dxDrawRectangle(320*sW, 613+(100-(playerHealth*1.5))*sH, 10*sW, playerHealth*1.5*sH, tocolor(180, 25, 29, 255))                       
        --# Zırh
            local playerArmor = math.floor (getPedArmor( getLocalPlayer() ))
                        addOutlines ((335/resW)*screenW, (563/resH)*screenH, (10/resW)*screenW, (150/resH)*screenH, tocolor (0, 0, 0, 255), 1);
            dxDrawImage(335*sW, screenH-45*sH, 10*sW, 10*sH, "img/sheild.png", 0, 0, 0, tocolor(255, 255, 255, 255))     
            dxDrawRectangle(335*sW, screenH-205*sH, 10*sW, 150*sH, tocolor(112, 112, 112, 255))   
            dxDrawRectangle(335*sW, 613+(100-(playerArmor*1.5))*sH, 10*sW, playerArmor*1.5*sH, tocolor(255, 255, 255, 255))
                --# Oksijen
                --math.ceil(current oxygen / 100)
                local playerOxygen = math.floor( getPedOxygenLevel( getLocalPlayer() ))
        if ( playerOxygen < 1000 or isElementInWater( getLocalPlayer() )) then
                        addOutlines ((15/resW)*screenW, (753/resH)*screenH, (290/resW)*screenW, (5/resH)*screenH, tocolor (0, 0, 0, 255), 1);
                dxDrawRectangle(10*sW, screenH-20*sH, 300*sW, 15*sH, tocolor(0, 0, 0, 150))                       
            dxDrawRectangle(15*sW, screenH-15*sH, 290*sW, 5*sH, tocolor(86, 101, 120, 255))       
            dxDrawRectangle(15*sW, screenH-15*sH, 290*sW/1000*playerOxygen, 5*sH, tocolor(173, 203, 241, 255))                   
                end     
                --# Para
                local moneyY = 0
                local SAFEZONE_X = screenW*0.05
                local SAFEZONE_Y = screenH*0.05
                local cash = ("%008d"):format(getPlayerMoney(getLocalPlayer()))
                cash = "$"..cash
                local r1,g1,b1
                if (getPlayerMoney() >= 0) then
                r1,g1,b1 = 54,104,44
                else
                cash = string.gsub(cash, "%D", "")
                cash = "-$"..cash
                r1,g1,b1 = 180,25,29
                end
                local dX,dY,dW,dH = screenW-6,35+moneyY,screenW-6,30
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
                dxDrawText(cash, dX+2,dY,dW+2,dH, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.35, "pricedown", "right")
                dxDrawText(cash, dX,dY,dW,dH, tocolor(r1,g1,b1,255), 1.35, "pricedown", "right")
                --# Silah
                local weapon = getPedWeapon(localPlayer)
                local clip = getPedAmmoInClip(localPlayer)
                local ammo = getPedTotalAmmo(localPlayer)
                if (weapon == 0 or weapon == 1 or ammo == 0) then moneyY = 0 return end
        moneyY = 35
                local len = #tostring(clip)
                if string.find(tostring(clip), 1) then len = len - 0.5 end
                local xoff = (len*17) + 10
       
                local len2 = #tostring(ammo-clip)
                if string.find(tostring(ammo-clip), 1) then len2 = len2 - 0.5 end
                local weapLen = ((len+len2)*17) + 20
               
                if (weapon >= 15 and weapon ~= 40 and weapon <= 44 or weapon >= 46) then
                local dX,dY,dW,dH = screenW-6,-10,screenW-6,-10
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
                dxDrawText(clip, dX+2,dY,dW+2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(clip, dX,dY,dW,dH, tocolor(110,110,110,255), 1.25, "pricedown", "right")
                -- Total Ammo
                local dX,dY,dW,dH = screenW-6-xoff,-10,screenW-6-xoff,-10
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW-SAFEZONE_X, dH+SAFEZONE_Y
                dxDrawText(ammo-clip, dX+2-xoff,dY,dW+2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX,dY+2,dW,dH+2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX-2,dY,dW-2,dH, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX,dY-2,dW,dH-2, tocolor(0,0,0,255), 1.25, "pricedown", "right")
                dxDrawText(ammo-clip, dX,dY,dW,dH, tocolor(220,220,220,255), 1.25, "pricedown", "right")
                else
                xoff = 0
                weapLen = 0
                end
                if (weapon == 0 or weapon == 1) then return end
                local img = "img/weapons/"..weapon..".png"
                local dX,dY,dW,dH = screenW-133-weapLen,-5,130,50
                local dX,dY,dW,dH = dX-SAFEZONE_X, dY+SAFEZONE_Y, dW, dH
                dxDrawImage(dX, dY, dW, dH, img)       
end
addEventHandler( "onClientRender", root, drawHUD)
 
 
function addOutlines(screenW, screenH, width, height, lineColor, lineSize, postGUI)
    dxDrawLine(screenW - 1, (screenH - lineSize), screenW - 1, screenH + height + (lineSize - 1), lineColor, lineSize, postGUI); --left
    dxDrawLine(screenW + width, (screenH) - 1, (screenW) - 1, (screenH) - 1, lineColor, lineSize, postGUI); -- top
    dxDrawLine((screenW) - 1, screenH + height, screenW + width, screenH + height, lineColor, lineSize, postGUI); -- bottom
    dxDrawLine(screenW + width, screenH - lineSize, screenW + width, screenH + height + (lineSize - 1), lineColor, lineSize, postGUI); -- right
end
 
addEventHandler( "onClientPlayerWasted", root,
    function()
            removeEventHandler("onClientRender", root, drawHUD)
    end);
 
addEventHandler( "onClientPlayerSpawn", root,
    function()
            addEventHandler( "onClientRender", root, drawHUD)
        end);
 
addEventHandler( "onClientResourceStart", resourceRoot,
        function()
                setPlayerHudComponentVisible ( "weapon", false )       
                setPlayerHudComponentVisible ( "ammo", false ) 
                setPlayerHudComponentVisible ( "health", false )       
                setPlayerHudComponentVisible ( "clock", false )
                setPlayerHudComponentVisible ( "money", false )
                setPlayerHudComponentVisible ( "armour", false )
            setPlayerHudComponentVisible ( "area_name", false )
            setPlayerHudComponentVisible ( "radar", false )
            setPlayerHudComponentVisible ( "vehicle_name", false )             
        end);
       
addEventHandler( "onClientResourceStop", resourceRoot,
        function()
            setPlayerHudComponentVisible ( "weapon", true )     
                setPlayerHudComponentVisible ( "ammo", true )   
                setPlayerHudComponentVisible ( "health", true )
                setPlayerHudComponentVisible ( "clock", true )
                setPlayerHudComponentVisible ( "money", true )
                setPlayerHudComponentVisible ( "armour", true )
            setPlayerHudComponentVisible ( "area_name", true )
            setPlayerHudComponentVisible ( "radar", true )
            setPlayerHudComponentVisible ( "vehicle_name", true )
        end)
 
function f11kapat()
        toggleControl("radar", false)
end
addEventHandler ( "onClientResourceStart", getRootElement(  ), f11kapat )
 
 
addEvent("onClientSettingChange", true)
addEventHandler("onClientSettingChange", localPlayer,
        function (setting, oldVal, newVal)
                local setting = exports.GTIsettings:getSetting("hud")
                if (not hudEnabled) and (setting == "GTI Hud")  then
                        for i,hud in ipairs(disabledHUD) do
                                setPlayerHudComponentVisible(hud, false)
                        end
                        hudEnabled = true
                elseif ( hudEnabled ) and ( setting == "GTA Hud" ) then
                                for i,hud in ipairs(disabledHUD) do
                                        setPlayerHudComponentVisible(hud, true)
                                end
                        hudEnabled = nil
                else -- if not, set it as default (GTI's hud)
                        for i,hud in ipairs(disabledHUD) do
                                setPlayerHudComponentVisible(hud, false)
                        end
                        hudEnabled = true
                end
        end
)       
 


Çevrimdışı DogukanUCAN

  • Acemi Üye
  • *
    • İleti: 177
  • Lowide Freeroam
Yanıtla #4 : 26 Ekim 2017, 22:01:58
Denedim hiç çalışmıyor intihar ettim, oyundan çıkıp girdim oyunun orjinal radarı duruyor