Jump to content

Colocar nick do jogador em Hud


Recommended Posts

Olá, eu estava querendo colocar o nick do jogador na hud que estou fazendo, porém quando eu coloco ele aparece por exemplo: "Meu#929292Nick", ou seja, com o código da cor, alguém sabe como retira isso?

function SousaHud ( ... )
    if (not isPlayerMapVisible()) then
        local dinheiro = getPlayerMoney(localPlayer)
        local banco = getElementData(localPlayer"bank.money"or "0"
        local muniarma = getPedAmmoInClip (localPlayer)
        local munitotal = getPedTotalAmmo (localPlayer)
        local vida = math.floor(getElementHealth(getLocalPlayer()))
        local colete = math.floor(getPedArmor(getLocalPlayer()))
        local fome = getElementData(getLocalPlayer(), "fome"or 100
        local sede = getElementData(getLocalPlayer(), "sede"or 100
        local nome = getPlayerName (localPlayer)
 
        dxDrawRectangle(screenW * 0.7897, screenH * 0.0495, screenW * 0.2103, screenH * 0.2487tocolor(000215), false)
        dxDrawRectangle(screenW * 0.7978, screenH * 0.0651, screenW * 0.1949, screenH * 0.0352tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.7978, screenH * 0.1133, screenW * 0.0941, screenH * 0.0326tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.8993, screenH * 0.1133, screenW * 0.0941, screenH * 0.0326tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.7978, screenH * 0.1589, screenW * 0.0941, screenH * 0.0326tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.8985, screenH * 0.1589, screenW * 0.0941, screenH * 0.0326tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.8985, screenH * 0.2044, screenW * 0.0941, screenH * 0.0326tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.7971, screenH * 0.2044, screenW * 0.0941, screenH * 0.0326tocolor(255255255255), false)
        dxDrawRectangle(screenW * 0.7978, screenH * 0.2500, screenW * 0.1949, screenH * 0.0352tocolor(255255255255), false)
        dxDrawText(""..nome.. "", screenW * 0.7971, screenH * 0.0651, screenW * 0.9926, screenH * 0.1003tocolor(000254), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("R$"..dinheiro , screenW * 0.7971, screenH * 0.1120, screenW * 0.8912, screenH * 0.1458tocolor(000254), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("R$"..banco , screenW * 0.8985, screenH * 0.1120, screenW * 0.9926, screenH * 0.1458tocolor(000254), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Fome " ..fome.. "%", screenW * 0.7971, screenH * 0.1576, screenW * 0.8912, screenH * 0.1914tocolor(000254), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Sede " ..sede.. "%", screenW * 0.8985, screenH * 0.1576, screenW * 0.9926, screenH * 0.1914tocolor(000254), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Vida " ..vida.. "%", screenW * 0.7971, screenH * 0.2031, screenW * 0.8912, screenH * 0.2370tocolor(000254), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Colete " ..colete.. "%", screenW * 0.8985, screenH * 0.2031, screenW * 0.9926, screenH * 0.2370tocolor(000254), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Rawer Roleplay"10841911350219tocolor(000254), 1.50"default-bold""center""center"falsefalsefalsefalsefalse)
    end

 

Link to comment

No dxDrawText o penúltimo parâmetro é o ColorCoded, ele converte as cores, basta mudar de false para true que irá funcionar! Ficará assim:

dxDrawText(""..nome.. "", screenW * 0.7971, screenH * 0.0651, screenW * 0.9926, screenH * 0.1003, tocolor(0, 0, 0, 254), 1.20, "default-bold", "center", "center", false, false, false, true, false)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...