OutdatedPaX Menu Release

Posts 1–9 of 9 · Page 1 of 1
PaX Menu Release
Code:
surface.CreateFont("PaX_ButtonFont", {
    font = "Trebuchet",
    size = 21,
})

local pVars = {
    Aimbot = {
        Enabled = false,
    },
}

local function DrawText(txt, font, x, y, col, left)
    draw.SimpleText(txt, font, x, y, col, left and TEXT_ALIGN_LEFT or TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end

local function FillRGBA(x, y, wid, height, col)
    surface.SetDrawColor(col)
    surface.DrawRect(x, y, wid, height)
end

local function CreateButton(txt, type, val, x, y, frame, tbl)
    surface.SetFont("PaX_ButtonFont")
    local twid = surface.GetTextSize(txt)
    local btn = vgui.Create("DButton", frame)
    btn:SetSize(twid + 25, 20)
    btn:SetPos(x, y)
    btn:SetText("")
    btn.Paint = function(self, wid, height)
        FillRGBA(0, 0, 20, height, Color(51, 204, 255, 255))
        
        if !tbl[type][val] then
            FillRGBA(2, 2, 16, 16, Color(255, 255, 255, 255))
        end

        DrawText(txt, "PaX_ButtonFont", 25, 10, Color(185, 185, 185), true)
    end

    btn.DoClick = function()
        tbl[type][val] = !tbl[type][val]
        surface.PlaySound("buttons/blip1.wav")
    end
end

local bool = true

local function gMenu()
    local main = vgui.Create("DFrame")
    main:SetSize(625, 500)
    main:SetTitle("")
    main:Center()
    main:MakePopup()
    main:ShowCloseButton(false)
    main.Paint = function(self, wid, height)
        FillRGBA(0, 0, wid, 30, Color(51, 204, 255, 255))
        DrawText("PaX Menu", "Trebuchet24", wid / 2, 15, Color(255, 255, 255))
        FillRGBA(0, 30, wid, height, Color(255, 255, 255, 255))
    end

    local close = vgui.Create("DButton", main)
    close:SetSize(30, 30)
    close:SetPos(595, 0)
    close:SetText("")
    close.Paint = function(self, wid, height)
        FillRGBA(0, 0, wid, height, Color(235, 25, 19, 255))
        DrawText("x", "Trebuchet24", wid / 2, height / 2 - 1, Color(255, 255, 255))
    end

    close.DoClick = function()
        main:Close()
    end

    CreateButton("Aimbot Enabled", "Aimbot", "Enabled", 12, 40, main, pVars)
end

concommand.Add("gmenu", gMenu)
the meme video made up for the code.
How would you link a function to the button, like if i wanted to connect an ESP button to turn the esp on and off, how would i write that?
Quote Originally Posted by Insanity6666 View Post
How would you link a function to the button, like if i wanted to connect an ESP button to turn the esp on and off, how would i write that?
local function CreateButton(txt, type, val, x, y, frame, tbl)
the createbutton function has a var argument, put an var in there that checks whether or not your esp should be on
Yeah, i know that but i only know afew ways of making a function link to a variable like,

if GetConVarNumber("esp") == 1 then

But i am not to sure on how you would write it on to code like this, since you can write it all differently.
Quote Originally Posted by Insanity6666 View Post
Yeah, i know that but i only know afew ways of making a function link to a variable like,

if GetConVarNumber("esp") == 1 then

But i am not to sure on how you would write it on to code like this, since you can write it all differently.
btn.DoClick = function()
tbl[type][val] = !tbl[type][val]
surface.PlaySound("buttons/blip1.wav")
end

just change that to check if the cvar is one then change it to 0 blah blah runconsolecommand and getconvar():GetInt()
Working?????
How should I compile it? Just Ctrl C and V to make it work?
Quote Originally Posted by piritonga View Post
How should I compile it? Just Ctrl C and V to make it work?
are you still fucking those donkeys or something, obviously this isn't C++, why have you been asking that in every post
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us