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

Wysłany: 2019-04-22, 23:28


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam pomorze mi kto? z tym? Iz chcialbym aby hud odczytywa? kolory html. Chodzi mi o to ze przed nickiem jest kolor w html i dopiero nick, a chcia?bym z?by by? nick pokolorowany na ten kolor
kod



function przecinek(liczba)  
    local format liczba  
    while true do      
        formatstring.gsub(format"^(-?%d+)(%d%d%d)"'%1,%2')    
        if ( k==then      
            break  
        end  
    end  
    return format
end

--Dane

local screenWscreenH guiGetScreenSize()
local px,py = (screenW/1920),(screenH/1080)
local font dxCreateFont ("files/czcionka.ttf"30)
setElementData(localPlayer"hud"true)

--HUD



addEventHandler("onClientRender"root, function()
 --if not getElementData(localPlayer"player:logged "then return end
    setPlayerHudComponentVisible("ammo"false)
    setPlayerHudComponentVisible("area_name"false)
    setPlayerHudComponentVisible("armour"false)
    setPlayerHudComponentVisible("breath"false)
    setPlayerHudComponentVisible("clock"false)
    setPlayerHudComponentVisible("health"false)
    setPlayerHudComponentVisible("money"false)
    setPlayerHudComponentVisible("vehicle_name"true)
    setPlayerHudComponentVisible("weapon"false)
    setPlayerHudComponentVisible("radio"false)
    setPlayerHudComponentVisible("wanted"false)
    if not getElementData(localPlayer"hud"then return end
    local health getElementHealth(localPlayer)
    health math.floor(health)
    local rp getElementData(localPlayer"player:reputation") or -- Tu zmieelementdate rp na w?asn?
    local mp getElementData(localPlayer"player:movep") or -- Tu zmieelementdate rp na w?asn?
    local money getPlayerMoney()    
    local name getPlayerName(localPlayer)
    local id getElementData(localPlayer"id")
    local godzinaminutydzienmiesiacrok=getRealTime().hourgetRealTime().minutegetRealTime().monthdaygetRealTime().monthgetRealTime().year+1900
        dxDrawLine((screenW 0.3422) - 1, (screenH 0.0000) - 1, (screenW 0.3422) - 1screenH 0.0556tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7073, (screenH 0.0000) - 1, (screenW 0.3422) - 1, (screenH 0.0000) - 1tocolor(255550255), 1false)
        dxDrawLine((screenW 0.3422) - 1screenH 0.0556screenW 0.7073screenH 0.0556tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7073screenH 0.0556screenW 0.7073, (screenH 0.0000) - 1tocolor(255550255), 1false)
        dxDrawRectangle(screenW 0.3422screenH 0.0000screenW 0.3651screenH 0.0556tocolor(000210), false)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) - 1, (screenH 0.0009) - 1, (screenW 0.5589) - 1, (screenH 0.0500) - 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) + 1, (screenH 0.0009) - 1, (screenW 0.5589) + 1, (screenH 0.0500) - 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) - 1, (screenH 0.0009) + 1, (screenW 0.5589) - 1, (screenH 0.0500) + 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) + 1, (screenH 0.0009) + 1, (screenW 0.5589) + 1, (screenH 0.0500) + 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.4444screenH 0.0009screenW 0.5589screenH 0.0500tocolor(000255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) - 1, (screenH 0.0009) - 1, (screenW 0.7042) - 1, (screenH 0.0500) - 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) + 1, (screenH 0.0009) - 1, (screenW 0.7042) + 1, (screenH 0.0500) - 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) - 1, (screenH 0.0009) + 1, (screenW 0.7042) - 1, (screenH 0.0500) + 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) + 1, (screenH 0.0009) + 1, (screenW 0.7042) + 1, (screenH 0.0500) + 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(""..name.."  ID : "..id..""screenW 0.5400screenH 0.0009screenW 0.7042screenH 0.0500tocolor(000255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) - 1, (screenH 0.0009) - 1, (screenW 0.4641) - 1, (screenH 0.0500) - 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) + 1, (screenH 0.0009) - 1, (screenW 0.4641) + 1, (screenH 0.0500) - 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) - 1, (screenH 0.0009) + 1, (screenW 0.4641) - 1, (screenH 0.0500) + 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) + 1, (screenH 0.0009) + 1, (screenW 0.4641) + 1, (screenH 0.0500) + 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $"screenW 0.3453screenH 0.0028screenW 0.4641screenH 0.0500tocolor(000255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
   --dxDrawImage(sW 0sH 0sW 1sH 1"files/hud.png"000tocolor(255255255255), false)
    --dxDrawText(health.."% HP"sW 0.920sH 0sW 1sH 0.040tocolor(255255255255), 0.4font"left""center"falsefalsefalsefalsefalse)
  --  dxDrawText(przecinek(mp).." MP "sW 0.850sH 1.56sW 1sH * -1.467tocolor(255255255255), 0.8font"left""center"falsefalsefalsefalsefalse)
  --  dxDrawText(przecinek(rp).." REP "sW 0.820sH 1.63sW 1sH * -1.395tocolor(255255255255), 0.8font"left""center"falsefalsefalsefalsefalse)
  --  dxDrawText(przecinek(money).." $"sW 0.800sH 1.48sW 1sH * -1.100tocolor(255255255255), 0.8font"left""center"falsefalsefalsefalsefalse)
