1. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

HUD Error

Discussion in 'DarkRP Modding Questions & Help' started by Lewis!, Sep 3, 2017.

  1. Lewis!

    Lewis! New Member

    I have worked on a hud that is pretty simple and bad but it works for what i need lol, i am having a error saying
    [ERROR] addons/darkrpmodification-master/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:101: attempt to index a nil value
    1. unknown - addons/darkrpmodification-master/lua/darkrp_modules/hudreplacement/cl_hudreplacement.lua:101
    2. doInclude - [C]:-1
    3. loadModules - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:102
    4. Call - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:147
    5. unknown - gamemodes/darkrp/gamemode/cl_init.lua:56
    It causes my doors to not have text on them but if i click F2 they are still fully functional, I have tried to fix this but had no luck, any help will be appreciated :)
    surface.CreateFont( "normal", {
    font = "Arial",
    size = 25,
    weight = 500,
    blursize = 0,
    scanlines = 0,
    antialias = true,
    underline = false,
    italic = false,
    strikeout = false,
    symbol = false,
    rotary = false,
    shadow = false,
    additive = false,
    outline = false,
    } )

    surface.CreateFont( "normalkucuk", {
    font = "Arial",
    size = 24,
    weight = 500,
    blursize = 0,
    scanlines = 0,
    antialias = true,
    underline = false,
    italic = false,
    strikeout = false,
    symbol = false,
    rotary = false,
    shadow = false,
    additive = false,
    outline = false,
    } )



    local hide = {
    CHudHealth = true,
    CHudBattery = true,
    }

    hook.Add( "HUDShouldDraw", "HideHUD", function( name )
    if ( hide[ name ] ) then return false end


    end )



    hook.Add("HUDPaint" , "DrawMyHud" , function()


    local Health = LocalPlayer():Health()
    local Armor = LocalPlayer():Armor()
    local isim = LocalPlayer():GetName()
    money = LocalPlayer():getDarkRPVar("money")
    job = LocalPlayer():getDarkRPVar("job")




    draw.RoundedBox(0,8,986, 300+4 , 30 + 4,Color(40,40,40))
    draw.RoundedBox(0,10,988, Health*3,30,Color(255,120,120))
    draw.SimpleText("Health : "..Health.."","normal",10 + 150 , 10 + 992,Color(255,255,255),1,1)


    draw.RoundedBox(0,8,1024, 300+4 , 30 + 4,Color(40,40,40))
    draw.RoundedBox(0,10,1026, Armor*3,30,Color(100,100,255))
    draw.SimpleText("Armor : "..Armor.."","normal",10 + 150 , 10 + 1030,Color(255,255,255),1,1)

    draw.RoundedBox(0,8,948, 300+4 , 30 + 4,Color(40,40,40))
    draw.SimpleText("£"..money.."","normalkucuk",10 + 140 , 10 + 954,Color(255,255,255),1,1)

    draw.RoundedBox(0,8,910, 300+4 , 30 + 4,Color(40,40,40))
    draw.SimpleText(job.." - "..isim,"normalkucuk",10 + 140 , 10 + 916,Color(255,255,255),1,1)









    end)


    /*---------------------------------------------------------------------------
    Display notifications
    ---------------------------------------------------------------------------*/
    local function DisplayNotify(msg)
    local txt = msg:ReadString()
    GAMEMODE:AddNotify(txt, msg:ReadShort(), msg:ReadLong())
    surface.PlaySound("buttons/lightswitch2.wav")

    -- Log to client console
    MsgC(Color(255, 20, 20, 255), "[DarkRP] ", Color(200, 200, 200, 255), txt, "\n")
    end
    usermessage.Hook("_Notify", DisplayNotify)

    ["DarkRP_EntityDisplay"] = true
     
  2. Victor Hugo

    Victor Hugo New Member

    bu kodların hepsi tek bir dosya içindemi ??

    edit : Türk olduğunu anlamamın sebebi

    draw.SimpleText(job.." - "..isim,"normalkucuk",10 + 140 , 10 + 916,Color(255,255,255),1,1)
    --- Double Post Merged, Sep 10, 2017 ---
    Bu kodu cl_init.lua olarak kaydet.
    addons/customhud/lua/autorun/client içine atıp deneyebilir misin ?
    Olacağından emin değilim ama en azından dene derim.
     

Share This Page