llBeastModell

Gta v menu base

Mar 1st, 2016
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "script.h"
  2. #include "keyboard.h"
  3. #include <string>
  4. #include <ctime>
  5. #pragma warning(disable : 4244 4305) // double <-> float conversions
  6.  
  7. namespace SUB{enum{
  8. // Define submenu (enum) indices here.
  9.             CLOSED,
  10.             MAINMENU,
  11.             SETTINGS,
  12.             SETTINGS_COLOURS,
  13.             SETTINGS_COLOURS2,
  14.             SETTINGS_FONTS,
  15.             SETTINGS_FONTS2,
  16.     // Others:
  17.             SAMPLE,
  18.             YOURSUB,
  19.  
  20.  
  21. };};
  22. namespace{
  23. // Declare/Initialise global variables here.// Booleans for loops go here:
  24. bool loop_massacre_mode = 0, loop_RainbowBoxes = 0, loop_gravity_gun = 0, loop_gta2cam = 0;
  25. }
  26. namespace{
  27. // Declare subroutines here.
  28.  
  29.  
  30.  
  31. }
  32. namespace{
  33. // Define subroutines here.
  34.  
  35. void VectorToFloat(Vector3 unk, float *Out)
  36. {
  37.     Out[0] = unk.x;
  38.     Out[1] = unk.y;
  39.     Out[2] = unk.z;
  40. }
  41. int RandomRGB()
  42. {
  43.     srand(GetTickCount());
  44.     return (GET_RANDOM_INT_IN_RANGE(0, 255));
  45. }
  46. bool get_key_pressed(int nVirtKey)
  47. {
  48.     return (GetAsyncKeyState(nVirtKey) & 0x8000) != 0;
  49. }
  50. bool Check_self_in_vehicle()
  51. {
  52.     if (IS_PED_IN_ANY_VEHICLE(PLAYER_PED_ID(), 0)) return true; else return false;
  53. }
  54. int FindFreeCarSeat(DWORD vehicle)
  55. {
  56.     int max = GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(vehicle) - 2;
  57.     for (static int tick = -1; tick <= max; tick++)
  58.     {
  59.         if (IS_VEHICLE_SEAT_FREE(vehicle, tick))
  60.         {
  61.             return tick;
  62.         }
  63.     }
  64.  
  65.     return -1;
  66. }
  67. void offset_from_entity(int entity, float X, float Y, float Z, float * Out)
  68. {
  69.     VectorToFloat(GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(entity, X, Y, Z), Out);
  70. }
  71. void RequestControlOfEnt(DWORD entity)
  72. {
  73.     int tick = 0;
  74.  
  75.     while (!NETWORK_HAS_CONTROL_OF_ENTITY(entity) && tick <= 12)
  76.     {
  77.         NETWORK_REQUEST_CONTROL_OF_ENTITY(entity);
  78.         tick++;
  79.     }
  80. }
  81. void RequestControlOfid(DWORD netid)
  82. {
  83.     int tick = 0;
  84.  
  85.     while (!NETWORK_HAS_CONTROL_OF_NETWORK_ID(netid) && tick <= 12)
  86.     {
  87.         NETWORK_REQUEST_CONTROL_OF_NETWORK_ID(netid);
  88.         tick++;
  89.     }
  90. }
  91. void RequestModel(DWORD Hash)
  92. {
  93.     REQUEST_MODEL(Hash);
  94.     while (!(HAS_MODEL_LOADED(Hash)))
  95.     {
  96.         WAIT(5);
  97.     }
  98. }
  99. int PlaceObject(DWORD Hash, float X, float Y, float Z, float Pitch, float Roll, float Yaw)
  100. {
  101.     RequestModel(Hash);
  102.     static DWORD object = CREATE_OBJECT(Hash, X, Y, Z, 1, 1, 0);
  103.     SET_ENTITY_ROTATION(object, Pitch, Roll, Yaw, 2, 1);
  104.     FREEZE_ENTITY_POSITION(object, 1);
  105.     SET_ENTITY_LOD_DIST(object, 696969);
  106.     SET_MODEL_AS_NO_LONGER_NEEDED(Hash);
  107.     SET_OBJECT_AS_NO_LONGER_NEEDED(&object);
  108.  
  109.     return object;
  110. }
  111. void setupdraw()
  112. {
  113.     SET_TEXT_FONT(0);
  114.     SET_TEXT_SCALE(0.4f, 0.4f);
  115.     SET_TEXT_COLOUR(255, 255, 255, 255);
  116.     SET_TEXT_WRAP(0.0f, 1.0f);
  117.     SET_TEXT_CENTRE(0);
  118.     SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0);
  119.     SET_TEXT_EDGE(0, 0, 0, 0, 0);
  120.     SET_TEXT_OUTLINE();
  121. }
  122. void drawstring(char* text, float X, float Y)
  123. {
  124.     _SET_TEXT_ENTRY("STRING");
  125.     _ADD_TEXT_COMPONENT_STRING(text);
  126.     _DRAW_TEXT(X, Y);
  127. }
  128. void drawinteger(int text, float X, float Y)
  129. {
  130.     _SET_TEXT_ENTRY("NUMBER");
  131.     ADD_TEXT_COMPONENT_INTEGER(text);
  132.     _DRAW_TEXT(X, Y);
  133. }
  134. void drawfloat(float text, DWORD decimal_places, float X, float Y)
  135. {
  136.     _SET_TEXT_ENTRY("NUMBER");
  137.     ADD_TEXT_COMPONENT_FLOAT(text, decimal_places);
  138.     _DRAW_TEXT(X, Y);
  139. }
  140. void PlaySoundFrontend(char* sound_dict, char* sound_name)
  141. {
  142.     PLAY_SOUND_FRONTEND(-1, sound_name, sound_dict, 0);
  143. }
  144. void PlaySoundFrontend_default(char* sound_name)
  145. {
  146.     PLAY_SOUND_FRONTEND(-1, sound_name, "HUD_FRONTEND_DEFAULT_SOUNDSET", 0);
  147. }
  148. bool Check_compare_string_length(char* unk1, size_t max_length)
  149. {
  150.     if (strlen(unk1) <= max_length) return true; else return false;
  151. }
  152. char* AddStrings(char* string1, char* string2)
  153. {
  154.     memset(str, 0, sizeof(str));
  155.     strcpy_s(str, "");
  156.     strcpy_s(str, string1);
  157.     strcat_s(str, string2);
  158.     return str;
  159. }
  160. char* AddInt_S(char* string1, int int2)
  161. {
  162.     static char* Return;
  163.     printf(Return, "%i", int2);
  164.     Return = AddStrings(string1, Return);
  165.     return Return;
  166.  
  167.     /*std::string string2 = string1;
  168.     string2 += std::to_string(int2);
  169.  
  170.     char * Char = new char[string2.size() + 1];
  171.     std::copy(string2.begin(), string2.end(), Char);
  172.     Char[string2.size()] = '\0';
  173.  
  174.     static char* Return = Char;
  175.     delete[] Char;
  176.     return Return;*/
  177. }
  178. char* keyboard()
  179. {
  180.     float i = 2.0000f;
  181.     while (i > 0.4750f)
  182.     {
  183.         WAIT(10);
  184.         DRAW_RECT(i, 0.9389f, 0.3875f, 0.736f, titlebox.R, titlebox.G, titlebox.B, 120);
  185.         i -= 0.0050f;
  186.     }
  187.  
  188.     static char* tempChar;
  189.     bool j;
  190.     if (Check_self_in_vehicle()) j = true; else j = false;
  191.  
  192.     while (!IsKeyDown(VK_RETURN))
  193.     {
  194.         WAIT(5);
  195.         DRAW_RECT(i, 0.9389f, 0.3875f, 0.736f, titlebox.R, titlebox.G, titlebox.B, 120);
  196.         setupdraw();
  197.         SET_TEXT_FONT(1);
  198.         drawstring("INPUT:", 0.2836f, 0.9129f);
  199.  
  200.  
  201.         if (IsKeyJustUp('1')) AddStrings(tempChar, "1");
  202.         else if (IsKeyJustUp('2')) AddStrings(tempChar, "2");
  203.         else if (IsKeyJustUp('3')) AddStrings(tempChar, "3");
  204.         else if (IsKeyJustUp('4')) AddStrings(tempChar, "4");
  205.         else if (IsKeyJustUp('5')) AddStrings(tempChar, "5");
  206.         else if (IsKeyJustUp('6')) AddStrings(tempChar, "6");
  207.         else if (IsKeyJustUp('7')) AddStrings(tempChar, "7");
  208.         else if (IsKeyJustUp('8')) AddStrings(tempChar, "8");
  209.         else if (IsKeyJustUp('9')) AddStrings(tempChar, "9");
  210.         else if (IsKeyJustUp('0')) AddStrings(tempChar, "0");
  211.         else if (IsKeyJustUp('A')) AddStrings(tempChar, "A");
  212.         else if (IsKeyJustUp('B')) AddStrings(tempChar, "B");
  213.         else if (IsKeyJustUp('C')) AddStrings(tempChar, "C");
  214.         else if (IsKeyJustUp('D')) AddStrings(tempChar, "D");
  215.         else if (IsKeyJustUp('E')) AddStrings(tempChar, "E");
  216.         else if (IsKeyJustUp('F')){ AddStrings(tempChar, "F"); if (j) SET_PED_INTO_VEHICLE(PLAYER_PED_ID(), myVeh, FindFreeCarSeat(myVeh)); }
  217.         else if (IsKeyJustUp('G')) AddStrings(tempChar, "G");
  218.         else if (IsKeyJustUp('H')) AddStrings(tempChar, "H");
  219.         else if (IsKeyJustUp('I')) AddStrings(tempChar, "I");
  220.         else if (IsKeyJustUp('J')) AddStrings(tempChar, "J");
  221.         else if (IsKeyJustUp('K')) AddStrings(tempChar, "K");
  222.         else if (IsKeyJustUp('L')) AddStrings(tempChar, "L");
  223.         else if (IsKeyJustUp('M')) AddStrings(tempChar, "M");
  224.         else if (IsKeyJustUp('N')) AddStrings(tempChar, "N");
  225.         else if (IsKeyJustUp('O')) AddStrings(tempChar, "O");
  226.         else if (IsKeyJustUp('P')) AddStrings(tempChar, "P");
  227.         else if (IsKeyJustUp('Q')) AddStrings(tempChar, "Q");
  228.         else if (IsKeyJustUp('R')) AddStrings(tempChar, "R");
  229.         else if (IsKeyJustUp('S')) AddStrings(tempChar, "S");
  230.         else if (IsKeyJustUp('T')) AddStrings(tempChar, "T");
  231.         else if (IsKeyJustUp('U')) AddStrings(tempChar, "U");
  232.         else if (IsKeyJustUp('V')) AddStrings(tempChar, "V");
  233.         else if (IsKeyJustUp('W')) AddStrings(tempChar, "W");
  234.         else if (IsKeyJustUp('X')) AddStrings(tempChar, "X");
  235.         else if (IsKeyJustUp('Y')) AddStrings(tempChar, "Y");
  236.         else if (IsKeyJustUp('Z')) AddStrings(tempChar, "Z");
  237.         else if (IsKeyJustUp(VK_ESCAPE)) return "";
  238.         else if (IsKeyJustUp(VK_SPACE)) AddStrings(tempChar, " ");
  239.         else if (IsKeyJustUp(VK_BACK) && strlen(tempChar) > 0)
  240.         {
  241.             std::string tempStr(tempChar); tempStr.pop_back();
  242.             char *tempChar2 = new char[tempStr.length() + 1];
  243.             std::strcpy(tempChar2, tempStr.c_str());
  244.             tempChar = tempChar2;
  245.             delete[] tempChar2;
  246.         }
  247.  
  248.         setupdraw();
  249.         SET_TEXT_FONT(14);
  250.         SET_TEXT_CENTRE(1);
  251.         drawstring(tempChar, 0.46, 0.9);
  252.  
  253.     }
  254.     return tempChar;
  255. }
  256. int StringToInt(char* text)
  257. {
  258.     static DWORD tempp;
  259.     if (text == "") return NULL;
  260.     if (STRING_TO_INT((DWORD*)text, &tempp)) return NULL;
  261.  
  262.     return tempp;
  263. }
  264. void PrintStringBottomCentre(char* text)
  265. {
  266.     _0xB87A37EEB7FAA67D("STRING");
  267.     _ADD_TEXT_COMPONENT_STRING(text);
  268.     _0x9D77056A530643F6(2000, 1);
  269. }
  270. void PrintFloatBottomCentre(float text, __int8 decimal_places)
  271. {
  272.     _0xB87A37EEB7FAA67D("NUMBER");
  273.     ADD_TEXT_COMPONENT_FLOAT(text, (DWORD)decimal_places);
  274.     _0x9D77056A530643F6(2000, 1);
  275. }
  276. void PrintBottomLeft(char* text)
  277. {
  278.     _0x202709F4C58A0424("STRING");
  279.     _ADD_TEXT_COMPONENT_STRING(text);
  280.     _0x44FA03975424A0EE(0, 1); // Not sure if right native
  281. }
  282. void PrintError_InvalidInput()
  283. {
  284.     PrintStringBottomCentre("~r~Error:~s~ Invalid Input.");
  285. }
  286. class menu
  287. {
  288. public:
  289.     static unsigned __int16 currentsub;
  290.     static unsigned __int16 currentop;
  291.     static unsigned __int16 currentop_w_breaks;
  292.     static unsigned __int16 totalop;
  293.     static unsigned __int16 printingop;
  294.     static unsigned __int16 breakcount;
  295.     static unsigned __int16 totalbreaks;
  296.     static unsigned __int8 breakscroll;
  297.     static __int16 currentsub_ar_index;
  298.     static int currentsub_ar[20];
  299.     static int currentop_ar[20];
  300.     static int SetSub_delayed;
  301.     static unsigned long int livetimer;
  302.     static bool bit_centre_title, bit_centre_options, bit_centre_breaks;
  303.  
  304.     static void loops();
  305.     static void sub_handler();
  306.     static void submenu_switch();
  307.     static void DisableControls()
  308.     {
  309.         HIDE_HELP_TEXT_THIS_FRAME();
  310.         SET_CINEMATIC_BUTTON_ACTIVE(1);
  311.         DISABLE_CONTROL_ACTION(0, INPUT_NEXT_CAMERA, controllerinput_bool);
  312.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_SELECT_NEXT_WEAPON, controllerinput_bool);
  313.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_CIN_CAM, controllerinput_bool);
  314.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_X);
  315.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_ACCEPT);
  316.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_CANCEL);
  317.         DISABLE_CONTROL_ACTION(0, INPUT_HUD_SPECIAL, controllerinput_bool);
  318.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_DOWN);
  319.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_UP);
  320.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_ACCEPT, controllerinput_bool);
  321.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_CANCEL, controllerinput_bool);
  322.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_LEFT, controllerinput_bool);
  323.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_RIGHT, controllerinput_bool);
  324.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_DOWN, controllerinput_bool);
  325.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_UP, controllerinput_bool);
  326.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_RDOWN, controllerinput_bool);
  327.         DISABLE_CONTROL_ACTION(2, INPUT_FRONTEND_ACCEPT, controllerinput_bool);
  328.         HIDE_HUD_COMPONENT_THIS_FRAME(10);
  329.         HIDE_HUD_COMPONENT_THIS_FRAME(6);
  330.         HIDE_HUD_COMPONENT_THIS_FRAME(7);
  331.         HIDE_HUD_COMPONENT_THIS_FRAME(9);
  332.         HIDE_HUD_COMPONENT_THIS_FRAME(8);
  333.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_LEFT);
  334.         SET_INPUT_EXCLUSIVE(2, INPUT_FRONTEND_RIGHT);
  335.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON, controllerinput_bool);
  336.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_UNARMED, controllerinput_bool);
  337.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_MELEE, controllerinput_bool);
  338.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_HANDGUN, controllerinput_bool);
  339.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_SHOTGUN, controllerinput_bool);
  340.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_SMG, controllerinput_bool);
  341.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_AUTO_RIFLE, controllerinput_bool);
  342.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_SNIPER, controllerinput_bool);
  343.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_HEAVY, controllerinput_bool);
  344.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_WEAPON_SPECIAL, controllerinput_bool);
  345.         DISABLE_CONTROL_ACTION(0, INPUT_WEAPON_WHEEL_NEXT, controllerinput_bool);
  346.         DISABLE_CONTROL_ACTION(0, INPUT_WEAPON_WHEEL_PREV, controllerinput_bool);
  347.         DISABLE_CONTROL_ACTION(0, INPUT_WEAPON_SPECIAL_TWO, controllerinput_bool);
  348.         DISABLE_CONTROL_ACTION(0, INPUT_DIVE, controllerinput_bool);
  349.         DISABLE_CONTROL_ACTION(0, INPUT_MELEE_ATTACK_LIGHT, controllerinput_bool);
  350.         DISABLE_CONTROL_ACTION(0, INPUT_MELEE_ATTACK_HEAVY, controllerinput_bool);
  351.         DISABLE_CONTROL_ACTION(0, INPUT_MELEE_BLOCK, controllerinput_bool);
  352.         DISABLE_CONTROL_ACTION(0, INPUT_ARREST, controllerinput_bool);
  353.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_HEADLIGHT, controllerinput_bool);
  354.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_RADIO_WHEEL, controllerinput_bool);
  355.         DISABLE_CONTROL_ACTION(0, INPUT_CONTEXT, controllerinput_bool);
  356.         DISABLE_CONTROL_ACTION(0, INPUT_RELOAD, controllerinput_bool);
  357.         DISABLE_CONTROL_ACTION(0, INPUT_DIVE, controllerinput_bool);
  358.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_CIN_CAM, controllerinput_bool);
  359.         DISABLE_CONTROL_ACTION(0, INPUT_JUMP, controllerinput_bool);
  360.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_SELECT_NEXT_WEAPON, controllerinput_bool);
  361.         DISABLE_CONTROL_ACTION(0, INPUT_VEH_FLY_SELECT_NEXT_WEAPON, controllerinput_bool);
  362.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_CHARACTER_FRANKLIN, controllerinput_bool);
  363.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_CHARACTER_MICHAEL, controllerinput_bool);
  364.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_CHARACTER_TREVOR, controllerinput_bool);
  365.         DISABLE_CONTROL_ACTION(0, INPUT_SELECT_CHARACTER_MULTIPLAYER, controllerinput_bool);
  366.         DISABLE_CONTROL_ACTION(0, INPUT_CHARACTER_WHEEL, controllerinput_bool);
  367.     }
  368.     static void base()
  369.     {
  370.         GET_SCREEN_RESOLUTION(&screen_res_x, &screen_res_y); // Get screen res
  371.         if (menu::currentsub != SUB::CLOSED)
  372.         {
  373.             DWORD dword = (DWORD)("CommonMenu");
  374.             if (!HAS_STREAMED_TEXTURE_DICT_LOADED(&dword)){ REQUEST_STREAMED_TEXTURE_DICT(&dword, 0); }
  375.             background();
  376.             optionhi();
  377.         }
  378.     }
  379.     static void background()
  380.     {
  381.         float temp;
  382.         if (totalop > 14) temp = 14; else temp = (float)totalop; // Calculate last option number to draw rect
  383.  
  384.         // Calculate Y Coord
  385.         float bg_Y = ((temp * 0.035f) / 2.0f) + 0.159f;
  386.         float bg_length = temp * 0.035f;
  387.  
  388.         // Draw titlebox
  389.         DRAW_RECT(0.16f + menuPos, 0.1175f, 0.20f, 0.083f, titlebox.R, titlebox.G, titlebox.B, titlebox.A);
  390.  
  391.         // Draw background
  392.         DRAW_RECT(0.16f + menuPos, bg_Y, 0.20f, bg_length, BG.R, BG.G, BG.B, BG.A);
  393.  
  394.         // Draw scroller indicator rect
  395.         if (totalop > 14) temp = 14.0f; else temp = (float)totalop;
  396.         float scr_rect_Y = ((temp + 1.0f) * 0.035f) + 0.1415f;
  397.         DRAW_RECT(0.16f + menuPos, scr_rect_Y, 0.20f, 0.0345f, BG.R, BG.G, BG.B, BG.A);
  398.  
  399.         // Draw thin line over scroller indicator rect
  400.         if (totalop < 14) DRAW_RECT(0.16f + menuPos, (float)(totalop)* 0.035f + 0.16f, 0.20f, 0.0022f, 255, 255, 255, 255);
  401.         else DRAW_RECT(0.16f + menuPos, 14.0f * 0.035f + 0.16f, 0.20f, 0.0022f, 255, 255, 255, 255);
  402.  
  403.         // Draw scroller indicator
  404.         DWORD dword = (DWORD)("CommonMenu");
  405.         if ((totalop > 14) && HAS_STREAMED_TEXTURE_DICT_LOADED(&dword))
  406.         {
  407.             DWORD dword2 = (DWORD)"shop_arrows_upANDdown";
  408.             DWORD dword3 = (DWORD)"arrowright";
  409.             Vector3 texture_res = GET_TEXTURE_RESOLUTION(&dword, &dword2);
  410.  
  411.             temp = ((14.0f + 1.0f) * 0.035f) + 0.1259f;
  412.  
  413.             if (currentop == 1) DRAW_SPRITE(dword, dword3, 0.16f + menuPos, temp, texture_res.x / (float)screen_res_x, texture_res.y / (float)screen_res_y, 270.0f, titlebox.R, titlebox.G, titlebox.B, 255);
  414.             else if (currentop == totalop) DRAW_SPRITE(dword, dword3, 0.16f + menuPos, temp, texture_res.x / (float)screen_res_x, texture_res.y / (float)screen_res_y, 90.0f, titlebox.R, titlebox.G, titlebox.B, 255);
  415.             else DRAW_SPRITE(dword, dword2, 0.16f + menuPos, temp, texture_res.x / (float)screen_res_x, texture_res.y / (float)screen_res_y, 0.0f, titlebox.R, titlebox.G, titlebox.B, 255);
  416.  
  417.         }
  418.  
  419.         // Draw option count
  420.         temp = scr_rect_Y - 0.0124f;
  421.         setupdraw();
  422.         SET_TEXT_FONT(0);
  423.         SET_TEXT_SCALE(0.0f, 0.26f);
  424.         SET_TEXT_COLOUR(optioncount.R, optioncount.G, optioncount.B, optioncount.A);
  425.  
  426.         _SET_TEXT_ENTRY("CM_ITEM_COUNT");
  427.         ADD_TEXT_COMPONENT_INTEGER(currentop); // ! currentop_w_breaks
  428.         ADD_TEXT_COMPONENT_INTEGER(totalop); // ! totalop - totalbreaks
  429.         _DRAW_TEXT(0.2205f + menuPos, temp);
  430.     }
  431.     static void optionhi()
  432.     {
  433.         float Y_coord;
  434.         if (currentop > 14) Y_coord = 14.0f; else Y_coord = (float)currentop;
  435.  
  436.         Y_coord = (Y_coord * 0.035f) + 0.1415f;
  437.         DRAW_RECT(0.16f + menuPos, Y_coord, 0.20f, 0.035f, selectionhi.R, selectionhi.G, selectionhi.B, selectionhi.A);
  438.     }
  439.     static bool isBinds()
  440.     {
  441.         // Open menu - RB + LB / NUM4 + NUM6
  442.         return ((IS_DISABLED_CONTROL_PRESSED(2, INPUT_FRONTEND_RB) && IS_DISABLED_CONTROL_PRESSED(2, INPUT_FRONTEND_LB)) || (IsKeyDown(VK_NUMPAD4) && IsKeyDown(VK_NUMPAD6)));
  443.     }
  444.     static void while_closed()
  445.     {
  446.         if (isBinds())
  447.         {
  448.             PlaySoundFrontend("FocusIn", "HintCamSounds");
  449.             currentsub = 1;
  450.             currentsub_ar_index = 0;
  451.             currentop = 1;
  452.         }
  453.     }
  454.     static void while_opened()
  455.     {
  456.         totalop = printingop; printingop = 0;
  457.         totalbreaks = breakcount; breakcount = 0; breakscroll = 0;
  458.  
  459.         if (IS_PAUSE_MENU_ACTIVE()) SetSub_closed();
  460.  
  461.         DISPLAY_AMMO_THIS_FRAME(0);
  462.         DISPLAY_CASH(0);
  463.         SET_RADAR_ZOOM(0);
  464.  
  465.         DisableControls();
  466.  
  467.         // Scroll up
  468.         if (IS_DISABLED_CONTROL_JUST_PRESSED(2, INPUT_SCRIPT_PAD_UP) || IsKeyJustUp(VK_NUMPAD8))
  469.         {
  470.             if (currentop == 1) Bottom(); else Up();
  471.         }
  472.  
  473.         // Scroll down
  474.         if (IS_DISABLED_CONTROL_JUST_PRESSED(2, INPUT_SCRIPT_PAD_DOWN) || IsKeyJustUp(VK_NUMPAD2))
  475.         {
  476.             if (currentop == totalop) Top(); else Down();
  477.         }
  478.  
  479.         // B press
  480.         if (IS_DISABLED_CONTROL_JUST_PRESSED(2, INPUT_SCRIPT_RRIGHT) || IsKeyJustUp(VK_NUMPAD0))
  481.         {
  482.             if (currentsub == SUB::MAINMENU) SetSub_closed(); else SetSub_previous();
  483.         }
  484.  
  485.         // Binds press
  486.         if (currentsub != SUB::MAINMENU && isBinds())
  487.         {
  488.             SetSub_closed();
  489.         }
  490.     }
  491.     static void Up()
  492.     {
  493.         currentop--; currentop_w_breaks--;
  494.         PlaySoundFrontend_default("NAV_UP_DOWN");
  495.         breakscroll = 1;
  496.     }
  497.     static void Down()
  498.     {
  499.         currentop++; currentop_w_breaks++;
  500.         PlaySoundFrontend_default("NAV_UP_DOWN");
  501.         breakscroll = 2;
  502.     }
  503.     static void Bottom()
  504.     {
  505.         currentop = totalop; currentop_w_breaks = totalop;
  506.         PlaySoundFrontend_default("NAV_UP_DOWN");
  507.         breakscroll = 3;
  508.     }
  509.     static void Top()
  510.     {
  511.         currentop = 1; currentop_w_breaks = 1;
  512.         PlaySoundFrontend_default("NAV_UP_DOWN");
  513.         breakscroll = 4;
  514.     }
  515.     static void SetSub_previous()
  516.     {
  517.         currentsub = currentsub_ar[currentsub_ar_index]; // Get previous submenu from array and set as current submenu
  518.         currentop = currentop_ar[currentsub_ar_index]; // Get last selected option from array and set as current selected option
  519.         currentsub_ar_index--; // Decrement array index by 1
  520.         printingop = 0; // Reset option print variable
  521.         PlaySoundFrontend_default("BACK"); // Play sound
  522.     }
  523.     static void SetSub_new(int sub_index)
  524.     {
  525.         currentsub_ar_index++; // Increment array index
  526.         currentsub_ar[currentsub_ar_index] = currentsub; // Store current submenu index in array
  527.         currentsub = sub_index; // Set new submenu as current submenu (Static_1)
  528.  
  529.         currentop_ar[currentsub_ar_index] = currentop; // Store currently selected option in array
  530.         currentop = 1; currentop_w_breaks = 1; // Set new selected option as first option in submenu
  531.  
  532.         printingop = 0; // Reset currently printing option var
  533.     }
  534.     static void SetSub_closed()
  535.     {
  536.         ENABLE_ALL_CONTROL_ACTIONS(2);
  537.         PlaySoundFrontend_default("BACK");
  538.         currentsub = SUB::CLOSED;
  539.     }
  540.  
  541. }; unsigned __int16 menu::currentsub = 0; unsigned __int16 menu::currentop = 0; unsigned __int16 menu::currentop_w_breaks = 0; unsigned __int16 menu::totalop = 0; unsigned __int16 menu::printingop = 0; unsigned __int16 menu::breakcount = 0; unsigned __int16 menu::totalbreaks = 0; unsigned __int8 menu::breakscroll = 0; __int16 menu::currentsub_ar_index = 0; int menu::currentsub_ar[20] = {}; int menu::currentop_ar[20] = {}; int menu::SetSub_delayed = 0; unsigned long int menu::livetimer; bool menu::bit_centre_title = 1, menu::bit_centre_options = 0, menu::bit_centre_breaks = 1;
  542. bool CheckAJPressed()
  543. {
  544.     if (IS_DISABLED_CONTROL_JUST_PRESSED(2, INPUT_SCRIPT_RDOWN) || IsKeyJustUp(VK_NUMPAD5)) return true; else return false;
  545. }
  546. bool CheckRPressed()
  547. {
  548.     if (IS_DISABLED_CONTROL_PRESSED(2, INPUT_FRONTEND_RIGHT) || IsKeyDown(VK_NUMPAD6)) return true; else return false;
  549. }
  550. bool CheckRJPressed()
  551. {
  552.     if (IS_DISABLED_CONTROL_JUST_PRESSED(2, INPUT_FRONTEND_RIGHT) || IsKeyJustUp(VK_NUMPAD6)) return true; else return false;
  553. }
  554. bool CheckLPressed()
  555. {
  556.     if (IS_DISABLED_CONTROL_PRESSED(2, INPUT_FRONTEND_LEFT) || IsKeyDown(VK_NUMPAD4)) return true; else return false;
  557. }
  558. bool CheckLJPressed()
  559. {
  560.     if (IS_DISABLED_CONTROL_JUST_PRESSED(2, INPUT_FRONTEND_LEFT) || IsKeyJustUp(VK_NUMPAD4)) return true; else return false;
  561. }
  562. bool IsOptionPressed()
  563. {
  564.     if (CheckAJPressed())
  565.     {
  566.         PlaySoundFrontend_default("SELECT");
  567.         return true;
  568.     }
  569.     else return false;
  570. }
  571. bool IsOptionRPressed()
  572. {
  573.     if (CheckRPressed())
  574.     {
  575.         PlaySoundFrontend_default("NAV_LEFT_RIGHT");
  576.         return true;
  577.     }
  578.     else return false;
  579. }
  580. bool IsOptionRJPressed()
  581. {
  582.     if (CheckRJPressed())
  583.     {
  584.         PlaySoundFrontend_default("NAV_LEFT_RIGHT");
  585.         return true;
  586.     }
  587.     else return false;
  588. }
  589. bool IsOptionLPressed()
  590. {
  591.     if (CheckLPressed())
  592.     {
  593.         PlaySoundFrontend_default("NAV_LEFT_RIGHT");
  594.         return true;
  595.     }
  596.     else return false;
  597. }
  598. bool IsOptionLJPressed()
  599. {
  600.     if (CheckLJPressed())
  601.     {
  602.         PlaySoundFrontend_default("NAV_LEFT_RIGHT");
  603.         return true;
  604.     }
  605.     else return false;
  606. }
  607. void AddTitle(char* text)
  608. {
  609.     setupdraw();
  610.     SET_TEXT_FONT(font_title);
  611.  
  612.     SET_TEXT_COLOUR(titletext.R, titletext.G, titletext.B, titletext.A);
  613.  
  614.     if (menu::bit_centre_title)
  615.     {
  616.         SET_TEXT_CENTRE(1);
  617.         OptionY = 0.16f + menuPos; // X coord
  618.     }
  619.     else OptionY = 0.066f + menuPos; // X coord
  620.  
  621.     if (Check_compare_string_length(text, 14))
  622.     {
  623.         SET_TEXT_SCALE(0.75f, 0.75f);
  624.         drawstring(text, OptionY, 0.1f);
  625.     }
  626.     else drawstring(text, OptionY, 0.13f);
  627.  
  628. }
  629. void nullFunc(){ return; }
  630. void AddOption(char* text, bool &option_code_bool = null, void (&Func)() = nullFunc, int submenu_index = -1)
  631. {
  632.     char* tempChar;
  633.     if (font_options == 2 || font_options == 7) tempChar = "  ------"; // Font unsafe
  634.     else tempChar = "  ~b~>"; // Font safe
  635.  
  636.     if (menu::printingop + 1 == menu::currentop && (font_selection == 2 || font_selection == 7)) tempChar = "  ------"; // Font unsafe
  637.     else tempChar = "  ~b~>"; // Font safe
  638.  
  639.     menu::printingop++;
  640.  
  641.     OptionY = 0.0f;
  642.     if (menu::currentop <= 14)
  643.     {
  644.         if (menu::printingop > 14) return;
  645.         else OptionY = ((float)(menu::printingop) * 0.035f) + 0.125f;
  646.     }
  647.     else
  648.     {
  649.         if (menu::printingop < (menu::currentop - 13) || menu::printingop > menu::currentop) return;
  650.         else OptionY = ((float)(menu::printingop - (menu::currentop - 14))* 0.035f) + 0.125f;
  651.     }
  652.  
  653.     setupdraw();
  654.     SET_TEXT_FONT(font_options);
  655.     SET_TEXT_COLOUR(optiontext.R, optiontext.G, optiontext.B, optiontext.A);
  656.     if (menu::printingop == menu::currentop)
  657.     {
  658.         SET_TEXT_FONT(font_selection);
  659.         SET_TEXT_COLOUR(selectedtext.R, selectedtext.G, selectedtext.B, selectedtext.A);
  660.         if (IsOptionPressed())
  661.         {
  662.             /*if (&option_code_bool != &null)*/ option_code_bool = true;
  663.             Func();
  664.             if (submenu_index != -1) menu::SetSub_delayed = submenu_index;
  665.         }
  666.     }
  667.  
  668.     if (submenu_index != -1) text = AddStrings(text, tempChar);
  669.     if (menu::bit_centre_options)
  670.     {
  671.         SET_TEXT_CENTRE(1);
  672.         drawstring(text, 0.16f + menuPos, OptionY);
  673.     }
  674.     else drawstring(text, 0.066f + menuPos, OptionY);
  675. }
  676. void OptionStatus(int status)
  677. {
  678.     if (OptionY < 0.6325f && OptionY > 0.1425f)
  679.     {
  680.         char* tempChar;
  681.         SET_TEXT_FONT(4);
  682.         SET_TEXT_SCALE(0.34f, 0.34f);
  683.         SET_TEXT_CENTRE(1);
  684.  
  685.         if (status == 0){
  686.             SET_TEXT_COLOUR(255, 102, 102, 250); //RED
  687.             tempChar = "OFF";
  688.         }
  689.         else if (status == 1){
  690.             SET_TEXT_COLOUR(102, 255, 102, 250); //GREEN
  691.             tempChar = "ON";
  692.         }
  693.         else{
  694.             SET_TEXT_COLOUR(255, 255, 102, 250); //YELLOW
  695.             tempChar = "??";
  696.         }
  697.  
  698.         drawstring(tempChar, 0.233f + menuPos, OptionY);
  699.  
  700.     }
  701. }
  702. void AddToggle(char* text, bool &loop_variable, bool &extra_option_code_ON = null, bool &extra_option_code_OFF = null)
  703. {
  704.     null = 0;
  705.     AddOption(text, null);
  706.  
  707.     if (null){
  708.             loop_variable = !loop_variable;
  709.             if (loop_variable != 0) extra_option_code_ON = true;
  710.             else extra_option_code_OFF = true;
  711.         }
  712.  
  713.     OptionStatus((int)loop_variable); // Display ON/OFF
  714. }
  715. void AddLocal(char* text, Void condition, bool &option_code_ON, bool &option_code_OFF)
  716. {
  717.     null = 0;
  718.     AddOption(text, null);
  719.     if (null)
  720.     { if (condition == 0) option_code_ON = true; else option_code_OFF = true; }
  721.    
  722.     if (condition == 0) OptionStatus(0); // Display OFF
  723.     else                OptionStatus(1); // Display ON
  724. }
  725. void AddBreak(char* text)
  726. {
  727.     menu::printingop++; menu::breakcount++;
  728.  
  729.     OptionY = 0.0f;
  730.     if (menu::currentop <= 14)
  731.     {
  732.         if (menu::printingop > 14) return;
  733.         else OptionY = ((float)(menu::printingop) * 0.035f) + 0.125f;
  734.     }
  735.     else
  736.     {
  737.         if (menu::printingop < (menu::currentop - 13) || menu::printingop > menu::currentop) return;
  738.         else OptionY = ((float)(menu::printingop - (menu::currentop - 14))* 0.035f) + 0.125f;
  739.     }
  740.  
  741.     setupdraw();
  742.     SET_TEXT_FONT(font_breaks);
  743.     SET_TEXT_COLOUR(optionbreaks.R, optionbreaks.G, optionbreaks.B, optionbreaks.A);
  744.     if (menu::printingop == menu::currentop)
  745.     {
  746.         switch (menu::breakscroll)
  747.         {
  748.         case 1:
  749.             menu::currentop_w_breaks = menu::currentop_w_breaks + 1;
  750.             menu::currentop--; break;
  751.         case 2:
  752.             menu::currentop_w_breaks = menu::currentop - menu::breakcount;
  753.             menu::currentop++; break;
  754.         case 3:
  755.             menu::currentop_w_breaks = menu::totalop - (menu::totalbreaks - 1);
  756.             menu::currentop--; break;
  757.         case 4:
  758.             menu::currentop_w_breaks = 1;
  759.             menu::currentop++; break;
  760.         }
  761.        
  762.     }
  763.     if (menu::bit_centre_breaks)
  764.     {
  765.         SET_TEXT_CENTRE(1);
  766.         drawstring(text, 0.16f + menuPos, OptionY);
  767.     }
  768.     else
  769.     {
  770.         drawstring(text, 0.066f + menuPos, OptionY);
  771.     }
  772.  
  773. }
  774. void AddNumber(char* text, long value, __int8 decimal_places, bool &A_PRESS = null, bool &RIGHT_PRESS = null, bool &LEFT_PRESS = null)
  775. {
  776.     null = 0;
  777.     AddOption(text, null);
  778.  
  779.     if (OptionY < 0.6325 && OptionY > 0.1425)
  780.     {
  781.         SET_TEXT_FONT(0);
  782.         SET_TEXT_SCALE(0.26f, 0.26f);
  783.         SET_TEXT_CENTRE(1);
  784.  
  785.         drawfloat(value, (DWORD)decimal_places, 0.233f + menuPos, OptionY);
  786.     }
  787.  
  788.     if (menu::printingop == menu::currentop)
  789.     {
  790.         if (null) A_PRESS = true;
  791.         else if (IsOptionRJPressed()) RIGHT_PRESS = true;
  792.         else if (IsOptionRPressed()) RIGHT_PRESS = true;
  793.         else if (IsOptionLJPressed()) LEFT_PRESS = true;
  794.         else if (IsOptionLPressed()) LEFT_PRESS = true;
  795.  
  796.     }
  797.  
  798. }
  799. void AddTele(char* text, float X, float Y, float Z, bool &extra_option_code = null)
  800. {
  801.     null = 0;
  802.     AddOption(text, null);
  803.     if (menu::printingop == menu::currentop)
  804.     {
  805.         if (null)
  806.         {
  807.             if (!Check_self_in_vehicle())
  808.             {
  809.                 SET_ENTITY_COORDS(PLAYER_PED_ID(), X, Y, Z, 0, 0, 0, 1);
  810.             }
  811.             else
  812.             {
  813.                 RequestControlOfEnt(myVeh);
  814.                 SET_ENTITY_COORDS(myVeh, X, Y, Z, 0, 0, 0, 1);
  815.             }
  816.             LOAD_ALL_OBJECTS_NOW();
  817.             extra_option_code = true;
  818.         }
  819.     }
  820.  
  821. }
  822.  
  823.  
  824. // Hax functions:
  825. void set_massacre_mode()
  826. {
  827.     float tempCoords1[3];
  828.     DWORD tempHash;
  829.     DWORD tempPed = PLAYER_PED_ID();
  830.     DWORD tempVehicle;
  831.     bool tick = 0;
  832.  
  833.     offset_from_entity(tempPed, GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(0.4f, 20.0f), tempCoords1);
  834.  
  835.     // Kick away naughty players
  836.     for (int i = 0; i <= 29; i++)
  837.     {
  838.         if (IS_PLAYER_TARGETTING_ENTITY(i, tempPed) || IS_PLAYER_FREE_AIMING_AT_ENTITY(i, tempPed))
  839.         {
  840.             if (!tick)
  841.             {
  842.                 PrintStringBottomCentre("~h~You~s~ are being aimed at. Taking care of it!");
  843.                 tick = true;
  844.             }
  845.             APPLY_FORCE_TO_ENTITY(GET_PLAYER_PED(i), 1, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 5.0f, 1, 1, 1, 1, 0, 1);
  846.         }
  847.     }
  848.  
  849.     // Kick away nearest vehicle
  850.     tempVehicle = GET_CLOSEST_VEHICLE(tempCoords1[0], tempCoords1[1], tempCoords1[2], 400.0f, 0, 4);
  851.     if (DOES_ENTITY_EXIST(tempVehicle)) APPLY_FORCE_TO_ENTITY(tempVehicle, 1, 5.0f, 5.0f, 5.0f, 5.0f, 13.0f, 6.5f, 1, 1, 1, 1, 0, 1);
  852.  
  853.     // Exploding vehicles
  854.     switch (GET_RANDOM_INT_IN_RANGE(1, 10))
  855.     {
  856.     case 1: tempHash = 3945366167; break;
  857.     case 2: tempHash = 92612664; break;
  858.     case 3: tempHash = 1488164764; break;
  859.     case 4: tempHash = 117401876; break;
  860.     case 5: tempHash = 408192225; break;
  861.     case 6: tempHash = 3863274624; break;
  862.     case 7: tempHash = 165154707; break;
  863.     case 8: tempHash = 1011753235; break;
  864.     case 9: tempHash = 941800958; break;
  865.     case 10: tempHash = 970385471; break;
  866.     }
  867.  
  868.     tempVehicle = CREATE_VEHICLE(tempHash, tempCoords1[0], tempCoords1[1], tempCoords1[2], GET_RANDOM_FLOAT_IN_RANGE(0.0f, 360.0f), 1, 1);
  869.     APPLY_FORCE_TO_ENTITY(tempVehicle, 1, 5.0f, 5.0f, 5.0f, 5.0f, 13.0f, 6.5f, 1, 1, 1, 1, 0, 1);
  870.     NETWORK_EXPLODE_VEHICLE(tempVehicle, 1, 1, 1);
  871.  
  872.     // Dying peds
  873.     switch (GET_RANDOM_INT_IN_RANGE(1, 10))
  874.     {
  875.     case 1: tempHash = 1682622302; break;
  876.     case 2: tempHash = 113504370; break;
  877.     case 3: tempHash = 4244282910; break;
  878.     case 4: tempHash = 808859815; break;
  879.     case 5: tempHash = 1004114196; break;
  880.     case 6: tempHash = 3696858125; break;
  881.     case 7: tempHash = 921110016; break;
  882.     case 8: tempHash = 880829941; break;
  883.     case 9: tempHash = 1462895032; break;
  884.     case 10: tempHash = 773063444; break;
  885.     }
  886.  
  887.     offset_from_entity(tempPed, GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(0.4f, 20.0f), tempCoords1);
  888.     tempPed = CREATE_PED(22, tempHash, tempCoords1[0], tempCoords1[1], tempCoords1[2], GET_RANDOM_FLOAT_IN_RANGE(0.0f, 360.0f), 1, 1);
  889.     APPLY_FORCE_TO_ENTITY(tempPed, 1, 5.0f, 5.0f, 5.0f, 5.0f, 13.0f, 6.5f, 1, 1, 1, 1, 0, 1);
  890.     EXPLODE_PED_HEAD(tempPed, 324506233);
  891.     ADD_EXPLOSION(tempCoords1[0], tempCoords1[1], tempCoords1[2], 26, 4.0f, 1, 0, 3.0f);
  892.  
  893.     // Water hydrants
  894.     offset_from_entity(tempPed, GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(0.4f, 20.0f), tempCoords1);
  895.     ADD_EXPLOSION(tempCoords1[0], tempCoords1[1], tempCoords1[2], 13, 8.0f, 1, 0, 3.0f);
  896.  
  897.     // Zombies
  898.     offset_from_entity(tempPed, GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(5.0f, 25.0f), GET_RANDOM_FLOAT_IN_RANGE(0.4f, 20.0f), tempCoords1);
  899.     tempPed = CREATE_PED(22, -1404353274, tempCoords1[0], tempCoords1[1], tempCoords1[2], GET_RANDOM_FLOAT_IN_RANGE(0.0f, 360.0f), 1, 1);
  900.     PED_TO_NET(tempPed);
  901.     SET_PED_COMBAT_ABILITY(tempPed, 100);
  902.     TASK_COMBAT_HATED_TARGETS_AROUND_PED(tempPed, 400.0f, 0);
  903. }
  904. void sample_createEscort()
  905. {
  906.     if (!IS_WAYPOINT_ACTIVE()) PrintStringBottomCentre("~r~Error:~s~ No waypoint set.");
  907.     else
  908.     {
  909.         float Pos[3];
  910.         Vector3 Coord = GET_BLIP_COORDS(GET_FIRST_BLIP_INFO_ID(_GET_BLIP_INFO_ID_ITERATOR()));
  911.         GET_GROUND_Z_FOR_3D_COORD(Coord.x, Coord.y, Coord.z, &Coord.z);
  912.         VectorToFloat(GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER_PED_ID(), 0.0f, 5.0f, 1.0f), Pos);
  913.         WAIT(10);
  914.         DWORD tempPed = CREATE_PED(1, GET_HASH_KEY("A_C_CHIMP"), Pos[0], Pos[1], Pos[2], 0.0f, 1, 1);
  915.         DWORD tempVehicle = CREATE_VEHICLE(GET_HASH_KEY("KURUMA2"), Pos[0], Pos[1], Pos[2] + 2.0f, GET_ENTITY_HEADING(PLAYER_PED_ID()), 1, 1);
  916.         RequestControlOfEnt(tempVehicle);
  917.         SET_VEHICLE_COLOURS(tempVehicle, 0, 0);
  918.         SET_VEHICLE_NUMBER_PLATE_TEXT(tempVehicle, (DWORD*)"VIP");
  919.         for (int i = -1; i <= 20; i++)
  920.         {
  921.             if (!IS_VEHICLE_SEAT_FREE(tempVehicle, i)) continue;
  922.             TASK_WARP_PED_INTO_VEHICLE(PLAYER_PED_ID(), tempVehicle, i); break;
  923.         }
  924.         TASK_VEHICLE_MISSION_COORS_TARGET(tempPed, tempVehicle, Coord.x, Coord.y, Coord.z, 4, 20.0f, 786469, 20.0f, 10.0f, 1);
  925.     }
  926. }
  927. DWORD grav_partfx, grav_entity; bool grav_toggled = 0, grav_target_locked = 0;
  928. Vector3 get_coords_from_cam(float distance)
  929. {
  930.     Vector3 Rot = GET_GAMEPLAY_CAM_ROT(2);
  931.     static Vector3 Coord = GET_GAMEPLAY_CAM_COORD();
  932.  
  933.     Rot.y = distance * cos(Rot.x);
  934.     Coord.x = Coord.x + Rot.y * sin(Rot.z * -1.0f);
  935.     Coord.y = Coord.y + Rot.y * cos(Rot.z * -1.0f);
  936.     Coord.z = Coord.z + distance * sin(Rot.x);
  937.  
  938.     return Coord;
  939. }
  940. void set_gravity_gun()
  941. {
  942.     DWORD tempPed, tempWeap;
  943.  
  944.     if (!grav_target_locked) GET_PLAYER_TARGET_ENTITY(PLAYER_ID(), &grav_entity);
  945.  
  946.     tempPed = PLAYER_ID(); GET_CURRENT_PED_WEAPON(PLAYER_PED_ID(), &tempWeap, 1);
  947.     if ((IS_PLAYER_FREE_AIMING(tempPed) || IS_PLAYER_TARGETTING_ANYTHING(tempPed)) && DOES_ENTITY_EXIST(grav_entity) && tempWeap == 453432689)
  948.     {
  949.         if (!grav_target_locked) GET_PLAYER_TARGET_ENTITY(PLAYER_ID(), &grav_entity); grav_target_locked = true;
  950.         float Coord[3]; VectorToFloat(get_coords_from_cam(5.5f), Coord);
  951.  
  952.         if (!DOES_PARTICLE_FX_LOOPED_EXIST(grav_partfx))
  953.         {
  954.             REQUEST_PTFX_ASSET();
  955.             if (HAS_PTFX_ASSET_LOADED())
  956.             {
  957.                 grav_partfx = START_PARTICLE_FX_LOOPED_AT_COORD((DWORD*)"scr_drug_traffic_flare_L", Coord[0], Coord[1], Coord[2], 0.0f, 0.0f, 0.0f, 0.5f, 0, 0, 0, 0);
  958.                 SET_PARTICLE_FX_LOOPED_COLOUR(grav_partfx, 1.0f, 0.84f, 0.0f, 0);
  959.             }
  960.         }
  961.  
  962.         //RequestControlOfid(NETWORK_GET_NETWORK_ID_FROM_ENTITY(grav_entity));
  963.         RequestControlOfEnt(grav_entity);
  964.         SET_ENTITY_COORDS_NO_OFFSET(grav_entity, Coord[0], Coord[1], Coord[2], 0, 0, 0);
  965.         if (IS_ENTITY_A_VEHICLE(grav_entity)) SET_ENTITY_HEADING(grav_entity, GET_ENTITY_HEADING(PLAYER_PED_ID()) + 90.0f);
  966.  
  967.         if (IS_PED_SHOOTING(PLAYER_PED_ID()))
  968.         {
  969.             PLAY_SOUND_FROM_ENTITY(-1, (DWORD*)"Foot_Swish", grav_entity, (DWORD*)"docks_heist_finale_2a_sounds", 0, 0);
  970.             SET_ENTITY_HEADING(grav_entity, GET_ENTITY_HEADING(PLAYER_PED_ID()));
  971.             APPLY_FORCE_TO_ENTITY(grav_entity, 1, 0.0f, 350.0f, 2.0f, 2.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1);
  972.             grav_target_locked = false;
  973.         }
  974.     }
  975.     else if (DOES_PARTICLE_FX_LOOPED_EXIST(grav_partfx))
  976.     {
  977.         STOP_PARTICLE_FX_LOOPED(grav_partfx, 0);
  978.         REMOVE_PARTICLE_FX(grav_partfx, 0);
  979.         REMOVE_PTFX_ASSET();
  980.     }
  981.     if (!IS_PLAYER_FREE_AIMING_AT_ENTITY(tempPed, grav_entity) || !IS_PLAYER_TARGETTING_ENTITY(tempPed, grav_entity)) grav_target_locked = false;
  982.  
  983. }
  984. void set_gta2_cam_rot()
  985. {
  986.     Vector3 Rot = GET_GAMEPLAY_CAM_ROT(2);
  987.     if (!Check_self_in_vehicle()){
  988.         SET_ENTITY_ROTATION(PLAYER_PED_ID(), Rot.x, Rot.y, Rot.z, 2, 1);
  989.     }
  990.     else{
  991.         SET_ENTITY_ROTATION(myVeh, Rot.x, Rot.y, Rot.z, 2, 1);
  992.     }
  993. }
  994.  
  995.  
  996. }
  997.  
  998.  
  999.  
  1000. namespace sub{
  1001. // Define submenus here.
  1002.  
  1003. void MainMenu()
  1004. {
  1005.     AddTitle("Menya Baes");
  1006.     AddOption("Sample Submenu", null, nullFunc, SUB::SAMPLE);
  1007.     AddOption("Large Submenu", null, nullFunc, SUB::YOURSUB);
  1008.     AddOption("Settings", null, nullFunc, SUB::SETTINGS);
  1009.  
  1010.     if (menujustopened)
  1011.     {
  1012.         PrintBottomLeft(AddStrings("Menya Base by ", "MAFINS.")); // Your opening message goes here.
  1013.         menujustopened = false;
  1014.     }
  1015. }
  1016.  
  1017. void Settings()
  1018. {
  1019.     bool settings_pos_plus = 0, settings_pos_minus = 0;
  1020.  
  1021.     AddTitle("Settings");
  1022.     AddOption("Menu Colours", null, nullFunc, SUB::SETTINGS_COLOURS);
  1023.     AddOption("Menu Fonts", null, nullFunc, SUB::SETTINGS_FONTS);
  1024.     AddToggle("Centre Title", menu::bit_centre_title);
  1025.     AddToggle("Centre Options", menu::bit_centre_options);
  1026.     AddToggle("Centre Breaks", menu::bit_centre_breaks);
  1027.     AddNumber("Menu Position", (DWORD)menuPos / 100, 0, null, settings_pos_plus, settings_pos_minus);
  1028.  
  1029.     if (settings_pos_plus){
  1030.         if (menuPos < 0.68f) menuPos += 0.01f;
  1031.         return;
  1032.     }
  1033.     else if (settings_pos_minus){
  1034.         if (menuPos > 0.0f) menuPos -= 0.01f;
  1035.         return;
  1036.     }
  1037.  
  1038. }
  1039. void AddsettingscolOption(char* text, RGBA &feature)
  1040. {
  1041.     AddOption(text, null, nullFunc, SUB::SETTINGS_COLOURS2);
  1042.  
  1043.     if (menu::printingop == menu::currentop) settings_rgba = &feature;
  1044. }
  1045. void SettingsColours()
  1046. {
  1047.     AddTitle("Menu Colours");
  1048.     AddsettingscolOption("Title Box", titlebox);
  1049.     AddsettingscolOption("Background", BG);
  1050.     AddsettingscolOption("Title Text", titletext);
  1051.     AddsettingscolOption("Option Text", optiontext);
  1052.     AddsettingscolOption("Selected Text", selectedtext);
  1053.     AddsettingscolOption("Option Breaks", optionbreaks);
  1054.     AddsettingscolOption("Option Count", optioncount);
  1055.     AddsettingscolOption("Selection Box", selectionhi);
  1056.     AddToggle("Rainbow", loop_RainbowBoxes);
  1057. }
  1058. void SettingsColours2()
  1059. {
  1060.     bool settings_r_input = 0, settings_r_plus = 0, settings_r_minus = 0;
  1061.     int *settings_rgba2;
  1062.  
  1063.     AddTitle("Set Colour");
  1064.     AddNumber("Red", settings_rgba->R, 0, settings_r_input, settings_r_plus, settings_r_minus);
  1065.     AddNumber("Green", settings_rgba->G, 0, settings_r_input, settings_r_plus, settings_r_minus);
  1066.     AddNumber("Blue", settings_rgba->B, 0, settings_r_input, settings_r_plus, settings_r_minus);
  1067.     AddNumber("Opacity", settings_rgba->A, 0, settings_r_input, settings_r_plus, settings_r_minus);
  1068.  
  1069.     switch (menu::currentop)
  1070.     {
  1071.     case 1: settings_rgba2 = &settings_rgba->R; break;
  1072.     case 2: settings_rgba2 = &settings_rgba->G; break;
  1073.     case 3: settings_rgba2 = &settings_rgba->B; break;
  1074.     case 4: settings_rgba2 = &settings_rgba->A; break;
  1075.     }
  1076.  
  1077.     if (settings_r_input){
  1078.         int tempHash = abs(StringToInt(keyboard()));
  1079.         if (!(tempHash >= 0 && tempHash <= 255)) PrintError_InvalidInput();
  1080.         else *settings_rgba2 = tempHash;
  1081.         return;
  1082.     }
  1083.  
  1084.     if (settings_r_plus){
  1085.         if (*settings_rgba2 < 255) (*settings_rgba2)++;
  1086.         else *settings_rgba2 = 0;
  1087.         return;
  1088.     }
  1089.     else if (settings_r_minus){
  1090.         if (*settings_rgba2 > 0) (*settings_rgba2)--;
  1091.         else *settings_rgba2 = 255;
  1092.         return;
  1093.     }
  1094. }
  1095. void AddsettingsfonOption(char* text, int font_index = -1, int &feature = inull)
  1096. {
  1097.     bool bit_changefont = 0, bit_setfeature = 0;
  1098.     if (font_index == -1) AddOption(text, bit_setfeature, nullFunc, SUB::SETTINGS_FONTS2);
  1099.     else AddOption(text, bit_changefont);
  1100.  
  1101.     if (bit_setfeature) settings_font = &feature;
  1102.     else if (bit_changefont) *settings_font = font_index;
  1103. }
  1104. void SettingsFonts()
  1105. {
  1106.     AddTitle("Menu Fonts");
  1107.     AddsettingsfonOption("Title", -1, font_title);
  1108.     AddsettingsfonOption("Options", -1, font_options);
  1109.     AddsettingsfonOption("Selected Option", -1, font_selection);
  1110.     AddsettingsfonOption("Option Breaks", -1, font_breaks);
  1111. }
  1112. void SettingsFonts2()
  1113. {
  1114.     bool fonts2_input = 0;
  1115.  
  1116.     AddTitle("Set Font");
  1117.     AddsettingsfonOption("Normalish", 0);
  1118.     AddsettingsfonOption("Impactish", 4);
  1119.     AddsettingsfonOption("Italic", 1);
  1120.     AddsettingsfonOption("Pricedown", 7);
  1121.     AddsettingsfonOption("Caps", 2);
  1122.     AddOption("Input Index", fonts2_input);
  1123.  
  1124.     if (fonts2_input){
  1125.         int tempInt = abs(StringToInt(keyboard()));
  1126.         *settings_font = tempInt;
  1127.         return;
  1128.     }
  1129. }
  1130.  
  1131.  
  1132.  
  1133. void SampleSub()
  1134. {
  1135.     bool sample_mapmod = 0, hour_plus = 0, hour_minus = 0, timescale_plus = 0, timescale_minus = 0, sample_invisible = 0, sample_gravity_gun_on = 0,
  1136.     sample_gta2cam = 0;
  1137.  
  1138.     int sample_hour = GET_CLOCK_HOURS();
  1139.  
  1140.     AddTitle("SHRUNKEN TITLE FEATURE");
  1141.  
  1142.     AddBreak("---Map---");
  1143.     AddOption("Load Map Mod", sample_mapmod);
  1144.     AddTele("Teleport to Map Mod", 509.8423f, 5589.2422f, 792.0000f);
  1145.  
  1146.     AddBreak("---Weather---");
  1147.     AddNumber("Hour", GET_CLOCK_HOURS(), 0, null, hour_plus, hour_minus);
  1148.     AddNumber("Time Scale", current_timescale, 2, null, timescale_plus, timescale_minus);
  1149.  
  1150.     AddBreak("---Others---");
  1151.     AddLocal("Invisibility", !IS_ENTITY_VISIBLE(PLAYER_PED_ID()), sample_invisible, sample_invisible);
  1152.     AddToggle("Gravity Gun", loop_gravity_gun, sample_gravity_gun_on);
  1153.     AddToggle("GTA 2 Cam", loop_gta2cam, sample_gta2cam, sample_gta2cam);
  1154.     AddToggle("Massacre Mode", loop_massacre_mode);
  1155.     AddOption("Create Escort", null, sample_createEscort);
  1156.  
  1157.     AddBreak("---deez breaks r ugly---");
  1158.  
  1159.  
  1160.     if (sample_mapmod){
  1161.         Any tempHash = GET_HASH_KEY("prop_container_01a");
  1162.         PlaceObject(tempHash, 509.8423f, 5589.2422f, 791.0656f, 0.1410f, 0.0f, 65.3998f);
  1163.         PlaceObject(tempHash, 520.5002f, 5584.3774f, 790.5033f, 5.4410f, 0.0f, 65.3998f);
  1164.         PlaceObject(tempHash, 531.0571f, 5579.5405f, 788.6912f, 12.4410f, 0.0f, 65.3998f);
  1165.         PlaceObject(tempHash, 541.3253f, 5574.8403f, 785.4896f, 19.4409f, 0.0f, 65.3998f);
  1166.         PlaceObject(tempHash, 551.0662f, 5570.3701f, 780.7990f, 27.5407f, 0.0f, 65.3998f);
  1167.         PlaceObject(tempHash, 560.1738f, 5566.2046f, 774.6979f, 35.0403f, 0.0f, 65.3998f);
  1168.         PlaceObject(tempHash, 568.6718f, 5562.3198f, 767.4281f, 40.7396f, 0.0f, 65.3998f);
  1169.         PlaceObject(tempHash, 576.9716f, 5558.5269f, 759.5663f, 40.7396f, 0.0f, 65.3998f);
  1170.         PlaceObject(tempHash, 585.2493f, 5554.7471f, 751.7451f, 40.7396f, 0.0f, 65.3998f);
  1171.         PlaceObject(tempHash, 593.5072f, 5550.9722f, 743.9170f, 40.7396f, 0.0f, 65.3998f);
  1172.         PlaceObject(tempHash, 601.7770f, 5547.1912f, 736.0764f, 40.7396f, 0.0f, 65.3998f);
  1173.         PlaceObject(tempHash, 610.0651f, 5543.3994f, 728.2167f, 40.7396f, 0.0f, 65.3998f);
  1174.         PlaceObject(tempHash, 618.3337f, 5539.6226f, 720.3861f, 40.7936f, 0.0f, 65.3998f);
  1175.         PlaceObject(tempHash, 626.6017f, 5535.8477f, 712.5473f, 40.7396f, 0.0f, 65.3998f);
  1176.         PlaceObject(tempHash, 634.8616f, 5532.0669f, 704.7252f, 40.7396f, 0.0f, 65.3998f);
  1177.         PlaceObject(tempHash, 643.1213f, 5528.2861f, 696.8940f, 40.7936f, 0.0f, 65.3998f);
  1178.         PlaceObject(tempHash, 651.3914f, 5524.5059f, 689.0526f, 40.7396f, 0.0f, 65.3998f);
  1179.         PlaceObject(tempHash, 659.6512f, 5520.7275f, 681.2211f, 40.7396f, 0.0f, 65.3998f);
  1180.         PlaceObject(tempHash, 667.9110f, 5516.9424f, 673.3893f, 40.7396f, 0.0f, 65.3998f);
  1181.         PlaceObject(tempHash, 676.1708f, 5513.1670f, 665.5580f, 40.7396f, 0.0f, 65.3998f);
  1182.         PlaceObject(tempHash, 684.4307f, 5509.3789f, 657.7266f, 40.7396f, 0.0f, 65.3998f);
  1183.         PlaceObject(tempHash, 692.6906f, 5505.6079f, 649.9052f, 40.7396f, 0.0f, 65.3998f);
  1184.         PlaceObject(tempHash, 700.9504f, 5501.8271f, 642.0737f, 40.7396f, 0.0f, 65.3998f);
  1185.         PlaceObject(tempHash, 709.2201f, 5498.0464f, 634.2426f, 40.7396f, 0.0f, 65.3998f);
  1186.         PlaceObject(tempHash, 717.4602f, 5494.2759f, 626.4309f, 40.7396f, 0.0f, 65.3998f);
  1187.         PlaceObject(tempHash, 725.7202f, 5490.4980f, 618.5996f, 40.7396f, 0.0f, 65.3998f);
  1188.         PlaceObject(tempHash, 733.9800f, 5486.7226f, 610.7783f, 40.7396f, 0.0f, 65.3998f);
  1189.         PlaceObject(tempHash, 742.5997f, 5482.7764f, 603.1669f, 36.9395f, 0.0f, 65.3998f);
  1190.         PlaceObject(tempHash, 751.8304f, 5478.5518f, 596.3347f, 31.0392f, 0.0f, 65.3998f);
  1191.         PlaceObject(tempHash, 761.7103f, 5474.0220f, 590.6132f, 24.5989f, 0.0f, 65.3998f);
  1192.         PlaceObject(tempHash, 772.0702f, 5469.2827f, 586.0803f, 18.9288f, 0.0f, 65.3998f);
  1193.         PlaceObject(tempHash, 782.8400f, 5464.3433f, 582.8604f, 11.5788f, 0.0f, 65.3998f);
  1194.         PlaceObject(tempHash, 793.8899f, 5459.2847f, 581.1174f, 5.0787f, 0.0f, 65.3998f);
  1195.         PlaceObject(tempHash, 805.1001f, 5454.1479f, 580.8762f, -2.5212f, 0.0f, 65.3998f);
  1196.         PlaceObject(tempHash, 816.1702f, 5449.0796f, 581.9746f, -7.6213f, 0.0f, 65.3998f);
  1197.         PlaceObject(tempHash, 827.1907f, 5444.0405f, 584.5823f, -16.6212f, 0.0f, 65.3998f);
  1198.         PlaceObject(tempHash, 837.6807f, 5439.2407f, 588.8990f, -24.4210f, 0.0f, 65.3998f);
  1199.         PrintBottomLeft(AddStrings("Hax by ~b~", "XBLToothpik"));
  1200.         return;
  1201.     }
  1202.  
  1203.     if (hour_plus){
  1204.         if (sample_hour + 1 == 24) NETWORK_OVERRIDE_CLOCK_TIME(0, 0, 0);
  1205.         else NETWORK_OVERRIDE_CLOCK_TIME((sample_hour + 1), 0, 0);
  1206.         return;
  1207.     }
  1208.     else if (hour_minus){
  1209.         if ((sample_hour - 1) == -1) NETWORK_OVERRIDE_CLOCK_TIME(23, 0, 0);
  1210.         else NETWORK_OVERRIDE_CLOCK_TIME((sample_hour - 1), 0, 0);
  1211.         return;
  1212.     }
  1213.  
  1214.     if (timescale_plus){
  1215.         if (current_timescale < 2.0f) current_timescale += 0.1f;
  1216.         SET_TIME_SCALE(current_timescale);
  1217.         return;
  1218.     }
  1219.     else if (timescale_minus){
  1220.         if (current_timescale > 0.0f) current_timescale -= 0.1f;
  1221.         SET_TIME_SCALE(current_timescale);
  1222.         return;
  1223.     }
  1224.  
  1225.     if (sample_invisible){
  1226.         if (IS_ENTITY_VISIBLE(PLAYER_PED_ID())) SET_ENTITY_VISIBLE(PLAYER_PED_ID(), 0);
  1227.         else SET_ENTITY_VISIBLE(PLAYER_PED_ID(), 1);
  1228.         return;
  1229.     }
  1230.  
  1231.     if (sample_gravity_gun_on){
  1232.         PrintStringBottomCentre("Use Mr ~b~Pistol~s~ for Hax!");
  1233.         return;
  1234.     }
  1235.  
  1236.     if (sample_gta2cam){
  1237.         if (loop_gta2cam)
  1238.         {
  1239.             if (DOES_CAM_EXIST(cam_gta2)) SET_CAM_ACTIVE(cam_gta2, 1);
  1240.             else
  1241.             {
  1242.                 cam_gta2 = CREATE_CAM("DEFAULT_SCRIPTED_CAMERA", 1);
  1243.                 ATTACH_CAM_TO_ENTITY(cam_gta2, PLAYER_PED_ID(), 0.0f, 0.0f, 8.5f, 1);
  1244.                 Vector3 Pos = GET_ENTITY_COORDS(PLAYER_PED_ID(), 1);
  1245.                 POINT_CAM_AT_COORD(cam_gta2, Pos.x, Pos.y, -1000000);
  1246.                 SET_CAM_ACTIVE(cam_gta2, 1);
  1247.             }
  1248.             RENDER_SCRIPT_CAMS(1, 0, 3000, 1, 0);
  1249.         }
  1250.         else if (DOES_CAM_EXIST(cam_gta2))
  1251.             {
  1252.                 SET_CAM_ACTIVE(cam_gta2, 0);
  1253.                 DESTROY_CAM(cam_gta2, 0);
  1254.                 RENDER_SCRIPT_CAMS(0, 0, 3000, 1, 0);
  1255.             }
  1256.         return;
  1257.     }
  1258.  
  1259.  
  1260.  
  1261. }
  1262.  
  1263. void YourSub()
  1264.  
  1265. {
  1266.     // Initialise local variables here:
  1267.     bool print_deez_nuts = 0;
  1268.  
  1269.     // Options' text here:
  1270.     AddTitle("Timone n Pumba");
  1271.     AddOption("Option 1", print_deez_nuts);
  1272.     AddOption("Option 2", print_deez_nuts);
  1273.     AddOption("Option 3", print_deez_nuts);
  1274.     AddOption("Option 4", print_deez_nuts);
  1275.     AddOption("Option 5", print_deez_nuts);
  1276.     AddOption("Option 6", print_deez_nuts);
  1277.     AddOption("Option 7", print_deez_nuts);
  1278.     AddOption("Option 8", print_deez_nuts);
  1279.     AddOption("Option 9", print_deez_nuts);
  1280.     AddOption("Option 10", print_deez_nuts);
  1281.     AddOption("Option 11", print_deez_nuts);
  1282.     AddOption("Option 12", print_deez_nuts);
  1283.     AddOption("Option 13", print_deez_nuts);
  1284.     AddOption("Option 14", print_deez_nuts);
  1285.     AddOption("Option 15", print_deez_nuts);
  1286.     AddOption("Option 16", print_deez_nuts);
  1287.     AddOption("Option 17", print_deez_nuts);
  1288.     AddOption("Option 18", print_deez_nuts);
  1289.     AddOption("Option 19", print_deez_nuts);
  1290.     AddOption("Option 20", print_deez_nuts);
  1291.     AddOption("Option 21", print_deez_nuts);
  1292.     AddOption("Option 22", print_deez_nuts);
  1293.     AddOption("Option 23", print_deez_nuts);
  1294.     AddOption("Option 24", print_deez_nuts);
  1295.     AddOption("Option 25", print_deez_nuts);
  1296.     AddOption("Option 26", print_deez_nuts);
  1297.     AddOption("Option 27", print_deez_nuts);
  1298.     AddOption("Option 28", print_deez_nuts);
  1299.     AddOption("Option 29", print_deez_nuts);
  1300.     AddOption("Option 30", print_deez_nuts);
  1301.     AddOption("Option 31", print_deez_nuts);
  1302.     AddOption("Option 32", print_deez_nuts);
  1303.  
  1304.     // Options' code here:
  1305.     if (print_deez_nuts)
  1306.     {
  1307.         PrintStringBottomCentre( AddStrings( AddInt_S( "Option ", menu::currentop ), " ~b~selected!" ) );
  1308.         return; // Either use return; to exit to the switch if you don't have code below that you want executed.
  1309.     }
  1310.  
  1311.  
  1312. }
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. }
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326. void menu::loops()
  1327. {
  1328.     /*  Make calls to functions that you want looped over here, e.g. ambient lights, whale guns, explosions, checks, flying deers, etc.
  1329.         Can also be used for (bool) options that are to be executed from many parts of the script. */
  1330.  
  1331.     myVeh = GET_VEHICLE_PED_IS_IN(PLAYER_PED_ID(), 0); // Store current vehicle
  1332.  
  1333.     if (loop_massacre_mode) set_massacre_mode(); // Massacre mode
  1334.  
  1335.     if (loop_RainbowBoxes && GET_GAME_TIMER() >= livetimer)
  1336.     {   titlebox.R = RandomRGB(); titlebox.G = RandomRGB(); titlebox.B = RandomRGB();
  1337.         BG.R = RandomRGB(); BG.G = RandomRGB(); BG.B = RandomRGB();
  1338.         selectedtext.R = RandomRGB(); selectedtext.G = RandomRGB(); selectedtext.B = RandomRGB();
  1339.     }
  1340.  
  1341.  
  1342.     if (loop_gravity_gun) set_gravity_gun();
  1343.  
  1344.     if (loop_gta2cam) set_gta2_cam_rot();
  1345.  
  1346. }
  1347.  
  1348. void menu::submenu_switch()
  1349. { // Make calls to submenus over here.
  1350.  
  1351.     switch (currentsub)
  1352.     {
  1353.     case SUB::MAINMENU:                 sub::MainMenu(); break;
  1354.     case SUB::SETTINGS:                 sub::Settings(); break;
  1355.     case SUB::SETTINGS_COLOURS:         sub::SettingsColours(); break;
  1356.     case SUB::SETTINGS_COLOURS2:        sub::SettingsColours2(); break;
  1357.     case SUB::SETTINGS_FONTS:           sub::SettingsFonts(); break;
  1358.     case SUB::SETTINGS_FONTS2:          sub::SettingsFonts2(); break;
  1359.     case SUB::SAMPLE:                   sub::SampleSub(); break;
  1360.     case SUB::YOURSUB:                  sub::YourSub(); break;
  1361. //  case SUB::NAME                      sub::name(); break;
  1362.  
  1363.     }
  1364. }
  1365.  
  1366.  
  1367. void menu::sub_handler()
  1368. {
  1369.     if (currentsub == SUB::CLOSED){
  1370.         while_closed();
  1371.     }
  1372.  
  1373.     else{
  1374.         submenu_switch();
  1375.         if (SetSub_delayed != NULL)
  1376.         {
  1377.             SetSub_new(SetSub_delayed);
  1378.             SetSub_delayed = NULL;
  1379.         }
  1380.  
  1381.         while_opened();
  1382.  
  1383.         if (GET_GAME_TIMER() >= livetimer) livetimer = GET_GAME_TIMER() + 1800; // 1.8s delay for rainbow related loops
  1384.     }
  1385. }
  1386. void main()
  1387. {
  1388.     srand(GetTickCount());
  1389.     while (true)
  1390.     {
  1391.         WAIT(0);
  1392.         menu::base();
  1393.         menu::loops();
  1394.         menu::sub_handler();
  1395.     }
  1396. }
Add Comment
Please, Sign In to add comment