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

Wysłany: 2018-02-08, 07:22


Kuksss

guwno






Wiek: 22
Na forum: 3922 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Siema, robi? skrypt na radar i prawie wszystko dzia?a poprawnie, ale mam jeden problem, a mianowicie, ?eby w??czy? HUD trzeba w??czy? i wy??czy? map? F11.
Kod:
setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("clock",  false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)

bindKey("f11", "down", function()
    if map == true then
        map = false
        setElementData(localPlayer, "hud:enabled", true)
        showChat(true)
        showPlayerHudComponent("all", false)
        showPlayerHudComponent("radar", true)
        showPlayerHudComponent("crosshair", true)
    else
        map = true
        setElementData(localPlayer, "hud:enabled", false)
        showChat(false)
        showPlayerHudComponent("all", false)
    end
end)

local czciona = dxCreateFont("font.ttf", 20)

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
    if not getElementData(localPlayer, "hud:enabled", false) then return end
        dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, ":mr-hud/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText(getPlayerMoney(localPlayer), screenW * 0.03, screenH * 0.9676, screenW * 0.1031, screenH * 0.9944, tocolor(255, 255, 255, 255), 0.80, czciona, "left", "top", false, false, false, false, false)
        dxDrawText(string.format("%.0f", getElementHealth(localPlayer)), screenW * 0.1411, screenH * 0.9657, screenW * 0.1922, screenH * 0.9944, tocolor(255, 255, 255, 255), 1.00, czciona, "left", "top", false, false, false, false, false)
        dxDrawText(getElementData(localPlayer, "player:reputation"), screenW * 0.2099, screenH * 0.9639, screenW * 0.2865, screenH * 0.9907, tocolor(255, 255, 255, 255), 1.00, czciona, "left", "top", false, false, false, false, false)
    end
)

Z g?ry dzi?kuj?, stawiam :piwo: za pomoc :)

Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-08, 13:38


NyAngel







Wiek: 23
Na forum: 4091 dni
Posty: 128
Nick w MP: NyAngel

Piwa: 556

Respekt: 86,8


setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("clock",  false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)

bindKey("f11", "down", function()
    if map == true then
        map = false
        setElementData(localPlayer, "hud:enabled", true)
        showChat(true)
        showPlayerHudComponent("all", false)
        showPlayerHudComponent("radar", true)
        showPlayerHudComponent("crosshair", true)
    else
        map = true
        setElementData(localPlayer, "hud:enabled", false)
        showChat(false)
        showPlayerHudComponent("all", false)
    end
end)

local czciona = dxCreateFont("font.ttf", 20)

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
    if getElementData(localPlayer, "hud:enabled")  == false then return end
        dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, ":mr-hud/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText(getPlayerMoney(localPlayer), screenW * 0.03, screenH * 0.9676, screenW * 0.1031, screenH * 0.9944, tocolor(255, 255, 255, 255), 0.80, czciona, "left", "top", false, false, false, false, false)
        dxDrawText(string.format("%.0f", getElementHealth(localPlayer)), screenW * 0.1411, screenH * 0.9657, screenW * 0.1922, screenH * 0.9944, tocolor(255, 255, 255, 255), 1.00, czciona, "left", "top", false, false, false, false, false)
        dxDrawText(getElementData(localPlayer, "player:reputation"), screenW * 0.2099, screenH * 0.9639, screenW * 0.2865, screenH * 0.9907, tocolor(255, 255, 255, 255), 1.00, czciona, "left", "top", false, false, false, false, false)
    end
)


Jak chcesz ?eby hud byl widoczny po zalogowaniu to dodaj gdzie? po stronie serwera,?e jak kto? sie zaloguje to ?eby pokaza?o hud.


Chodzi?o Ci o zwyk?y hud czy ten tw?j?

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: hud :: mapa :: f11
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