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.

Please I Am In Desperate Help With This Error I Encountered FIXED

Discussion in 'DarkRP Modding Questions & Help' started by ✰VLRP✰ Kale Meadows, Nov 5, 2017.

  1. I got the gemstone printer pack and wanted to add a extra printer to it but when i did that but the printer doesn't have a money amount on it and i got this error.
    [ERROR] addons/darkrpmodification/lua/entities/nuclear_money_printer/cl_init.lua:24: bad argument #1 to 'GetTextSize' (string expected, got nil)
    1. GetTextSize - [C]:-1
    2. unknown - addons/darkrpmodification/lua/entities/nuclear_money_printer/cl_init.lua:24

    This is the coding i had for the money printer (Client Side):

    include("shared.lua")

    function ENT:Initialize()
    end

    function ENT:Draw()
    self:DrawModel()

    local Pos = self:GetPos()
    local Ang = self:GetAngles()

    local owner = self:Getowning_ent()
    owner = (IsValid(owner) and owner:Nick()) or DarkRP.getPhrase("unknown")

    local txt1 = gemstone.config.nuclearename
    txt2 = "$" ..self:GetNWInt("PrintA")

    surface.SetFont("HUDNumber5")
    local TextWidth = surface.GetTextSize(txt1)
    local TextWidth2 = surface.GetTextSize(txt2)
    local TextWidth3 = surface.GetTextSize(owner)

    Ang:RotateAroundAxis(Ang:Up(), 90)

    cam.Start3D2D(Pos + Ang:Up() * 11.5, Ang, 0.11)
    draw.WordBox(2, -TextWidth 3*0.5, -78, owner, "HUDNumber5", Color(0, 0, 0, 100), Color(255,255,255,255)
    draw.WordBox(2, -TextWidth *0.5, -30, txt1, "HUDNumber5", Color(0, 0, 0, 100), Color(255,255,255,255))
    draw.WordBox(2, -TextWidth 2*0.5, 18, txt2, "HUDNumber5", Color(0, 0, 0, 100), Color(255,255,255,255))
    cam.End3D2D()
    end
    --- Double Post Merged, Nov 5, 2017 ---
    The ":D" is meant to be ": D" (but without the space)
     
    Last edited: Nov 5, 2017
  2. Aeioyoo

    Aeioyoo Member

    Can I see your gemstone config file?
    You've put "gemstone.config.nuclearename" So I'm guessing the "e" on nuclear was a typo, depends on if it is different in the config
     
  3. gemstone.config.topazname = "Topaz Printer"
    gemstone.config.topazcolor = Color( 242, 207, 107, 255 )
    gemstone.config.topazprintamount = 100
    gemstone.config.topazprinttime = 5

    -- Amethyst Printer Settings
    gemstone.config.amethystname = "Amethyst Printer"
    gemstone.config.amethystcolor = Color( 153, 102, 204, 255 )
    gemstone.config.amethystprintamount = 200
    gemstone.config.amethystprinttime = 5

    -- Emerald Printer Settings
    gemstone.config.emeraldname = "Emerald Printer"
    gemstone.config.emeraldcolor = Color( 0, 112, 60, 255 )
    gemstone.config.emeraldprintamount = 350
    gemstone.config.emeraldprinttime = 5
    -- Ruby Printer Settings
    gemstone.config.rubyname = "Ruby Printer"
    gemstone.config.rubycolor = Color( 224, 17, 95, 255 )
    gemstone.config.rubyprintamount = 520
    gemstone.config.rubyprinttime = 5

    -- Sapphire Printer Settings
    gemstone.config.sapphirename = "Sapphire Printer"
    gemstone.config.sapphirecolor = Color( 15, 82, 186, 255 )
    gemstone.config.sapphireprintamount = 750
    gemstone.config.sapphireprinttime = 4

    -- Nuclear Printer Settings
    gemstone.config.nuclearname = "Nuclear Printer"
    gemstone.config.nuclearcolor = Color( 15, 232, 31, 255 )
    gemstone.config.nuclearprintamount = 750
    gemstone.config.nuclearprinttime = 0.5
     
  4. Aeioyoo

    Aeioyoo Member

    Yeah, you put "gemstone.config.nuclearname" in config, but in your code, you put "gemstone.config.nuclearename" where it says local txt1 =
     
  5. I changed it but now the printer has went invisible and is saying
    [ERROR] addons/darkrpmodification/lua/entities/nuclear_money_printer/cl_init.lua:31: ')' expected near '3'
    1. unknown - addons/darkrpmodification/lua/entities/nuclear_money_printer/cl_init.lua:0
     
  6. Aeioyoo

    Aeioyoo Member

    You need another ) after the first draw word box
     
  7. i still get the same problem

    [ERROR] addons/darkrpmodification/lua/entities/nuclear_money_printer/cl_init.lua:31: ')' expected near '3'
    1. unknown - addons/darkrpmodification/lua/entities/nuclear_money_printer/cl_init.lua:0
    --- Double Post Merged, Nov 5, 2017 ---
    And im also getting a error saying
    ERROR] Lua is unable to understand file "darkrp_config/disabled_defaults.lua" because its author made a mistake around line number 139.
    The best help I can give you is this:

    There is an opening '{' bracket at line 137, but this bracket is never closed or not closed in time. It was expected to be closed before the '[' at line 139.

    Hints:
    - Did you forget a comma?
    - All open brackets ({, (, [) must have a matching closing bracket. Are you sure it's there?
    - Brackets must be opened and closed in the right order. This will work: ({}), but this won't: ({)}.

    ------- End of Simplerr error -------
    and also

    [ERROR] addons/darkrpmodification/lua/darkrp_config/disabled_defaults.lua:139: '}' expected (to close '{' at line 137) near '['
    1. unknown - addons/darkrpmodification/lua/darkrp_config/disabled_defaults.lua:



    The Disabled Defaults Area:
    134. --[[---------------------------------------------------------------------------
    135. Agendas
    136. ---------------------------------------------------------------------------]]
    137. DarkRP.disabledDefaults["agendas"] = {
    138. ["Gangster's agenda"] = false
    139. ["Police agenda"] = false
    140. }
     
    Last edited: Nov 5, 2017
  8. Aeioyoo

    Aeioyoo Member

    Theres a random "3" after text width on the same line
    And a random "2" on the last wordbox after text width
     
  9. Thanks it fixed the previous problem but there is still the other one which is now disabling the printers and other stuff
    --- Double Post Merged, Nov 5, 2017 ---
    I think i have fixed it if i reply to this again i will still have a problem (it was because i forgot to put ,
     
    Last edited: Nov 5, 2017

Share This Page