1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

Lockdown Problem

Discussion in 'DarkRP Modding Questions & Help' started by Totoro, Mar 10, 2015.

  1. Totoro

    Totoro Member

    Hi there,

    While I am somewhat ok with coding lua (more toward the noob end), I can't figure this one out.
    When the mayor initiates a lockdown, the notification appears in the chatbox, but the big red "The mayor has initiated a lockdown, please return to your homes." message doesn't appear above the HUD. The one in the chatbox disappears after chat messages push it up, so people forget there is a lockdown and the whole thing becomes pointless.

    Any ideas what is causing this?
     
  2. Matryan

    Matryan Well-Known Member

    Are you using a custom HUD?
     
  3. Totoro

    Totoro Member

    Yes, I'm using SleekHUD. I added the lockdown function to its lua file, which didn't help.
     
  4. Matryan

    Matryan Well-Known Member

    Wait so you copied and pasted the whole lockdown function from the default HUD?
    Did you actually execute the function in the HUDPaint() hook though?
     
  5. Totoro

    Totoro Member

    I copied this from the default hud file:
    Code (Text):

    local function LockDown()
        local chbxX, chboxY = chat.GetChatBoxPos()
        if GetGlobalBool("DarkRP_LockDown") then
            local cin = (math.sin(CurTime()) + 1) / 2
            local chatBoxSize = math.floor(Scrh / 4)
            draw.DrawNonParsedText(DarkRP.getPhrase("lockdown_started"), "ScoreboardSubtitle", chbxX, chboxY + chatBoxSize, Color(cin * 255, 0, 255 - (cin * 255), 255), TEXT_ALIGN_RIGHT)
        end
    end
     
    and put it into SleekHUD's lua file.

    Now yea, I have to add LockDown() to the file to execute it, but when I do that, i get 10,000 lua errors in the console. Where exactly should LockDown() go?
     
  6. Matryan

    Matryan Well-Known Member

    Make sure it isn't inside the hudpaint hook/function but then just execute it inside the hudpaint hook.
     
  7. Totoro

    Totoro Member

    This was fixed by upgrading to 2.6
    Thanks.
     

Share This Page