Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "sdk.h"
- int MenuPosX = 20;
- int MenuPosY = 150;
- int TotalMenuItems;
- int CurrentMenuItem = 0;
- #define MAX_MENU_ITEMS 20
- struct MenuItem
- {
- bool on;
- string name;
- int value;
- bool istitle;
- };
- class Menu
- {
- public:
- void DrawMenu()
- {
- //Visuals.DrawRect(MenuPosX, MenuPosY, 180, TotalMenuItems * 18 + 5, Color(100, 100, 100, 255));
- if (!enabled) return;
- for (int x = 0; x < TotalMenuItems; x++)
- {
- char optname[35];
- sprintf(optname, mi[x].istitle ? "[%s]" : "%s %s", mi[x].name.c_str(), mi[x].on ? "[ON]" : "[OFF]");
- Visuals.DrawStringD(MenuPosX + 5, MenuPosY + (18 * x), mi[x].istitle ? Color(255, 255, 255, 255) : (mi[x].on ? Color(0, 255, 0, 255) : Color(255, 0, 0, 255)), mi[x].name.c_str());
- if (mi[x].istitle)
- Visuals.DrawStringD(MenuPosX + 6, MenuPosY + (18 * x) + 1, Color(255, 255, 255, 255), mi[x].name.c_str());
- }
- Visuals.DrawStringD(MenuPosX - 15, MenuPosY + (18 * CurrentMenuItem), Color(255, 255, 255, 255), "--)");
- }
- void AddItemToMenu(string name, bool title, bool onbydefault)
- {
- mi[TotalMenuItems].name = name;
- mi[TotalMenuItems].istitle = title;
- mi[TotalMenuItems].on = onbydefault;
- TotalMenuItems++;
- }
- void KeyboardInput()
- {
- if (GetAsyncKeyState(VK_INSERT))
- {
- Sleep(150);
- enabled = !enabled;
- }
- if (!enabled) return;
- if (CurrentMenuItem >= TotalMenuItems)
- {
- CurrentMenuItem = 0;
- }
- else if (CurrentMenuItem < 0)
- {
- CurrentMenuItem = (TotalMenuItems - 1);
- }
- if (GetAsyncKeyState(VK_DOWN))
- {
- Sleep(150);
- CurrentMenuItem++;
- }
- if (GetAsyncKeyState(VK_UP))
- {
- Sleep(150);
- CurrentMenuItem--;
- }
- if (GetAsyncKeyState(VK_RIGHT) || GetAsyncKeyState(VK_LEFT))
- {
- Sleep(150);
- mi[CurrentMenuItem].on = !mi[CurrentMenuItem].on;
- }
- }
- bool IsOn(int index)
- {
- return mi[index].on;
- }
- private:
- MenuItem mi[MAX_MENU_ITEMS];
- bool enabled;
- };
- extern Menu menu;
- --
- how to init (only run it once)
- menu.AddItemToMenu("PLAYER", true, false);
- menu.AddItemToMenu("Bunny hop", false, true);
- menu.AddItemToMenu("Aimbot", false, false);
Advertisement
Add Comment
Please, Sign In to add comment