--    dxDrawText(health.."% HP"sW 0.930sH 1.48sW 1sH * -1.390tocolor(255255255255), 0.6font"left""center"falsefalsefalsefalsefalse)
end)

--On/off HUD(F4)

bindKey("F4""down", function()
    if getElementData(localPlayer"hud"then
        setElementData(localPlayer"hud"false)
        setPlayerHudComponentVisible("radar"false)
        showChat(false)
    else
        setElementData(localPlayer"hud"true)
        setPlayerHudComponentVisible("radar"true)
        showChat(true)
    end
end)




bindKey("f11""down", function()
    if map == true then
        map false
        setElementData(localPlayer"hud"true)
        showChat(true)
        setPlayerHudComponentVisible("all"false)
        setPlayerHudComponentVisible("radar"true)
        setPlayerHudComponentVisible("crosshair"true)
        setElementData(localPlayer"player:logged"true)
end
end)


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-04-23, 09:37


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Czternasty argument funkcji dxDrawText odpowiada za kolorwanie tekstu za pomoc? kod?w HTML, ustaw go na true.

Podmie? sobie kod:

function przecinek(liczba)  
    local format liczba  
    while true do      
        formatstring.gsub(format"^(-?%d+)(%d%d%d)"'%1,%2')    
        if ( k==then      
            break  
        end  
    end  
    return format
end

--Dane

local screenWscreenH guiGetScreenSize()
local px,py = (screenW/1920),(screenH/1080)
local font dxCreateFont ("files/czcionka.ttf"30)
setElementData(localPlayer"hud"true)

--HUD



addEventHandler("onClientRender"root, function()
 --if not getElementData(localPlayer"player:logged "then return end
    setPlayerHudComponentVisible("ammo"false)
    setPlayerHudComponentVisible("area_name"false)
    setPlayerHudComponentVisible("armour"false)
    setPlayerHudComponentVisible("breath"false)
    setPlayerHudComponentVisible("clock"false)
    setPlayerHudComponentVisible("health"false)
    setPlayerHudComponentVisible("money"false)
    setPlayerHudComponentVisible("vehicle_name"true)
    setPlayerHudComponentVisible("weapon"false)
    setPlayerHudComponentVisible("radio"false)
    setPlayerHudComponentVisible("wanted"false)
    if not getElementData(localPlayer"hud"then return end
    local health getElementHealth(localPlayer)
    health math.floor(health)
    local rp getElementData(localPlayer"player:reputation") or -- Tu zmieelementdate rp na w?asn?
    local mp getElementData(localPlayer"player:movep") or -- Tu zmieelementdate rp na w?asn?
    local money getPlayerMoney()    
    local name getPlayerName(localPlayer)
    local id getElementData(localPlayer"id")
    local godzinaminutydzienmiesiacrok=getRealTime().hourgetRealTime().minutegetRealTime().monthdaygetRealTime().monthgetRealTime().year+1900
        dxDrawLine((screenW 0.3422) - 1, (screenH 0.0000) - 1, (screenW 0.3422) - 1screenH 0.0556tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7073, (screenH 0.0000) - 1, (screenW 0.3422) - 1, (screenH 0.0000) - 1tocolor(255550255), 1false)
        dxDrawLine((screenW 0.3422) - 1screenH 0.0556screenW 0.7073screenH 0.0556tocolor(255550255), 1false)
        dxDrawLine(screenW 0.7073screenH 0.0556screenW 0.7073, (screenH 0.0000) - 1tocolor(255550255), 1false)
        dxDrawRectangle(screenW 0.3422screenH 0.0000screenW 0.3651screenH 0.0556tocolor(000210), false)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) - 1, (screenH 0.0009) - 1, (screenW 0.5589) - 1, (screenH 0.0500) - 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) + 1, (screenH 0.0009) - 1, (screenW 0.5589) + 1, (screenH 0.0500) - 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) - 1, (screenH 0.0009) + 1, (screenW 0.5589) - 1, (screenH 0.0500) + 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), (screenW 0.4444) + 1, (screenH 0.0009) + 1, (screenW 0.5589) + 1, (screenH 0.0500) + 1tocolor(255255255200), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(string.format("%02d:%02d",godzinaminuty), screenW 0.4444screenH 0.0009screenW 0.5589screenH 0.0500tocolor(000255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) - 1, (screenH 0.0009) - 1, (screenW 0.7042) - 1, (screenH 0.0500) - 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsetruefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) + 1, (screenH 0.0009) - 1, (screenW 0.7042) + 1, (screenH 0.0500) - 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsetruefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) - 1, (screenH 0.0009) + 1, (screenW 0.7042) - 1, (screenH 0.0500) + 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsetruefalse)
        dxDrawText(""..name.."  ID : "..id.."", (screenW 0.5400) + 1, (screenH 0.0009) + 1, (screenW 0.7042) + 1, (screenH 0.0500) + 1tocolor(255550255), 1.00*px"pricedown""center""center"falsefalsefalsetruefalse)
        dxDrawText(""..name.."  ID : "..id..""screenW 0.5400screenH 0.0009screenW 0.7042screenH 0.0500tocolor(000255), 1.00*px"pricedown""center""center"falsefalsefalsetruefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) - 1, (screenH 0.0009) - 1, (screenW 0.4641) - 1, (screenH 0.0500) - 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) + 1, (screenH 0.0009) - 1, (screenW 0.4641) + 1, (screenH 0.0500) - 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) - 1, (screenH 0.0009) + 1, (screenW 0.4641) - 1, (screenH 0.0500) + 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $", (screenW 0.3453) + 1, (screenH 0.0009) + 1, (screenW 0.4641) + 1, (screenH 0.0500) + 1tocolor(116913255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
        dxDrawText(przecinek(money).." $"screenW 0.3453screenH 0.0028screenW 0.4641screenH 0.0500tocolor(000255), 1.00*px"pricedown""center""center"falsefalsefalsefalsefalse)
   --dxDrawImage(sW 0sH 0sW 1sH 1"files/hud.png"000tocolor(255255255255), false)
    --dxDrawText(health.."% HP"sW 0.920sH 0sW 1sH 0.040tocolor(255255255255), 0.4font"left""center"falsefalsefalsefalsefalse)
  --  dxDrawText(przecinek(mp).." MP "sW 0.850sH 1.56sW 1sH * -1.467tocolor(255255255255), 0.8font"left""center"falsefalsefalsefalsefalse)
  --  dxDrawText(przecinek(rp).." REP "sW 0.820sH 1.63sW 1sH * -1.395tocolor(255255255255), 0.8font"left""center"falsefalsefalsefalsefalse)
  --  dxDrawText(przecinek(money).." $"sW 0.800sH 1.48sW 1sH * -1.100tocolor(255255255255), 0.8font"left""center"falsefalsefalsefalsefalse)
--    dxDrawText(health.."% HP"sW 0.930sH 1.48sW 1sH * -1.390tocolor(255255255255), 0.6font"left""center"falsefalsefalsefalsefalse)
end)

--On/off HUD(F4)

bindKey("F4""down", function()
    if getElementData(localPlayer"hud"then
        setElementData(localPlayer"hud"false)
        setPlayerHudComponentVisible("radar"false)
        showChat(false)
    else
        setElementData(localPlayer"hud"true)
        setPlayerHudComponentVisible("radar"true)
        showChat(true)
    end
end)




bindKey("f11""down", function()
    if map == true then
        map false
        setElementData(localPlayer"hud"true)
        showChat(true)
        setPlayerHudComponentVisible("all"false)
        setPlayerHudComponentVisible("radar"true)
        setPlayerHudComponentVisible("crosshair"true)
        setElementData(localPlayer"player:logged"true)
end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2019-04-23, 10:33


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Dzi?ki !

Postaw piwo autorowi tego posta
 

 
Tagi: odczytywanie :: kolorow :: html
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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