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.

NX Weapon Selector Relocation

Discussion in 'DarkRP Modding Questions & Help' started by CrimsonHazeTV, Feb 8, 2017.

  1. CrimsonHazeTV

    CrimsonHazeTV New Member

    I had a server about 1-2 years ago and had an addon that replaces the default weapon selector, I found it again in a backup I had, but I want to change the location on screen, when you select a weapon it is in the far top right, I want it in the middle, issue is I can not remember if I paid for it, or if it was a free addon so I am a bit hesitant of posting here, can anyone help? I think if someone says they can help, I can send a PM with a shot piece of code?
    Looking at the code, it may be this, but unsure. Not very good with lua, so to me this all just looks like random letters haha

    Code (Text):

                local selected = curTab == i and curSlot == j
                --local height = selected and height * 2 + margin or height

                local height = height + (height + margin) * (slide[wep.classname] or 0)

                slide[wep.classname] = Lerp(FrameTime() * 10, slide[wep.classname] or 0, selected and 1 or 0)

                surface.SetDrawColor(selected and c00200200 or (wep.new and Color(0, math.abs(math.sin(RealTime())) * 255, 0, 127) or c000127))
                surface.DrawRect(offx, offy, width, height)

                local w, h = surface.GetTextSize(wep.name)
                if w > width then
                    w, h = surface.GetTextSize(wep.name)
                surface.SetTextPos(offx + (width - w) / 2, offy + (height - h) / 2)

                offy = offy + height + margin

  2. Pab14567

    Pab14567 Well-Known Member

    Well that's one of them, but you don't need to really be good with Lua to know positioning. It's just trial and error ( depending on your resolution ( might want to use ScrH() and ScrW() for the addon to fit all resolutions ) )
    CrimsonHazeTV likes this.
  3. Sir Klutch

    Sir Klutch Active Member

    Find offx, offy, width, and height and play with the number values.

    Width, height will most likely not be touched. Although, x and y will.
    CrimsonHazeTV likes this.
  4. Im_Not_HOBO

    Im_Not_HOBO New Member

    Can you give me that script

Share This Page