Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <wchar.h>
- #include <sys/prx.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <sys/syscall.h>
- #include <sys/ppu_thread.h>
- #include <string.h>
- #include <cstring>
- #include <sys/sys_time.h>
- #include <sys/time_util.h>
- #include <stdarg.h>
- #include <assert.h>
- #include <sys/process.h>
- #include <sys/memory.h>
- #include <sys/timer.h>
- #include <sys/return_code.h>
- #include <sys/prx.h>
- #include <stddef.h>
- #include <math.h>
- #include <stdarg.h>
- #include <cellstatus.h>
- #include <typeinfo>
- #include <vector>
- #include <pthread.h>
- #include <locale.h>
- #include <cell/error.h>
- #include <sys/paths.h>
- #include <time.h>
- SYS_MODULE_INFO( StankysMw3Base, 0, 1, 1);
- SYS_MODULE_START( _StankysMw3Base_prx_entry );
- SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
- SYS_LIB_EXPORT( _StankysMw3Base_export_function, LIBNAME );
- sys_ppu_thread_t Mw3Base;
- sys_ppu_thread_t create_thread(void (*entry)(uint64_t), int priority, size_t stacksize, const char* threadname,sys_ppu_thread_t id)
- {
- if(sys_ppu_thread_create(&id, entry, 0, priority , stacksize, 0, threadname) == CELL_OK)
- {
- //console_write("\n\n Mw2_Menu_Loaded!\n\n");
- }
- return id;
- }
- //Dont Worry About This Shit "Just Keep Scrolling Down"
- void sleep(usecond_t time) //1 second = 1000
- {
- sys_timer_usleep(time * 1000);
- }
- #define TOC 0x0072DCE8
- struct opd_s
- {
- uint32_t sub;
- uint32_t toc;
- };
- namespace TOC_Calls
- {
- opd_s SV_GameSendServerCommand_t = { 0x228FA8, TOC };
- void(*SV_GameSendServerCommand)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV_GameSendServerCommand_t;
- };
- namespace Huds
- {
- union color_s
- {
- struct
- {
- int8_t r;
- int8_t g;
- int8_t b;
- int8_t a;
- };
- int32_t rgba;
- };
- struct hudelem_s
- {
- int type;
- float x;
- float y;
- float z;
- int targetEntNum;
- float fontScale;
- float fromFontScale;
- float fontScaleStartTime;
- float fontScaleTime;
- int font;
- int alignOrg;
- int alignScreen;
- color_s color;
- color_s fromColor;
- int fadeStartTime;
- int fadeTime;
- int label;
- int width;
- int height;
- int materialIndex;
- int fromWidth;
- int fromHeight;
- int scaleStartTime;
- int scaleTime;
- float fromX;
- float fromY;
- int fromAlignOrg;
- int fromAlignScreen;
- int moveStartTime;
- int moveTime;
- int time;
- int duration;
- float value;
- int text;
- float sort;
- color_s glowColor;
- int fxBirthTime;
- int fxLetterTime;
- int fxDecayStartTime;
- int fxDecayDuration;
- int soundID;
- int flags;
- };
- struct game_hudelem_s
- {
- hudelem_s elem;
- int clientNum;
- int team;
- int archived;
- };
- int G_LocalizedStringIndex(const char* Text)
- {
- opd_s Localized = { 0x001BE6CC, TOC };
- int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&Localized;
- return LocalizedStringIndex(Text);
- }
- opd_s GMI = { 0x001BE744, TOC };
- int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
- game_hudelem_s* HudElem_Alloc()
- {
- for (int i = 0; i < 1024; i++)
- {
- game_hudelem_s* elem = (game_hudelem_s*)(0x00F0E10C + (i * 0xB4));
- if (!elem->elem.type) return elem;
- }
- return (game_hudelem_s*)-1;
- }
- game_hudelem_s* setShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
- {
- game_hudelem_s* elem = HudElem_Alloc();
- elem->clientNum = clientIndex;
- elem->elem.type = 4;
- *(int*)0x00F3B198 = 1;
- elem->elem.materialIndex = Shader;
- *(int*)0x00F3B198 = 0;
- elem->elem.width = Width;
- elem->elem.height = Height;
- elem->elem.x = X;
- elem->elem.y = Y;
- elem->elem.alignOrg = Allign;
- elem->elem.color.r = R;
- elem->elem.color.g = G;
- elem->elem.color.b = B;
- elem->elem.color.a = A;
- return elem;
- }
- game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
- {
- game_hudelem_s* Elem = HudElem_Alloc();
- Elem->clientNum = clientIndex;
- Elem->elem.type = 1;
- Elem->elem.text = G_LocalizedStringIndex(Text);
- Elem->elem.font = Font;
- Elem->elem.fontScale = FontScale;
- if (Allign != 0)
- { Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
- else
- { Elem->elem.x = X; Elem->elem.y = Y; }
- Elem->elem.color.r = R;
- Elem->elem.color.g = G;
- Elem->elem.color.b = B;
- Elem->elem.color.a = A;
- Elem->elem.glowColor.r = glowR;
- Elem->elem.glowColor.g = glowG;
- Elem->elem.glowColor.b = glowB;
- Elem->elem.glowColor.a = glowA;
- return Elem;
- }
- void HudElem_DestroyAll()
- {
- opd_s HDA = { 0x001872E8, TOC };
- void(*HudElemDestroyAll)() = (void(*)())&HDA;
- HudElemDestroyAll();
- }
- void FoneScaleOverTime(game_hudelem_s* Elem, float FontSize, float Time)
- {
- Elem->elem.fromFontScale = Elem->elem.fontScale;
- Elem->elem.fontScaleTime = Time;
- Elem->elem.fontScaleStartTime = *(int*)0x00FC3DB0;
- Elem->elem.fontScale = FontSize;
- }
- void ScaleOverTime(game_hudelem_s *Elem, int time, float width, float height)
- {
- Elem->elem.fromHeight = Elem->elem.height;
- Elem->elem.fromWidth = Elem->elem.width;
- Elem->elem.scaleStartTime = *(int*)0x00FC3DB0;
- Elem->elem.scaleTime = (int)floor(time * 1000 + 0.5);
- Elem->elem.height = height;
- Elem->elem.width = width;
- }
- void MoveOverTime(game_hudelem_s *Elem, int time, float x, float y)
- {
- Elem->elem.fromX = Elem->elem.x;
- Elem->elem.fromY = Elem->elem.y;
- Elem->elem.fromAlignOrg = Elem->elem.alignOrg;
- Elem->elem.fromAlignScreen = Elem->elem.alignScreen;
- Elem->elem.moveStartTime = *(int*)0x00FC3DB0;
- Elem->elem.moveTime = (int)floor(time * 1000 + 0.5);
- Elem->elem.x = x;
- Elem->elem.y = y;
- }
- void FadeOverTime(game_hudelem_s* Elem, float Time, int R, int G, int B, int A)
- {
- Elem->elem.fromColor = Elem->elem.color;
- Elem->elem.color.r = R;
- Elem->elem.color.g = G;
- Elem->elem.color.b = B;
- Elem->elem.color.a = A;
- Elem->elem.fadeTime = (int)floor(Time * 1000 + 0.5);
- Elem->elem.fadeStartTime = *(int*)0x00FC3DB0;
- }
- };
- void ChangeText(Huds::game_hudelem_s * elem, char* newText)
- {
- elem->elem.text = Huds::G_LocalizedStringIndex(newText);
- }
- Huds::game_hudelem_s* Background[18];
- Huds::game_hudelem_s* LeftBar[18];
- Huds::game_hudelem_s* RightBar[18];
- Huds::game_hudelem_s* Scroller[18];
- Huds::game_hudelem_s* MenuTitle[18];
- Huds::game_hudelem_s* CreatedBy[18];
- Huds::game_hudelem_s* Title[18];
- Huds::game_hudelem_s* Options[18];
- namespace Variables
- {
- bool MenuStarted;
- bool IsHost;
- int MaxScroll[18];
- int MenuType[18];
- char* CurMenu[18];
- char* SubName = "Main Menu";
- bool MenuOpen[18];
- char* PreviousMenu[18];
- char* PreviousMenu2[18];
- int Scroll[18];
- char* TitleText[18];
- char* OptionText[18];
- int MainScroll[18];
- int SubScroll[18];
- };
- namespace Offsets
- {
- int cl_InGame = 0x018d4c64;
- };
- bool InGame()
- {
- if (*(char*)Offsets::cl_InGame != 1)
- return false;
- return true;
- }
- int client_s(int clientIndex)
- {
- return *(int*)0x17BB210 + (0x68B80 * clientIndex);
- }
- int getInt(const char* button)
- {
- switch(*(char*) button)
- {
- //case "+actionslot 1";
- return 0x3135;
- break;
- }
- }
- //End
- //Butons
- namespace Buttons
- {
- enum Buttons
- {
- Up = 0x3135,
- Down = 0x3137,
- Left = 0x3139,
- Right = 0x3231,
- X = 0x3235,
- Square = 0x3131,
- Triangle = 0x3430,
- L1 = 0x3133,
- L2 = 0x3700,
- L3 = 0x3900,
- R1 = 0x3100,
- R2 = 0x3500,
- R3 = 0x3237
- };
- bool DetectBtn(int clientIndex, Buttons Btn)
- {
- return *(short*)(*(int*)0x017BB210 + (clientIndex * 0x68B80) + 0x21022) == Btn;
- }
- };
- bool isButtonPressed(int client, const char* button)
- {
- if(*(int*)client_s(client) + 0x21022 == getInt(button))
- return true;
- return false;
- }
- //Buttons End
- //Menu Base Below
- int GetMenuInfo(int client, char* Menu)
- {
- if(Menu == Variables::SubName)
- {
- Variables::TitleText[client] = Variables::SubName;//creates the text for the title of that menu
- Variables::OptionText[client] = "Sub Menu 1\nSub Menu 2\nSub Menu 3\nSub Menu 4\nSub Menu 5\nSub Menu 6\nSub Menu 7\nSub Menu 8\nSub Menu 9\nSub Menu 10\nSub Menu 11\nSub Menu 12\nSub Menu 13\nSub Menu 14\nSub Menu 15";//creats the text in the menu
- return 14;//Returns the maximum scroll
- }
- else if(Menu == "Sub Menu 1")
- {
- Variables::TitleText[client] = "Sub Menu 1";
- Variables::OptionText[client] = "God Mode\nNo Clip\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 2")
- {
- Variables::TitleText[client] = "Sub Menu 2";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 3")
- {
- Variables::TitleText[client] = "Sub Menu 3";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 4")
- {
- Variables::TitleText[client] = "Sub Menu 4";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 5")
- {
- Variables::TitleText[client] = "Sub Menu 5";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 6")
- {
- Variables::TitleText[client] = "Sub Menu 6";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 7")
- {
- Variables::TitleText[client] = "Sub Menu 7";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 8")
- {
- Variables::TitleText[client] = "Sub Menu 8";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 9")
- {
- Variables::TitleText[client] = "Sub Menu 9";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 10")
- {
- Variables::TitleText[client] = "Sub Menu 10";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 11")
- {
- Variables::TitleText[client] = "Sub Menu 11";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 12")
- {
- Variables::TitleText[client] = "Sub Menu 12";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 13")
- {
- Variables::TitleText[client] = "Sub Menu 13";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 14")
- {
- Variables::TitleText[client] = "Sub Menu 14";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else if(Menu == "Sub Menu 15")
- {
- Variables::TitleText[client] = "Sub Menu 15";
- Variables::OptionText[client] = "Option 1\nOption 2\nOption 3\nOption 4\nOption 5\nOption 6\nOption 7\nOption 8\nOption 9\nOption 10\nOption 11\nOption 12\nOption 13\nOption 14\nOption 15";
- return 14;
- }
- else
- {
- Variables::TitleText[client] = "Error";
- Variables::OptionText[client] = "Error";
- return 0;
- }
- }
- //Menu Base Huds
- void StoreHuds(int clientIndex)
- {
- Background[clientIndex] = Huds::setShader(clientIndex, 1, 250, 480, -500, 0, 0, 0, 0, 0, 150);//Background
- LeftBar[clientIndex] = Huds::setShader(clientIndex, 1, 2, 480, 198, 999, 0, 255, 0, 0, 255);//Left Bar
- RightBar[clientIndex] = Huds::setShader(clientIndex, 1, 2, 480, 450, 999, 0, 255, 0, 0, 255);//Right Bar
- Scroller[clientIndex] = Huds::setShader(clientIndex, 1, 250, 18, -500, 0, 0, 0, 0, 0, 255);//Scroller
- MenuTitle[clientIndex] = Huds::setText(clientIndex, "Menu Base", 1, 1.5, -500, 130, 0, 255, 255, 255, 255, 255, 0, 0, 255);//Title Text
- CreatedBy[clientIndex] = Huds::setText(clientIndex, "Created By: oStankyModz", 1, 0.5, -500, 130, 0, 255, 255, 255, 255, 255, 0, 0, 255);//Created By
- Title[clientIndex] = Huds::setText(clientIndex, "Main Menu", 1, 0.9, -500, 130, 0, 255, 255, 255, 255, 255, 0, 0, 255);//Main Menu Text
- Options[clientIndex] = Huds::setText(clientIndex, " ", 4, 1.4, -500, 200, 0, 255, 255, 255, 255, 0, 0, 0, 255);//Sub Menu 1
- };
- void RunMenu(int client)
- {
- Variables::MaxScroll[client] = GetMenuInfo(client, Variables::SubName);
- ChangeText(Title[client], Variables::TitleText[client]);
- ChangeText(Options[client], Variables::OptionText[client]);
- Huds::MoveOverTime(Background[client], 0.8, 200, 0);//Background
- Huds::MoveOverTime(LeftBar[client], 0.8, 198, 0);//Left Bar
- Huds::MoveOverTime(RightBar[client], 0.8, 450, 0);//Right Bar
- Huds::MoveOverTime(Scroller[client], 0.8, 200, 120);//Scroller
- Huds::MoveOverTime(MenuTitle[client], 0.8, 230, 40);//Menu Title
- Huds::MoveOverTime(CreatedBy[client], 0.8, 250, 440);//Created By
- Huds::MoveOverTime(Title[client], 0.8, 270, 80);//Main Menu Title
- Huds::MoveOverTime(Options[client], 0.8, 290, 120);//Options Text
- Variables::CurMenu[client] = "Main Menu";
- Variables::MenuType[client] ++;
- Variables::MenuOpen[client] = true;
- };
- void DeleteHuds(int client)
- {
- Huds::MoveOverTime(Background[client], 0.50, -500, 0);//Background
- Huds::MoveOverTime(LeftBar[client], 0.50, -500, 0);//Left Bar
- Huds::MoveOverTime(RightBar[client], 0.50, -500, 0);//Right Bar
- Huds::MoveOverTime(Scroller[client], 0.50, -500, 120);//Scroller
- Huds::MoveOverTime(MenuTitle[client], 0.50, -500, 100);//Menu Title
- Huds::MoveOverTime(CreatedBy[client], 0.50, -500, 450);//Created By
- Huds::MoveOverTime(Title[client], 0.50, -500, 200);//Main Menu Title
- Huds::MoveOverTime(Options[client], 0.50, -500, 290);//Options Text
- };
- //Menu Base Huds End
- //Menu Functions "God Mode, No Clip, Ect"
- namespace Mods
- {
- bool GM[18];
- void GodMode(int client)
- {
- if(GM[client] == false)
- {
- *(char*)(0x0FCA41E + 0x280 * client) = 0xFF;
- TOC_Calls::SV_GameSendServerCommand(client, 1, "f \"God Mode ^7[^2On^7]\"");
- GM[client] = true;
- }
- else
- {
- *(char*)(0x0FCA41E + 0x280 * client) = 0x00;
- TOC_Calls::SV_GameSendServerCommand(client, 1, "f \"God Mode ^7[^1Off^7]\"");
- GM[client] = false;
- }
- }
- bool NC[18];
- void NoClip(int client)
- {
- if(NC[client] == false)
- {
- *(char*)(0x0110d87f + 0x3980 * client) = 0x01;
- TOC_Calls::SV_GameSendServerCommand(client, 1, "f \"No Clip ^7[^2On^7]\"");
- NC[client] = true;
- }
- else
- {
- *(char*)(0x0110d87f + 0x3980 * client) = 0x00;
- TOC_Calls::SV_GameSendServerCommand(client, 1, "f \"No Clip ^7[^1Off^7]\"");
- NC[client] = false;
- }
- }
- };
- //Menu Functions End
- //Menu Base Sub Functions "Dont Need To Edit This Stuff"
- void LoadText(int client)
- {
- Huds::FadeOverTime(Title[client], 0.50, 0, 0, 0, 0);
- Huds::FadeOverTime(Options[client], 0.50, 0, 0, 0, 0);
- sleep(100);
- ChangeText(Title[client], Variables::TitleText[client]);
- ChangeText(Options[client], Variables::OptionText[client]);
- sleep(100);
- Huds::FadeOverTime(Title[client], 0.50, 255, 255, 255, 255);
- Huds::FadeOverTime(Options[client], 0.50, 255, 255, 255, 255);
- }
- void UpdateScroll(int client)
- {
- float scrollpos = 120 + (16.8 * Variables::Scroll[client]);
- Huds::MoveOverTime(Scroller[client], 0.50, 200, scrollpos);
- sleep(50);
- }
- void UpdateScrollLoad(int client)
- {
- float scrollpos = 120 + (16.8 * Variables::Scroll[client]);
- Huds::MoveOverTime(Scroller[client], 0.50, 200, scrollpos);
- sleep(50);
- }
- void LoadSub(int client, char* NewMenu, int scroll)
- {
- if(Variables::MenuType[client] == 1)
- {
- Variables::MainScroll[client] = scroll;
- Variables::Scroll[client] = 0;
- UpdateScrollLoad(client);
- Variables::CurMenu[client] = NewMenu;
- Variables::MenuType[client] ++;
- Variables::MaxScroll[client] = GetMenuInfo(client, NewMenu);
- LoadText(client);
- }
- else if(Variables::MenuType[client] == 2)
- {
- Variables::SubScroll[client] = scroll;
- Variables::Scroll[client] = 0;
- UpdateScrollLoad(client);
- Variables::PreviousMenu[client] = Variables::CurMenu[client];
- Variables::CurMenu[client] = NewMenu;
- Variables::MenuType[client] ++;
- Variables::MaxScroll[client] = GetMenuInfo(client, NewMenu);
- LoadText(client);
- }
- else if(Variables::MenuType[client] > 2)
- {
- Variables::Scroll[client] = 0;
- UpdateScrollLoad(client);
- Variables::PreviousMenu2[client] = Variables::CurMenu[client];
- Variables::CurMenu[client] = NewMenu;
- Variables::MenuType[client] ++;
- Variables::MaxScroll[client] = GetMenuInfo(client, NewMenu);
- LoadText(client);
- }
- }
- void Return(int client)
- {
- if(Variables::MenuType[client] == 2)
- {
- Variables::Scroll[client] = Variables::MainScroll[client];
- UpdateScroll(client);
- Variables::CurMenu[client] = Variables::SubName;
- Variables::MenuType[client] --;
- Variables::MaxScroll[client] = GetMenuInfo(client, Variables::SubName);
- LoadText(client);
- }
- else if(Variables::MenuType[client] == 3)
- {
- Variables::Scroll[client] = Variables::SubScroll[client];
- UpdateScroll(client);
- Variables::CurMenu[client] = Variables::PreviousMenu[client];
- Variables::MenuType[client] --;
- Variables::MaxScroll[client] = GetMenuInfo(client, Variables::PreviousMenu[client]);
- LoadText(client);
- }
- else if(Variables::MenuType[client] > 3)
- {
- Variables::Scroll[client] = 0;
- UpdateScroll(client);
- Variables::CurMenu[client] = Variables::PreviousMenu2[client];
- Variables::MenuType[client] --;
- Variables::MaxScroll[client] = GetMenuInfo(client, Variables::PreviousMenu2[client]);
- LoadText(client);
- }
- }
- bool MenuLoaded;
- bool menuOpen[18];
- //Menu Base Sub Functions End
- //Menu Selection "Where Functions Go"
- void MenuSelection(int client, char* Menu, int scroll)
- {
- if(Menu == "Main Menu")
- {
- if(scroll == 0)
- {
- LoadSub(client, "Sub Menu 1", scroll);
- }
- if(scroll == 1)
- {
- LoadSub(client, "Sub Menu 2", scroll);
- }
- if(scroll == 2)
- {
- LoadSub(client, "Sub Menu 3", scroll);
- }
- if(scroll == 3)
- {
- LoadSub(client, "Sub Menu 4", scroll);
- }
- if(scroll == 4)
- {
- LoadSub(client, "Sub Menu 5", scroll);
- }
- if(scroll == 5)
- {
- LoadSub(client, "Sub Menu 6", scroll);
- }
- if(scroll == 6)
- {
- LoadSub(client, "Sub Menu 7", scroll);
- }
- if(scroll == 7)
- {
- LoadSub(client, "Sub Menu 8", scroll);
- }
- if(scroll == 8)
- {
- LoadSub(client, "Sub Menu 9", scroll);
- }
- if(scroll == 9)
- {
- LoadSub(client, "Sub Menu 10", scroll);
- }
- if(scroll == 10)
- {
- LoadSub(client, "Sub Menu 11", scroll);
- }
- if(scroll == 11)
- {
- LoadSub(client, "Sub Menu 12", scroll);
- }
- if(scroll == 12)
- {
- LoadSub(client, "Sub Menu 13", scroll);
- }
- if(scroll == 13)
- {
- LoadSub(client, "Sub Menu 14", scroll);
- }
- if(scroll == 14)
- {
- LoadSub(client, "Sub Menu 15", scroll);
- }
- }
- if(Menu == "Sub Menu 1")
- {
- if(scroll == 0)
- {
- Mods::GodMode(client);
- }
- if(scroll == 1)
- {
- Mods::NoClip(client);
- }
- }
- if(Menu == "Sub Menu 2")
- {
- if(scroll == 0)
- {
- //Sub Menu 2 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 2 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 2 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 2 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 2 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 2 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 2 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 2 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 2 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 2 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 2 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 2 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 2 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 2 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 2 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 3")
- {
- if(scroll == 0)
- {
- //Sub Menu 3 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 3 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 3 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 3 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 3 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 3 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 3 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 3 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 3 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 3 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 3 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 3 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 3 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 3 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 3 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 4")
- {
- if(scroll == 0)
- {
- //Sub Menu 4 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 4 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 4 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 4 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 4 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 4 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 4 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 4 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 4 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 4 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 4 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 4 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 4 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 4 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 4 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 5")
- {
- if(scroll == 0)
- {
- //Sub Menu 5 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 5 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 5 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 5 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 5 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 5 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 5 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 5 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 5 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 5 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 5 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 5 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 5 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 5 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 5 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 6")
- {
- if(scroll == 0)
- {
- //Sub Menu 6 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 6 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 6 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 6 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 6 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 6 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 6 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 6 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 6 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 6 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 6 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 6 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 6 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 6 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 6 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 7")
- {
- if(scroll == 0)
- {
- //Sub Menu 7 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 7 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 7 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 7 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 7 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 7 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 7 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 7 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 7 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 7 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 7 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 7 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 7 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 7 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 7 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 8")
- {
- if(scroll == 0)
- {
- //Sub Menu 8 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 8 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 8 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 8 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 8 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 8 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 8 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 8 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 8 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 8 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 8 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 8 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 8 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 8 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 8 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 9")
- {
- if(scroll == 0)
- {
- //Sub Menu 9 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 9 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 9 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 9 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 9 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 9 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 9 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 9 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 9 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 9 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 9 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 9 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 9 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 9 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 9 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 10")
- {
- if(scroll == 0)
- {
- //Sub Menu 10 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 10 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 10 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 10 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 10 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 10 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 10 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 10 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 10 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 10 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 10 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 10 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 10 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 10 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 10 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 11")
- {
- if(scroll == 0)
- {
- //Sub Menu 11 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 11 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 11 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 11 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 11 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 11 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 11 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 11 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 11 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 11 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 11 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 11 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 11 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 11 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 11 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 12")
- {
- if(scroll == 0)
- {
- //Sub Menu 12 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 12 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 12 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 12 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 12 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 12 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 12 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 12 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 12 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 12 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 12 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 12 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 12 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 12 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 12 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 13")
- {
- if(scroll == 0)
- {
- //Sub Menu 13 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 13 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 13 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 13 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 13 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 13 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 13 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 13 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 13 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 13 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 13 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 13 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 13 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 13 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 13 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 14")
- {
- if(scroll == 0)
- {
- //Sub Menu 14 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 14 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 14 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 14 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 14 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 14 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 14 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 14 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 14 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 14 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 14 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 14 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 14 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 14 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 14 Option 15 Here
- }
- }
- if(Menu == "Sub Menu 15")
- {
- if(scroll == 0)
- {
- //Sub Menu 15 Option 1 Here
- }
- if(scroll == 1)
- {
- //Sub Menu 15 Option 2 Here
- }
- if(scroll == 2)
- {
- //Sub Menu 15 Option 3 Here
- }
- if(scroll == 3)
- {
- //Sub Menu 15 Option 4 Here
- }
- if(scroll == 4)
- {
- //Sub Menu 15 Option 5 Here
- }
- if(scroll == 5)
- {
- //Sub Menu 15 Option 6 Here
- }
- if(scroll == 6)
- {
- //Sub Menu 15 Option 7 Here
- }
- if(scroll == 7)
- {
- //Sub Menu 15 Option 8 Here
- }
- if(scroll == 8)
- {
- //Sub Menu 15 Option 9 Here
- }
- if(scroll == 9)
- {
- //Sub Menu 15 Option 10 Here
- }
- if(scroll == 10)
- {
- //Sub Menu 15 Option 11 Here
- }
- if(scroll == 11)
- {
- //Sub Menu 15 Option 12 Here
- }
- if(scroll == 12)
- {
- //Sub Menu 15 Option 13 Here
- }
- if(scroll == 13)
- {
- //Sub Menu 15 Option 14 Here
- }
- if(scroll == 14)
- {
- //Sub Menu 15 Option 15 Here
- }
- }
- }
- //Menu Selection End
- //Menu Thread
- void MenuBase(std::uint64_t)
- {
- for(;;)
- {
- if(InGame())
- {
- if (!MenuLoaded)
- {
- for(int i = 0; i < 18; i++)
- {
- sleep(1000);
- Variables::MaxScroll[i] = 14;
- StoreHuds(i);
- }
- MenuLoaded = true;
- }
- else
- {
- for(int i = 0; i < 18; i++)
- {
- if(MenuLoaded)
- {
- if(menuOpen[i] == false)
- {
- if (Buttons::DetectBtn(i, Buttons::Up))
- {
- RunMenu(i);
- Variables::Scroll[i] = 0;
- UpdateScroll(i);
- menuOpen[i] = true;
- }
- }
- if(menuOpen[i] == true)
- {
- if (Buttons::DetectBtn(i, Buttons::Square))
- {
- if(Variables::CurMenu[i] != Variables::SubName)
- {
- Return(i);
- }
- else
- {
- menuOpen[i] = false;
- Variables::MenuType[i] --;
- DeleteHuds(i);
- }
- sleep(200);
- }
- if (Buttons::DetectBtn(i, Buttons::Up))
- {
- Variables::Scroll[i] --;
- if(Variables::Scroll[i] < 0)
- {
- Variables::Scroll[i] = Variables::MaxScroll[i];
- }
- UpdateScroll(i);
- }
- if (Buttons::DetectBtn(i, Buttons::Down))
- {
- Variables::Scroll[i] ++;
- if(Variables::Scroll[i] > Variables::MaxScroll[i])
- {
- Variables::Scroll[i] = 0;
- }
- UpdateScroll(i);
- }
- if (Buttons::DetectBtn(i, Buttons::X))
- {
- MenuSelection(i, Variables::CurMenu[i], Variables::Scroll[i]);
- }
- }
- }
- }
- }
- sleep(150);
- }
- else
- {
- MenuLoaded = false;
- }
- }
- }
- //Menu Thread End
- // An exported function is needed to generate the project's PRX stub export library
- extern "C" int _StankysMw3Base_export_function(void)
- {
- return CELL_OK;
- }
- extern "C" int _StankysMw3Base_prx_entry(void)
- {
- create_thread(MenuBase, 0x4AA, 0x7000, "Mw3 Menu Base", Mw3Base);
- return SYS_PRX_RESIDENT;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement