Guest User

script.cpp

a guest
Jul 13th, 2018
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "script.h"
  2. #include <random>
  3. #include <iostream>
  4. #include <string>
  5. #include <sstream>
  6. #include <ctime>
  7.  
  8. #pragma warning(disable : 4244 4305) // double <-> float conversions
  9.  
  10. // controller support
  11.  
  12. // MAIN VARIABLES
  13. Player player;
  14. //std::string Text; // UNUSED TEXT VARIABLE
  15. Ped playerPed;
  16. float x, y, z, sx, sy, sz;
  17. Any mainBlip[1];
  18.  
  19. // BOOLEAN VARIABLES
  20. // SOME VARIABLES ARE UNUSED OR UNEEDED
  21. // TODO :: CLEAN SOME OF THEM.
  22. // USED TO INITIALIZE FUNCTION
  23. bool debugV = true;
  24. // CHECKS IF PLAYER IS IN AIR ... UNUSED.
  25. bool isInAir = false;
  26. bool menuDisplayed[5];
  27. // WETHER PLAYER IS AT RED OR BLUE HOUSE
  28. bool isAtRedHouse1 = false;
  29. bool joinedClean = false;
  30. bool joinedProtect = false;
  31. bool finishedProtect = false;
  32. bool isDrivingAway = false;
  33. bool isInside = false;
  34. bool handlerInit = false;
  35. bool hardcore = false;
  36. bool newMenu = false;
  37. bool blipSet = false;
  38. bool mission = false;
  39. bool sentMen = false;
  40. bool wasKilled[32];
  41. // TEMP VARIABLE
  42. bool tmp = false;
  43. bool canCancel = false;
  44.  
  45. // INTEGERS VARIABLES
  46. // NEEDS SOME CLEANING HERE TOO
  47. int oldRand; // UNUSED ?
  48. int tick;
  49. int randtick; // UNUSED ?
  50. // USED IN VIP MISSIONS TO DETERMINE HOW MANY PEOPLE ARE WE GONNA SPAWN IN THE CAR. PROSTEP IS EQUAL TO 2 IF THE CAR HAS 2 SEATS, 4 IF THE CAR HAS 4.
  51. int proStep;
  52. // BODYGUARD COUNT, USED IN bodyguard_leave() TO COUNT HOW MANY BODYGUARDS PLAYER FIRED.
  53. int bodyguard = 0;
  54. // USED IN MENUS, MAKES RANDOM YELLOW TEXT APPEAR.
  55. int random_text = 0;
  56. // STRING VARIABLES THAT CONTAINS THE NAME & CASH OF THE CONTRACT
  57. std::string contracts[3];
  58. // ID OF THE CONTRACT IS STORED INSIDE THIS VARIABLE. EXEMPLE : 1 IS ASSASSINATION, 3 IS VIP PROTECTION.
  59. int randContract[3];
  60. // PAYOUT OF THE CONTRACT, USED IN SETUP PAYOUT FUNCTION
  61. int payout[3];
  62. // MISSION COMPLETED COUNTER, USED TO NOW IF PLAYER HAS PLAYED ENOUGH TO UNLOCK HEIST CONTRACT
  63. int totalMission = 0;
  64. // USED IN COVERT MISSIONS TO DETERMINE AT WHAT HOUR THE QUICK CHANGING TIME SHOULD STOP.
  65. // EXEMPLE : IF HOURS = 23 THEN IT WILL STOP AT 23H00.
  66. int hours = 0;
  67. // SELECT TYPE USED IN PREVIOUS CONTRACTS
  68. // TODO :: FIND A BETTER WAY ?
  69. int selectedType, contractPayout[3];
  70. int random;
  71. // CALCULATE THE AMOUNT OF MOBSTERS IN VIP MISSIONS WHO DIED.
  72. int mobDead = 0;
  73. // WORKAROUND FOR THE MENU...
  74. int fiveTick = 0;
  75. // USED IN ASSASSINATION MISSIONS SO WE WON'T SPAM THE PLAYER WITH HIRED PROTECTION
  76. int callBack = 0;
  77.  
  78. // UI VALUES
  79. // ID OF THE MENU SELECTED
  80. int uiSelected = 0;
  81. // UNUSED VARIABLE TO ADD A SWITCHING BLUE EFFECT IN THE MENU...
  82. int blue = 0;
  83.  
  84. // VECTOR3 POSITIONS FOR ASSASSINATIONS MISSIONS
  85. Vector3 assMission[10];
  86. // PAYOUT VEHICLE HANDLE
  87. Any payVeh;
  88. // CONTAINS THE 5 RANDOM VEHICLES FOR ASSASSINATION MISSIONS
  89. char * cars[5];
  90.  
  91. // POSITIONS USED FOR RANDOMIZATION
  92. Vector3 mobClean;
  93. Vector3 mobProtect;
  94.  
  95. // BODYGUARD HANDS AND BORROWED VEHICLE
  96. Any bodyG[5];
  97. Any borVeh;
  98. // UNUSED.
  99. char * gxt;
  100. // USED IN VIP PROTECTION MISSIONS IN protect_loop() FUNCTION
  101. DWORD pedHi, ennHi, vehHi;
  102.  
  103.  
  104.  
  105. // TICKS
  106. int press_B_tick = 0;/*
  107.                      int press_E_tick = 0;
  108.                      int press_L_tick = 0;*/
  109.  
  110. // use them wisely
  111. Any scVeh[64];
  112. Any scPed[64];
  113. Any blips[64];
  114.  
  115. Vector3 spawnPt, spawnPt1, spawnPt2, position, sposition;
  116.  
  117. // NEEDED, COULD DO BETTER, BUT HEY, IT'S A MOD, WHO GIVES A SHIT.
  118. void setTextMsg(int type, char *text);
  119. void update();
  120. void recruit_checks();
  121. void pimpMyRide(int type, int id);
  122. void heist_1();
  123. void menuHandler();
  124. void cleanupMissions(int type);
  125.  
  126. void debug_func()
  127. {
  128.     if (CAM::IS_SCREEN_FADING_IN()) {
  129.         debugV = true;
  130.         UI::REMOVE_BLIP(&mainBlip[0]);
  131.     }
  132.  
  133.     if (debugV) {
  134.         // DISPLAY FOR 3SEC
  135.         debugV = false;
  136.         handlerInit = false;
  137.         //setTextMsg(2, "The ~r~Red ~w~& ~b~Blue ~w~House~w~ v3.3");
  138.         mainBlip[0] = UI::ADD_BLIP_FOR_COORD(125.6, -1044.6, 29.24);
  139.         UI::SET_BLIP_SPRITE(mainBlip[0], 304);
  140.         UI::SET_BLIP_COLOUR(mainBlip[0], 3);
  141.         UI::SET_BLIP_AS_SHORT_RANGE(mainBlip[0], true);
  142.         UI::BEGIN_TEXT_COMMAND_SET_BLIP_NAME("FMMC_RSTAR_MS");
  143.         UI::END_TEXT_COMMAND_SET_BLIP_NAME(mainBlip[0]);
  144.  
  145.         for (int i = 32; i < 32; i++){
  146.             wasKilled[i] = false;
  147.         }
  148.     }
  149.  
  150. }
  151.  
  152. // DON'T EVEN KNOW IF IT'S USED ANYMORE...
  153. void basic_check()
  154. {
  155.     if (ENTITY::IS_ENTITY_DEAD(playerPed) || PLAYER::IS_PLAYER_BEING_ARRESTED(player, false))
  156.     {
  157.         cleanupMissions(1);
  158.         setTextMsg(2000, "~r~Mission failed ~w~:~n~I thought you were a pro !");
  159.         for (int i = 0; i < 5; i++){ ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&bodyG[i]); }
  160.     }
  161. }
  162.  
  163. // TAKEN FROM MY ARMY RESPONSE MOD, DRAWS 2 LINES AROUND THE PLAYER AND FINDS SPAWN POINTS WITHIN A RADIUS AROUND THE PLAYER.
  164. void set_spawn_points()
  165. {
  166.  
  167.     float step = 0.0f;
  168.     if (rand() % 2 == 1){ step = -100.0f; }
  169.     else { step = 100.0f; }
  170.     spawnPt1 = sposition;
  171.     spawnPt1.x = sposition.x + step;
  172.     if (rand() % 2 == 1){ step = -100.0f; }
  173.     else { step = 100.0f; }
  174.     spawnPt2 = sposition;
  175.     spawnPt2.y = sposition.y + step;
  176.  
  177.  
  178.     if (rand() % 2 == 1){ step = -1.0f; }
  179.     else { step = 1.0f; }
  180.  
  181.     // set spawn points with a radius of 500
  182.     int maxStep = 100;
  183.     // finding spawnpt1 loop.
  184.     while (!PATHFIND::IS_POINT_ON_ROAD(spawnPt1.x, spawnPt1.y, spawnPt1.z, 0) && maxStep > 0)
  185.     {
  186.         spawnPt1.x += step;
  187.         maxStep--;
  188.     }
  189.     // resetting max step to 75
  190.     maxStep = 100;
  191.     if (rand() % 2 == 1){ step = -1.0f; }
  192.     else { step = 1.0f; }
  193.     // finding spawnpt2 loop.
  194.     while (!PATHFIND::IS_POINT_ON_ROAD(spawnPt2.x, spawnPt2.y, spawnPt2.z, 0) && maxStep > 0)
  195.     {
  196.         spawnPt2.y -= step;
  197.         maxStep--;
  198.     }
  199.     GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(spawnPt2.x, spawnPt2.y, spawnPt2.z + 100.0f, &spawnPt2.z);
  200.     GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(spawnPt1.x, spawnPt1.y, spawnPt1.z + 100.0f, &spawnPt1.z);
  201.  
  202. }
  203.  
  204. // DISPLAYS A NOTIFICATION.
  205. void setTextMsg(int time, char *text)
  206. {
  207.     UI::_0x202709F4C58A0424((DWORD *) "STRING"); // _SET_NOTIFICATION_TEXT_ENTRY
  208.     //UI::_SET_TEXT_ENTRY("STRING");
  209.     // displays name of an input
  210.     //UI::_0x17299B63C7683A2B(GAMEPLAY::GET_HASH_KEY(gxt));
  211.     UI::_0x80EAD8E2E1D5D52E(GAMEPLAY::GET_HASH_KEY(gxt));
  212.     UI::_ADD_TEXT_COMPONENT_STRING(text);
  213.     UI::_0x2ED7843F8F801023(FALSE, FALSE); // _DRAW_NOTIFICATION
  214.     UI::_0x9D77056A530643F6(time, 1);
  215. }
  216.  
  217. // SETUPS THE PAYOUT SCENE
  218. void setupPayout()
  219. {
  220.     totalMission++;
  221.     DWORD bison = GAMEPLAY::GET_HASH_KEY("bison");
  222.     DWORD mcase = GAMEPLAY::GET_HASH_KEY("prop_security_case_01");
  223.     DWORD pcase = GAMEPLAY::GET_HASH_KEY("pickup_money_case");
  224.     STREAMING::REQUEST_MODEL(mcase);
  225.     STREAMING::REQUEST_MODEL(pcase);
  226.     STREAMING::REQUEST_MODEL(bison);
  227.     while (!STREAMING::HAS_MODEL_LOADED(bison) || !STREAMING::HAS_MODEL_LOADED(mcase))
  228.         WAIT(100);
  229.  
  230.     payVeh = VEHICLE::CREATE_VEHICLE(bison, 135.3, -1050.86, 29.3, 159.6, 0, true);
  231.     VEHICLE::SET_VEHICLE_DOOR_OPEN(payVeh, 5, false, false);
  232.     //WAIT(2000);
  233.     if (contractPayout[uiSelected] > 44000 && contractPayout[uiSelected] < 176000) {
  234.         contractPayout[uiSelected] /= 4;
  235.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.0, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  236.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  237.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.832, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  238.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 137.1, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  239.     }
  240.     else if (contractPayout[uiSelected] > 176000) {
  241.         contractPayout[uiSelected] /= 8;
  242.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.0, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  243.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  244.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.832, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  245.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 137.1, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  246.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.0, 29.26, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  247.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.79, 29.26, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  248.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.832, -1048.79, 29.26, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  249.         OBJECT::CREATE_PICKUP_ROTATE(pcase, 137.1, -1048.79, 29.26, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase);
  250.     }
  251.     else { OBJECT::CREATE_PICKUP_ROTATE(pcase, 136.132, -1048.79, 29.16, -90.0, 0.0, 90, 0, contractPayout[uiSelected], 2, 1, mcase); }
  252.  
  253.     //OBJECT::CREATE_PICKUP(pcase, 136.326, -1048.23, 29, 0, contractPayout, true, mcase);
  254.     contractPayout[uiSelected] = 0;
  255.     selectedType = 0;
  256.  
  257. }
  258.  
  259. // SETUPS CARS
  260. // FOR ASSASSINATION MISSIONS
  261. void setupCars(int type)
  262. {
  263.     if (type == 1)
  264.     {
  265.         cars[0] = "sentinel";
  266.         cars[1] = "patriot";
  267.         cars[2] = "zion";
  268.         cars[3] = "oracle2";
  269.         cars[4] = "oracle";
  270.  
  271.     }
  272. }
  273.  
  274. // SETUPS STATIC SPAWN POINTS FOR SPAWN POINTS
  275. void setupSpawnPts(int type){
  276.  
  277.     if (type == 1)
  278.     {
  279.  
  280.         // assassination missions
  281.         assMission[0].x = 692;
  282.         assMission[0].y = 606;
  283.         assMission[0].z = 129;
  284.  
  285.         assMission[1].x = -1185;
  286.         assMission[1].y = -125;
  287.         assMission[1].z = 41;
  288.  
  289.         assMission[2].x = -784;
  290.         assMission[2].y = 971;
  291.         assMission[2].z = 238;
  292.  
  293.         assMission[3].x = -1232;
  294.         assMission[3].y = -1085;
  295.         assMission[3].z = 9;
  296.  
  297.         assMission[4].x = 344;
  298.         assMission[4].y = -2506;
  299.         assMission[4].z = 6;
  300.  
  301.         assMission[5].x = -907;
  302.         assMission[5].y = -2673;
  303.         assMission[5].z = 14;
  304.  
  305.         assMission[6].x = -887;
  306.         assMission[6].y = -1968;
  307.         assMission[6].z = 28;
  308.  
  309.         assMission[7].x = 1040;
  310.         assMission[7].y = -2348;
  311.         assMission[7].z = 31;
  312.  
  313.         assMission[8].x = -850;
  314.         assMission[8].y = -652;
  315.         assMission[8].z = 27;
  316.  
  317.         assMission[9].x = 106;
  318.         assMission[9].y = -1938;
  319.         assMission[9].z = 21;
  320.     }
  321.  
  322. }
  323.  
  324. void mobClean1() {
  325.  
  326.     mobClean.x = -15.85;
  327.     mobClean.y = -1835.15;
  328.     mobClean.z = 25.35;
  329.  
  330.     blips[1] = UI::ADD_BLIP_FOR_COORD(mobClean.x, mobClean.y, mobClean.z);
  331.     UI::SET_BLIP_COLOUR(blips[1], 3);
  332.  
  333.     DWORD vehH = GAMEPLAY::GET_HASH_KEY("landstalker");
  334.     DWORD pedH = GAMEPLAY::GET_HASH_KEY("G_M_Y_BallaEast_01");
  335.     DWORD weapH;
  336.  
  337.     STREAMING::REQUEST_MODEL(vehH);
  338.     STREAMING::REQUEST_MODEL(pedH);
  339.  
  340.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH))
  341.         WAIT(100);
  342.  
  343.     // vehicles
  344.     scVeh[6] = VEHICLE::CREATE_VEHICLE(vehH, 12.20, -1822.6, 25.06, 156.0f, 0, true);
  345.     scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, 8.29, -1836.6, 24.8, 76.0f, 0, true);
  346.     scVeh[8] = VEHICLE::CREATE_VEHICLE(vehH, 6.95, -1809, 25.35, 266.0f, 0, true);
  347.  
  348.     // peds (veh1)
  349.     scPed[6] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, -1, false, false);
  350.     scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 0, false, false);
  351.     scPed[8] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 1, false, false);
  352.     scPed[9] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 2, false, false);
  353.  
  354.     // peds (veh3)
  355.     scPed[10] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, -1, false, false);
  356.     scPed[11] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 0, false, false);
  357.     scPed[12] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 1, false, false);
  358.     scPed[13] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 2, false, false);
  359.  
  360.     // peds wandering
  361.     for (int i = 0; i < 7; i++)
  362.     {
  363.         weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  364.         STREAMING::REQUEST_MODEL(weapH);
  365.         scPed[14] = PED::CREATE_PED(26, pedH, 7.70, -1819.8, 25.37, 181, false, true);
  366.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[14], weapH, 1000, false);
  367.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[14], 0x90c7da60);
  368.     }
  369.     scPed[14] = PED::CREATE_PED(26, pedH, 7.70, -1819.8, 25.37, 181, false, true);
  370.     scPed[15] = PED::CREATE_PED(26, pedH, 6.33, -1821.67, 25.38, 290, false, true);
  371.     scPed[16] = PED::CREATE_PED(26, pedH, 7.41, -1822, 25.25, 0, false, true);
  372.  
  373.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  374.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  375.  
  376.  
  377.     for (int i = 6; i < 17; i++)
  378.     {
  379.         if (rand() % 3 == 0) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  380.         if (rand() % 3 == 1) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PUMPSHOTGUN");
  381.         if (rand() % 3 == 2) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  382.         STREAMING::REQUEST_MODEL(weapH);
  383.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i], weapH, 1000, false);
  384.         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i], weapH, true);
  385.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i], 0x90c7da60);
  386.  
  387.     }
  388.  
  389.  
  390.  
  391.  
  392. }
  393.  
  394. // CLEANS THE BLIPS ON THE MAP.
  395. void mobCleanBlips(bool first)
  396. {
  397.     if (first) {
  398.         for (int i = 6; i < 17; i++)
  399.         {
  400.             blips[i] = UI::ADD_BLIP_FOR_ENTITY(scPed[i]);
  401.         }
  402.     }
  403.     else {
  404.         for (int i = 6; i < 17; i++)
  405.         {
  406.             if (ENTITY::IS_ENTITY_DEAD(scPed[i])) UI::REMOVE_BLIP(&blips[i]);
  407.         }
  408.     }
  409. }
  410.  
  411. void mobClean2() {
  412.     mobClean.x = -1130;
  413.     mobClean.y = -1586;
  414.     mobClean.z = 4.4;
  415.  
  416.     blips[1] = UI::ADD_BLIP_FOR_COORD(mobClean.x, mobClean.y, mobClean.z);
  417.     UI::SET_BLIP_COLOUR(blips[1], 3);
  418.  
  419.     DWORD vehH = GAMEPLAY::GET_HASH_KEY("burrito3");
  420.     DWORD pedH = GAMEPLAY::GET_HASH_KEY("G_M_Y_MexGoon_01");
  421.     DWORD weapH;
  422.  
  423.     STREAMING::REQUEST_MODEL(vehH);
  424.     STREAMING::REQUEST_MODEL(pedH);
  425.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH))
  426.         WAIT(100);
  427.  
  428.     // vehicles
  429.     scVeh[6] = VEHICLE::CREATE_VEHICLE(vehH, -1129, -1608, 4.39, 270, 0, true);
  430.     scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, -1114, -1621, 4.5, 304, 0, true);
  431.     scVeh[8] = VEHICLE::CREATE_VEHICLE(vehH, -1111, -1608, 4.54, 32, 0, true);
  432.  
  433.     // peds (veh1)
  434.     scPed[6] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, -1, false, false);
  435.     scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 0, false, false);
  436.     scPed[8] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 1, false, false);
  437.     scPed[9] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 2, false, false);
  438.  
  439.     // peds (veh3)
  440.     scPed[10] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, -1, false, false);
  441.     scPed[11] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 0, false, false);
  442.     scPed[12] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 1, false, false);
  443.     scPed[13] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 2, false, false);
  444.  
  445.     for (int i = 0; i < 7; i++)
  446.     {
  447.         weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  448.         STREAMING::REQUEST_MODEL(weapH);
  449.         scPed[14] = PED::CREATE_PED(26, pedH, -1112, -1623, 4.45, 16, false, true);
  450.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[14], weapH, 1000, false);
  451.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[14], 0x90c7da60);
  452.     }
  453.  
  454.     // peds wandering
  455.     scPed[14] = PED::CREATE_PED(26, pedH, -1112, -1623, 4.45, 16, false, true);
  456.     scPed[15] = PED::CREATE_PED(26, pedH, -1114, -1623, 4.45, 2, false, true);
  457.     scPed[16] = PED::CREATE_PED(26, pedH, -1119.6, -1616.2, 9.64, 358, false, true);
  458.  
  459.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  460.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  461.  
  462.  
  463.     for (int i = 6; i < 17; i++)
  464.     {
  465.         if (rand() % 3 == 0) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  466.         if (rand() % 3 == 1) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTRIFLE");
  467.         if (rand() % 3 == 2) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  468.         STREAMING::REQUEST_MODEL(weapH);
  469.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i], weapH, 1000, false);
  470.         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i], weapH, true);
  471.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i], 0x90c7da60);
  472.     }
  473.  
  474. }
  475.  
  476. void mobClean3() {
  477.     mobClean.x = 1352.5;
  478.     mobClean.y = -572;
  479.     mobClean.z = 74;
  480.  
  481.     blips[1] = UI::ADD_BLIP_FOR_COORD(mobClean.x, mobClean.y, mobClean.z);
  482.     UI::SET_BLIP_COLOUR(blips[1], 3);
  483.  
  484.     DWORD vehH = GAMEPLAY::GET_HASH_KEY("comet2");
  485.     DWORD pedH = GAMEPLAY::GET_HASH_KEY("G_M_M_ChiGoon_01");
  486.     DWORD weapH;
  487.  
  488.     STREAMING::REQUEST_MODEL(vehH);
  489.     STREAMING::REQUEST_MODEL(pedH);
  490.  
  491.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH))
  492.         WAIT(100);
  493.  
  494.     // vehicles
  495.     scVeh[6] = VEHICLE::CREATE_VEHICLE(vehH, 1363, -554, 75, 156.0f, 0, true);
  496.     scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, 1387, -577, 75, 288.0f, 0, true);
  497.     scVeh[8] = VEHICLE::CREATE_VEHICLE(vehH, 1378, -597, 75, 49, 0, true);
  498.  
  499.     // peds (veh1)
  500.     scPed[6] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, -1, false, false);
  501.     scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 0, false, false);
  502.     scPed[8] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 1, false, false);
  503.     scPed[9] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 2, false, false);
  504.  
  505.     // peds (veh3)
  506.     scPed[10] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, -1, false, false);
  507.     scPed[11] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 0, false, false);
  508.     scPed[12] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 1, false, false);
  509.     scPed[13] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 3, pedH, 2, false, false);
  510.  
  511.     for (int i = 0; i < 7; i++)
  512.     {
  513.         weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  514.         STREAMING::REQUEST_MODEL(weapH);
  515.         scPed[14] = PED::CREATE_PED(26, pedH, 1359, -599, 75, 354, false, true);
  516.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[14], weapH, 1000, false);
  517.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[14], 0x90c7da60);
  518.     }
  519.  
  520.     // peds wandering
  521.     scPed[14] = PED::CREATE_PED(26, pedH, 1359, -599, 75, 354, false, true);
  522.     scPed[15] = PED::CREATE_PED(26, pedH, 1361, -599, 75, 354, false, true);
  523.     scPed[16] = PED::CREATE_PED(26, pedH, 1363, -599, 75, 354, false, true);
  524.  
  525.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  526.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  527.  
  528.  
  529.     for (int i = 6; i < 17; i++)
  530.     {
  531.         if (rand() % 3 == 0) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTRIFLE");
  532.         if (rand() % 3 == 1) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MG");
  533.         if (rand() % 3 == 2) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  534.         STREAMING::REQUEST_MODEL(weapH);
  535.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i], weapH, 1000, false);
  536.         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i], weapH, true);
  537.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i], 0x90c7da60);
  538.     }
  539. }
  540.  
  541. // DISPLAYS THE CANCEL MESSAGE
  542. void cancelMsg()
  543. {
  544.     //setTextMsg(1000, "~b~Info~w~:~n~Press Right + ~y~Y~w~ or [O] at any moment to cancel the contract.");
  545.     //setTextMsg(1000, "~b~Info~w~:~n~Press ~INPUT_CONTEXT~ + ~INPUT_VEH_EXIT~ or [O] at any moment to cancel the contract.");
  546.     setTextMsg(1000, "~b~Info~w~:~n~Press ~INPUT_CONTEXT_SECONDARY~ or [O] at any moment to cancel the contract.");
  547.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  548. }
  549.  
  550. // PROTECTION LOOP.
  551. void protectLoop()
  552. {
  553.     STREAMING::REQUEST_MODEL(ennHi);
  554.     while (!STREAMING::HAS_MODEL_LOADED(ennHi))
  555.         WAIT(100);
  556.     DWORD weapH;
  557.     tick++;
  558.  
  559.  
  560.     if (!finishedProtect) {
  561.         for (int i = 7; i < 24; i += proStep)
  562.         {
  563.             set_spawn_points();
  564.             if ((!ENTITY::DOES_ENTITY_EXIST(scPed[i]) || ENTITY::IS_ENTITY_DEAD(scPed[i])) && tick > 120) {
  565.                 if (!ENTITY::IS_ENTITY_AT_COORD(playerPed, spawnPt1.x, spawnPt1.y, spawnPt1.z, 35, 35, 35, 0, 1, 0) && !ENTITY::IS_ENTITY_AT_COORD(playerPed, spawnPt2.x, spawnPt2.y, spawnPt2.z, 35, 35, 35, 0, 1, 0)) {
  566.                     tick = 0;
  567.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  568.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[i]);
  569.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i + 2]);
  570.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i + 3]);
  571.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i + 1]);
  572.                     //ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[7]);
  573.                     //ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[8]);
  574.                     weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  575.                     if (rand() % 3 == 0) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTRIFLE");
  576.                     if (rand() % 3 == 1) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PUMPSHOTGUN");
  577.                     if (rand() % 3 == 2) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  578.                     STREAMING::REQUEST_MODEL(weapH);
  579.                     //if(rand() % 2 == 1) scPed[i] = PED::CREATE_PED(26, ennHi, spawnPt1.x, spawnPt1.y, spawnPt1.z, 16, false, true);
  580.                     //if(rand() % 2 == 0) scPed[i] = PED::CREATE_PED(26, ennHi, spawnPt2.x, spawnPt2.y, spawnPt2.z, 16, false, true);
  581.                     if (rand() % 2 == 0) {
  582.                         scVeh[i] = VEHICLE::CREATE_VEHICLE(vehHi, spawnPt1.x, spawnPt1.y, spawnPt1.z, ENTITY::GET_ENTITY_HEADING(playerPed), 0, true);
  583.                         if (rand() % 2 == 1) pimpMyRide(0, 8);
  584.                         VEHICLE::SET_VEHICLE_FORWARD_SPEED(scVeh[i], 10.0f);
  585.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], -1)) scPed[i] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, -1, false, false);
  586.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 0)) scPed[i + 1] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 0, false, false);
  587.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 1) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 2) scPed[i + 2] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 1, false, false);
  588.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 2) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 3 && rand() % 2 == 1) scPed[i + 3] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 2, false, false);
  589.                     }
  590.                     else {
  591.                         scVeh[i] = VEHICLE::CREATE_VEHICLE(vehHi, spawnPt2.x, spawnPt2.y, spawnPt2.z, ENTITY::GET_ENTITY_HEADING(playerPed), 0, true);
  592.                         if (rand() % 2 == 1) pimpMyRide(0, 8);
  593.                         VEHICLE::SET_VEHICLE_FORWARD_SPEED(scVeh[i], 10.0f);
  594.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], -1)) scPed[i] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, -1, false, false);
  595.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 0)) scPed[i + 1] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 0, false, false);
  596.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 1) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 2) scPed[i + 2] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 1, false, false);
  597.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 2) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 3 && rand() % 2 == 1) scPed[i + 3] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 2, false, false);
  598.                     }
  599.                     AI::TASK_VEHICLE_CHASE(scPed[i], playerPed);
  600.                     VEHICLE::SET_VEHICLE_FORWARD_SPEED(PED::GET_VEHICLE_PED_IS_IN(scPed[i], true), 7.0f);
  601.                     for (int a = 0; a < proStep; a++) {
  602.                         PED::SET_PED_ACCURACY(scPed[i + a], 40);
  603.                         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i + a], weapH, 100, false);
  604.                         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i + a], weapH, true);
  605.                         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i + a], 0x90c7da60);
  606.                         AI::TASK_COMBAT_PED(scPed[i + a], playerPed, 0, 0);
  607.                         UI::REMOVE_BLIP(&blips[i + a]);
  608.                         blips[i + a] = UI::ADD_BLIP_FOR_ENTITY(scPed[i + a]);
  609.                         mobDead++;
  610.                     }
  611.                 }
  612.  
  613.             }
  614.         }
  615.     }
  616.     if (finishedProtect && tick > 200) {
  617.         tick = 0;
  618.         for (int i = 7; i < 24; i += proStep)
  619.         {
  620.             set_spawn_points();
  621.             if ((!ENTITY::DOES_ENTITY_EXIST(scPed[i]) || ENTITY::IS_ENTITY_DEAD(scPed[i])) && rand() % 3 == 1) {
  622.                 if (!ENTITY::IS_ENTITY_AT_COORD(playerPed, spawnPt1.x, spawnPt1.y, spawnPt1.z, 35, 35, 35, 0, 1, 0) && !ENTITY::IS_ENTITY_AT_COORD(playerPed, spawnPt2.x, spawnPt2.y, spawnPt2.z, 35, 35, 35, 0, 1, 0)) {
  623.                     tick = 0;
  624.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  625.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[i]);
  626.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i + 2]);
  627.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i + 3]);
  628.                     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i + 1]);
  629.                     //ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[7]);
  630.                     //ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[8]);
  631.                     weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  632.                     if (rand() % 3 == 0) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTRIFLE");
  633.                     if (rand() % 3 == 1) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PUMPSHOTGUN");
  634.                     if (rand() % 3 == 2) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  635.                     STREAMING::REQUEST_MODEL(weapH);
  636.                     //if(rand() % 2 == 1) scPed[i] = PED::CREATE_PED(26, ennHi, spawnPt1.x, spawnPt1.y, spawnPt1.z, 16, false, true);
  637.                     //if(rand() % 2 == 0) scPed[i] = PED::CREATE_PED(26, ennHi, spawnPt2.x, spawnPt2.y, spawnPt2.z, 16, false, true);
  638.                     if (rand() % 2 == 0) {
  639.                         scVeh[i] = VEHICLE::CREATE_VEHICLE(vehHi, spawnPt1.x, spawnPt1.y, spawnPt1.z, ENTITY::GET_ENTITY_HEADING(playerPed), 0, true);
  640.                         if (rand() % 2 == 1) pimpMyRide(0, 8);
  641.                         VEHICLE::SET_VEHICLE_FORWARD_SPEED(scVeh[i], 10.0f);
  642.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], -1)) scPed[i] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, -1, false, false);
  643.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 0)) scPed[i + 1] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 0, false, false);
  644.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 1) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 2) scPed[i + 2] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 1, false, false);
  645.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 2) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 3 && rand() % 2 == 1) scPed[i + 3] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 2, false, false);
  646.                     }
  647.                     else {
  648.                         scVeh[i] = VEHICLE::CREATE_VEHICLE(vehHi, spawnPt2.x, spawnPt2.y, spawnPt2.z, ENTITY::GET_ENTITY_HEADING(playerPed), 0, true);
  649.                         if (rand() % 2 == 1) pimpMyRide(0, 8);
  650.                         VEHICLE::SET_VEHICLE_FORWARD_SPEED(scVeh[i], 10.0f);
  651.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], -1)) scPed[i] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, -1, false, false);
  652.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 0)) scPed[i + 1] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 0, false, false);
  653.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 1) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 2) scPed[i + 2] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 1, false, false);
  654.                         if (VEHICLE::IS_VEHICLE_SEAT_FREE(scVeh[i], 2) && VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(scVeh[i]) > 3 && rand() % 2 == 1) scPed[i + 3] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[i], 26, ennHi, 2, false, false);
  655.                     }
  656.                     AI::TASK_VEHICLE_CHASE(scPed[i], playerPed);
  657.                     VEHICLE::SET_VEHICLE_FORWARD_SPEED(PED::GET_VEHICLE_PED_IS_IN(scPed[i], true), 7.0f);
  658.                     for (int a = 0; a < proStep; a++) {
  659.                         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i + a], weapH, 100, false);
  660.                         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i + a], weapH, true);
  661.                         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i + a], 0x90c7da60);
  662.                         AI::TASK_COMBAT_PED(scPed[i + a], playerPed, 0, 0);
  663.                         UI::REMOVE_BLIP(&blips[i + a]);
  664.                         blips[i + a] = UI::ADD_BLIP_FOR_ENTITY(scPed[i + a]);
  665.                         mobDead++;
  666.                     }
  667.                 }
  668.  
  669.             }
  670.         }
  671.     }
  672.  
  673.  
  674. }
  675.  
  676. // SHITS ON FIRE YO.
  677. // RANDOM PIMPING, CAN BE COOL
  678. // CAN BE SHIT
  679. // CAN BE OK.
  680. void pimpMyRide(int type, int id)
  681. {
  682.     if (type == 0) {
  683.         VEHICLE::SET_VEHICLE_MOD_KIT(scVeh[id], 0);
  684.         VEHICLE::TOGGLE_VEHICLE_MOD(scVeh[id], 18, true);
  685.         VEHICLE::TOGGLE_VEHICLE_MOD(scVeh[id], 22, true);
  686.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 16, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 16) + 1), false);
  687.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 12, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 12) + 1), false);
  688.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 11, rand() % (3 - 1 + 1) + 1, false);
  689.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 14, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 14) + 1), false);
  690.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 15, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 15) + 1), false);
  691.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 13, 2, false);
  692.         if (id != 1) VEHICLE::SET_VEHICLE_WHEEL_TYPE(scVeh[id], 7);
  693.         VEHICLE::SET_VEHICLE_WINDOW_TINT(scVeh[id], rand() % 5);
  694.         if (id != 1) VEHICLE::SET_VEHICLE_MOD(scVeh[id], 23, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 23) + 1), true);
  695.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 0, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 0) + 1), false);
  696.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 1, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 1) + 1), false);
  697.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 2, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 2) + 1), false);
  698.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 3, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 3) + 1), false);
  699.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 4, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 4) + 1), false);
  700.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 5, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 5) + 1), false);
  701.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 6, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 6) + 1), false);
  702.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 7, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 7) + 1), false);
  703.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 8, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 8) + 1), false);
  704.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 9, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 9) + 1), false);
  705.         VEHICLE::SET_VEHICLE_MOD(scVeh[id], 10, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(scVeh[id], 10) + 1), false);
  706.     }
  707.     if (type == 1)
  708.     {
  709.         VEHICLE::SET_VEHICLE_MOD_KIT(borVeh, 0);
  710.         VEHICLE::TOGGLE_VEHICLE_MOD(borVeh, 18, true);
  711.         VEHICLE::TOGGLE_VEHICLE_MOD(borVeh, 22, true);
  712.         VEHICLE::SET_VEHICLE_MOD(borVeh, 16, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 16) + 1), false);
  713.         VEHICLE::SET_VEHICLE_MOD(borVeh, 12, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 12) + 1), false);
  714.         VEHICLE::SET_VEHICLE_MOD(borVeh, 11, rand() % (3 - 1 + 1) + 1, false);
  715.         VEHICLE::SET_VEHICLE_MOD(borVeh, 14, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 14) + 1), false);
  716.         VEHICLE::SET_VEHICLE_MOD(borVeh, 15, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 15) + 1), false);
  717.         VEHICLE::SET_VEHICLE_MOD(borVeh, 13, 2, false);
  718.         VEHICLE::SET_VEHICLE_WHEEL_TYPE(borVeh, rand() % 8);
  719.         VEHICLE::SET_VEHICLE_WINDOW_TINT(borVeh, rand() % 5);
  720.         VEHICLE::SET_VEHICLE_MOD(borVeh, 23, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 23) + 1), true);
  721.         VEHICLE::SET_VEHICLE_MOD(borVeh, 0, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 0) + 1), false);
  722.         VEHICLE::SET_VEHICLE_MOD(borVeh, 1, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 1) + 1), false);
  723.         VEHICLE::SET_VEHICLE_MOD(borVeh, 2, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 2) + 1), false);
  724.         VEHICLE::SET_VEHICLE_MOD(borVeh, 3, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 3) + 1), false);
  725.         VEHICLE::SET_VEHICLE_MOD(borVeh, 4, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 4) + 1), false);
  726.         VEHICLE::SET_VEHICLE_MOD(borVeh, 5, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 5) + 1), false);
  727.         VEHICLE::SET_VEHICLE_MOD(borVeh, 6, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 6) + 1), false);
  728.         VEHICLE::SET_VEHICLE_MOD(borVeh, 7, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 7) + 1), false);
  729.         VEHICLE::SET_VEHICLE_MOD(borVeh, 8, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 8) + 1), false);
  730.         VEHICLE::SET_VEHICLE_MOD(borVeh, 9, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 9) + 1), false);
  731.         VEHICLE::SET_VEHICLE_MOD(borVeh, 10, rand() % (VEHICLE::GET_NUM_VEHICLE_MODS(borVeh, 10) + 1), false);
  732.     }
  733. }
  734.  
  735. // SETUP PROTECTION MISSIONS
  736. void setup_protect()
  737. {
  738.     tick = 1000;
  739.     PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  740.     PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  741.     PLAYER::SET_MAX_WANTED_LEVEL(0);
  742.     mission = true;
  743.     DWORD vehH, pedH, ennH, rumH;
  744.  
  745.     // debug var
  746.     int debug_var = totalMission;
  747.  
  748.  
  749.     switch (rand() % 13){
  750.     case 0: rumH = GAMEPLAY::GET_HASH_KEY("gburrito2"); proStep = 4; break;
  751.     case 1: rumH = GAMEPLAY::GET_HASH_KEY("huntley"); proStep = 4; break;
  752.     case 2: rumH = GAMEPLAY::GET_HASH_KEY("alpha"); proStep = 2; break;
  753.     case 3: rumH = GAMEPLAY::GET_HASH_KEY("voodoo2"); proStep = 2; break;
  754.     case 4: rumH = GAMEPLAY::GET_HASH_KEY("sentinel"); proStep = 2; break;
  755.     case 5: rumH = GAMEPLAY::GET_HASH_KEY("phoenix"); proStep = 2; break;
  756.     case 6: rumH = GAMEPLAY::GET_HASH_KEY("habanero"); proStep = 4; break;
  757.     case 7: rumH = GAMEPLAY::GET_HASH_KEY("oracle"); proStep = 4; break;
  758.     case 8: rumH = GAMEPLAY::GET_HASH_KEY("oracle2"); proStep = 4; break;
  759.     case 9: rumH = GAMEPLAY::GET_HASH_KEY("stanier"); proStep = 4; break;
  760.     case 10: rumH = GAMEPLAY::GET_HASH_KEY("premier"); proStep = 4; break;
  761.     case 11: rumH = GAMEPLAY::GET_HASH_KEY("intruder"); proStep = 4; break;
  762.     case 12: rumH = GAMEPLAY::GET_HASH_KEY("manana"); proStep = 2; break;
  763.     }
  764.     vehHi = rumH;
  765.     int myRand = rand() % 15;
  766.     //int myRand = 0;
  767.     // TODO : ADD MORE PROTECTION MISSIONS
  768.     switch (myRand) {
  769.     case 0:
  770.         vehH = GAMEPLAY::GET_HASH_KEY("btype");
  771.         pedH = GAMEPLAY::GET_HASH_KEY("G_M_M_KorBoss_01");
  772.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_M_ArmGoon_01");
  773.         pedHi = pedH;
  774.         ennHi = ennH;
  775.         mobProtect.x = 331;
  776.         mobProtect.y = -209;
  777.         mobProtect.z = 55;
  778.         break;
  779.     case 1:
  780.         vehH = GAMEPLAY::GET_HASH_KEY("superd");
  781.         pedH = GAMEPLAY::GET_HASH_KEY("G_M_M_ArmBoss_01");
  782.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_M_ArmLieut_01");
  783.         pedHi = pedH;
  784.         ennHi = ennH;
  785.         mobProtect.x = 1180;
  786.         mobProtect.y = -1556;
  787.         mobProtect.z = 35;
  788.         break;
  789.     case 2:
  790.         vehH = GAMEPLAY::GET_HASH_KEY("stingergt");
  791.         pedH = GAMEPLAY::GET_HASH_KEY("G_M_M_MexBoss_01");
  792.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_Y_BallaOrig_01");
  793.         pedHi = pedH;
  794.         ennHi = ennH;
  795.         mobProtect.x = -548;
  796.         mobProtect.y = -1637;
  797.         mobProtect.z = 20;
  798.         break;
  799.     case 3:
  800.         vehH = GAMEPLAY::GET_HASH_KEY("ztype");
  801.         pedH = GAMEPLAY::GET_HASH_KEY("A_F_M_Business_02");
  802.         ennH = GAMEPLAY::GET_HASH_KEY("A_M_M_AfriAmer_01");
  803.         pedHi = pedH;
  804.         ennHi = ennH;
  805.         mobProtect.x = -609;
  806.         mobProtect.y = -1033;
  807.         mobProtect.z = 22;
  808.         break;
  809.     case 4:
  810.         vehH = GAMEPLAY::GET_HASH_KEY("hotknife");
  811.         pedH = GAMEPLAY::GET_HASH_KEY("A_F_Y_Vinewood_01");
  812.         ennH = GAMEPLAY::GET_HASH_KEY("A_M_Y_MexThug_01");
  813.         pedHi = pedH;
  814.         ennHi = ennH;
  815.         mobProtect.x = -766;
  816.         mobProtect.y = -414;
  817.         mobProtect.z = 36;
  818.         break;
  819.     case 5:
  820.         vehH = GAMEPLAY::GET_HASH_KEY("infernus");
  821.         pedH = GAMEPLAY::GET_HASH_KEY("A_M_M_Malibu_01");
  822.         ennH = GAMEPLAY::GET_HASH_KEY("U_M_M_BikeHire_01");
  823.         pedHi = pedH;
  824.         ennHi = ennH;
  825.         mobProtect.x = -690;
  826.         mobProtect.y = 41;
  827.         mobProtect.z = 42;
  828.         break;
  829.     case 6:
  830.         vehH = GAMEPLAY::GET_HASH_KEY("adder");
  831.         pedH = GAMEPLAY::GET_HASH_KEY("A_F_M_BevHills_01");
  832.         ennH = GAMEPLAY::GET_HASH_KEY("A_M_M_SouCent_01");
  833.         pedHi = pedH;
  834.         ennHi = ennH;
  835.         mobProtect.x = -589;
  836.         mobProtect.y = -755;
  837.         mobProtect.z = 29;
  838.         break;
  839.     case 7:
  840.         vehH = GAMEPLAY::GET_HASH_KEY("buffalo");
  841.         pedH = GAMEPLAY::GET_HASH_KEY("A_F_M_BevHills_01");
  842.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_Y_Azteca_01");
  843.         pedHi = pedH;
  844.         ennHi = ennH;
  845.         mobProtect.x = 1377;
  846.         mobProtect.y = -738;
  847.         mobProtect.z = 68;
  848.         break;
  849.     case 8:
  850.         vehH = GAMEPLAY::GET_HASH_KEY("gauntlet");
  851.         pedH = GAMEPLAY::GET_HASH_KEY("A_M_Y_Runner_01");
  852.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_Y_Azteca_01");
  853.         pedHi = pedH;
  854.         ennHi = ennH;
  855.         mobProtect.x = 958;
  856.         mobProtect.y = 969;
  857.         mobProtect.z = 227;
  858.         break;
  859.     case 9:
  860.         vehH = GAMEPLAY::GET_HASH_KEY("ruiner");
  861.         pedH = GAMEPLAY::GET_HASH_KEY("A_M_Y_Hippy_01");
  862.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_Y_Lost_01");
  863.         pedHi = pedH;
  864.         ennHi = ennH;
  865.         mobProtect.x = -694;
  866.         mobProtect.y = -2193;
  867.         mobProtect.z = 6;
  868.         break;
  869.     case 10:
  870.         vehH = GAMEPLAY::GET_HASH_KEY("dukes");
  871.         pedH = GAMEPLAY::GET_HASH_KEY("S_F_Y_Shop_MID");
  872.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_Y_Lost_01");
  873.         pedHi = pedH;
  874.         ennHi = ennH;
  875.         mobProtect.x = -94;
  876.         mobProtect.y = -1581;
  877.         mobProtect.z = 32;
  878.         break;
  879.     case 11:
  880.         vehH = GAMEPLAY::GET_HASH_KEY("peyote");
  881.         pedH = GAMEPLAY::GET_HASH_KEY("S_F_Y_SweatShop_01");
  882.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_M_ArmGoon_01");
  883.         pedHi = pedH;
  884.         ennHi = ennH;
  885.         mobProtect.x = 540;
  886.         mobProtect.y = -138;
  887.         mobProtect.z = 60;
  888.         break;
  889.     case 12:
  890.         vehH = GAMEPLAY::GET_HASH_KEY("fusilade");
  891.         pedH = GAMEPLAY::GET_HASH_KEY("A_F_M_BevHills_01");
  892.         ennH = GAMEPLAY::GET_HASH_KEY("A_M_M_SouCent_01");
  893.         pedHi = pedH;
  894.         ennHi = ennH;
  895.         mobProtect.x = -128.4;
  896.         mobProtect.y = -1438.4;
  897.         mobProtect.z = 34;
  898.         break;
  899.     case 13:
  900.         vehH = GAMEPLAY::GET_HASH_KEY("voltic");
  901.         pedH = GAMEPLAY::GET_HASH_KEY("A_F_Y_Vinewood_01");
  902.         ennH = GAMEPLAY::GET_HASH_KEY("A_M_Y_MexThug_01");
  903.         pedHi = pedH;
  904.         ennHi = ennH;
  905.         mobProtect.x = 901;
  906.         mobProtect.y = -1023;
  907.         mobProtect.z = 35;
  908.         break;
  909.     case 14:
  910.         vehH = GAMEPLAY::GET_HASH_KEY("dubsta3");
  911.         pedH = GAMEPLAY::GET_HASH_KEY("S_F_Y_SweatShop_01");
  912.         ennH = GAMEPLAY::GET_HASH_KEY("G_M_Y_Azteca_01");
  913.         pedHi = pedH;
  914.         ennHi = ennH;
  915.         mobProtect.x = 364.318;
  916.         mobProtect.y = -1666;
  917.         mobProtect.z = 32.6;
  918.         break;
  919.     }
  920.  
  921.     cancelMsg();
  922.     blips[1] = UI::ADD_BLIP_FOR_COORD(mobProtect.x, mobProtect.y, mobProtect.z);
  923.     UI::SET_BLIP_COLOUR(blips[1], 3);
  924.     UI::SET_BLIP_ROUTE(blips[1], true);
  925.  
  926.     STREAMING::REQUEST_MODEL(vehH);
  927.     STREAMING::REQUEST_MODEL(pedH);
  928.     STREAMING::REQUEST_MODEL(rumH);
  929.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH) || !STREAMING::HAS_MODEL_LOADED(rumH))
  930.         WAIT(100);
  931.  
  932.     scVeh[6] = VEHICLE::CREATE_VEHICLE(vehH, mobProtect.x, mobProtect.y, mobProtect.z, 180.0f, 0, true);
  933.     blips[4] = UI::ADD_BLIP_FOR_ENTITY(scVeh[6]);
  934.     UI::SET_BLIP_SPRITE(blips[4], 225);
  935.     UI::SET_BLIP_COLOUR(blips[4], 3);
  936.     scPed[6] = PED::CREATE_PED(26, pedH, mobProtect.x + 2.0f, mobProtect.y, mobProtect.z, 16, false, true);
  937.     scVeh[7] = VEHICLE::CREATE_VEHICLE(rumH, spawnPt1.x, spawnPt1.y, spawnPt1.z, 180.0f, 0, true);
  938.     scVeh[8] = VEHICLE::CREATE_VEHICLE(rumH, spawnPt2.x, spawnPt2.y, spawnPt2.z, 180.0f, 0, true);
  939.     //ENTITY::SET_ENTITY_INVINCIBLE(scVeh[7], true);
  940.     //ENTITY::SET_ENTITY_INVINCIBLE(scVeh[8], true);
  941.     VEHICLE::SET_VEHICLE_DOOR_OPEN(scVeh[7], 2, false, false);
  942.     VEHICLE::SET_VEHICLE_DOOR_OPEN(scVeh[7], 3, false, false);
  943.     VEHICLE::SET_VEHICLE_DOOR_OPEN(scVeh[8], 2, false, false);
  944.     VEHICLE::SET_VEHICLE_DOOR_OPEN(scVeh[8], 3, false, false);
  945.     WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[6], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), 1000, false);
  946.     ENTITY::SET_ENTITY_HEALTH(scPed[6], 200);
  947.     PED::SET_PED_CAN_RAGDOLL(scPed[6], false);
  948.     // like group
  949.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da61);
  950.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, 0x90c7da61, GAMEPLAY::GET_HASH_KEY("player"));
  951.     // hate group
  952.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  953.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  954.     PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[6], 0x90c7da61);
  955.     blips[6] = UI::ADD_BLIP_FOR_ENTITY(scPed[6]);
  956.     UI::SET_BLIP_COLOUR(blips[6], 3);
  957.  
  958.     // pimp it
  959.     pimpMyRide(0, 6);
  960.  
  961.     //CANCEL
  962.     canCancel = true;
  963.  
  964. }
  965.  
  966. void setup_mobClean()
  967. {
  968.     PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  969.     PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  970.     PLAYER::SET_MAX_WANTED_LEVEL(0);
  971.     cancelMsg();
  972.     mission = true;
  973.     //char * guy[4] = { "G_M_Y_MexGoon_01", "G_M_M_ChiGoon_01", "G_M_Y_BallaEast_01", "G_M_Y_Lost_01" };
  974.     random = rand() % 3;
  975.     if (random == 0) mobClean1();
  976.     if (random == 1) mobClean2();
  977.     if (random == 2) mobClean3();
  978.     UI::SET_BLIP_ROUTE(blips[1], true);
  979.  
  980.     //CANCEL
  981.     canCancel = true;
  982.  
  983.  
  984. }
  985.  
  986.  
  987. void cleanupBlips()
  988. {
  989.     for (int i = 7; i < 32; i++)
  990.     {
  991.         if (ENTITY::IS_ENTITY_DEAD(scPed[i])) {
  992.             UI::REMOVE_BLIP(&blips[i]);
  993.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  994.         }
  995.     }
  996. }
  997.  
  998. // STOPS THE MUSIC.
  999. void stopMusic()
  1000. {
  1001.     AUDIO::REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\RAMPAGE_01", 0);
  1002.     AUDIO::REQUEST_SCRIPT_AUDIO_BANK("SCRIPT\RAMPAGE_02", 0);
  1003.     AUDIO::START_AUDIO_SCENE("RAMPAGE_REDNECKS_SCENE");
  1004.     AUDIO::PREPARE_MUSIC_EVENT("RAMPAGE_STOP");
  1005.     AUDIO::TRIGGER_MUSIC_EVENT("RAMPAGE_STOP");
  1006. }
  1007.  
  1008. // MAIN CLEANING FUNCTIONS.
  1009. // RESETS EVERYTHING THAT WAS SPAWNED, REMOVE BLIPS.
  1010. // RESET RELATIONS.
  1011. void cleanupMissions(int type)
  1012. {
  1013.     // type 0 = mission complete
  1014.     // type 1 = mission canceled
  1015.     //GAMEPLAY::SET_MISSION_FLAG(0);
  1016.     //GAMEPLAY::SET_SAVE_MENU_ACTIVE(true);
  1017.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, GAMEPLAY::GET_HASH_KEY("player"), 0x783e3868);
  1018.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, 0x783e3868, GAMEPLAY::GET_HASH_KEY("player"));
  1019.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, 0x90c7da60, 0x783e3868);
  1020.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, 0x783e3868, 0x90c7da60);
  1021.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  1022.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(255, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  1023.     mission = false;
  1024.     canCancel = false;
  1025.     stopMusic();
  1026.     AUDIO::RELEASE_MISSION_AUDIO_BANK();
  1027.     AUDIO::RELEASE_SCRIPT_AUDIO_BANK();
  1028.     mobDead = 0;
  1029.     PLAYER::SET_MAX_WANTED_LEVEL(5);
  1030.     for (int i = 32; i < 32; i++){
  1031.         wasKilled[i] = false;
  1032.     }
  1033.     PED::RESET_AI_WEAPON_DAMAGE_MODIFIER();
  1034.     joinedClean = false;
  1035.     joinedProtect = false;
  1036.     sentMen = false;
  1037.     finishedProtect = false;
  1038.     isDrivingAway = false;
  1039.  
  1040.     for (int i = 0; i < 64; i++)
  1041.     {
  1042.         Any dVeh = PED::GET_VEHICLE_PED_IS_IN(scPed[i], true);
  1043.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&dVeh);
  1044.     }
  1045.  
  1046.     if (type == 0)
  1047.     {
  1048.         AUDIO::PLAY_SOUND_FRONTEND(-1, "PROPERTY_PURCHASE", "HUD_AWARDS", 1);
  1049.         selectedType = 0;
  1050.         for (int i = 0; i < 64; i++)
  1051.         {
  1052.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[i]);
  1053.             UI::REMOVE_BLIP(&blips[i]);
  1054.         }
  1055.         for (int i = 6; i < 64; i++)
  1056.         {
  1057.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  1058.             UI::SET_BLIP_ROUTE(blips[i], false);
  1059.         }
  1060.         std::string pay;
  1061.         setTextMsg(500, "~g~Mission complete~w~");
  1062.         pay = "Great job! Come back at the ~r~RedHouse~w~, The ~g~$";
  1063.         pay += std::to_string((contractPayout[uiSelected] / 1000)) + ",000~w~ are in the garage.";
  1064.         setTextMsg(2000, (char*)pay.c_str());
  1065.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1066.         setupPayout();
  1067.     }
  1068.     if (type == 1)
  1069.     {
  1070.        
  1071.         AUDIO::PLAY_SOUND_FRONTEND(-1, "1st_Person_Transition", "PLAYER_SWITCH_CUSTOM_SOUNDSET", 1);
  1072.         selectedType = 0;
  1073.         contractPayout[0] = contractPayout[1] = contractPayout[2] = 0;
  1074.         for (int i = 0; i < 64; i++)
  1075.         {
  1076.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[i]);
  1077.         }
  1078.         for (int i = 0; i < 64; i++)
  1079.         {
  1080.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  1081.             UI::SET_BLIP_ROUTE(blips[i], false);
  1082.             UI::REMOVE_BLIP(&blips[i]);
  1083.         }
  1084.     }
  1085. }
  1086.  
  1087. // DISPLAYS OBJECTIVE.
  1088. // CALLED ONCE PER FRAME.
  1089. void message(char * text)
  1090. {
  1091.     UI::SET_TEXT_FONT(0);
  1092.     UI::SET_TEXT_SCALE(0.4f, 0.4f);
  1093.     UI::SET_TEXT_COLOUR(255, 255, 255, 255);
  1094.     UI::SET_TEXT_WRAP(0.0, 1.0);
  1095.     UI::SET_TEXT_CENTRE(true);
  1096.     UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);
  1097.     UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  1098.     UI::_SET_TEXT_ENTRY("STRING");
  1099.     UI::_ADD_TEXT_COMPONENT_STRING(text);
  1100.     UI::_DRAW_TEXT(0.5, 0.95);
  1101. }
  1102.  
  1103. void setup_Assassination(){
  1104.     callBack = 0;
  1105.     cancelMsg();
  1106.     mission = true;
  1107.     setupSpawnPts(1);
  1108.     setupCars(1);
  1109.  
  1110.     char * guy[5] = { "A_M_M_Business_01", "A_M_Y_BevHills_02", "A_M_Y_Golfer_01", "A_M_Y_Gay_02", "A_M_Y_Polynesian_01" };
  1111.     random = rand() % 5;
  1112.     int spawnR = rand() % 10;
  1113.  
  1114.     bool targetAlive = true;
  1115.     DWORD vehH, pedH;
  1116.     vehH = GAMEPLAY::GET_HASH_KEY(cars[random]);
  1117.     pedH = GAMEPLAY::GET_HASH_KEY(guy[random]);
  1118.  
  1119.     STREAMING::REQUEST_MODEL(vehH);
  1120.     STREAMING::REQUEST_MODEL(pedH);
  1121.     WAIT(1000);
  1122.  
  1123.     scVeh[6] = VEHICLE::CREATE_VEHICLE(vehH, assMission[spawnR].x, assMission[spawnR].y, assMission[spawnR].z, 180.0f, 0, true);
  1124.     scPed[6] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, -1, false, false);
  1125.     scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[6], 3, pedH, 0, false, false);
  1126.     ENTITY::SET_ENTITY_HEALTH(scPed[6], 900);
  1127.     WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[6], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), 1000, false);
  1128.     WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[7], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), 1000, false);
  1129.     PED::SET_PED_ACCURACY(scPed[6], 95);
  1130.  
  1131.     blips[6] = UI::ADD_BLIP_FOR_ENTITY(scPed[6]);
  1132.     //ON-FOOT ASSASSINATION
  1133.     if (rand() % 2 == 0){ AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[6], scVeh[6], 490, -3359, 6.5, 50, 1, ENTITY::GET_ENTITY_MODEL(scVeh[6]), 1, 5.0, -1); }
  1134.     else {
  1135.         AI::TASK_WANDER_STANDARD(scPed[6], 0x471c4000, 0);
  1136.         AI::TASK_VEHICLE_CHASE(scPed[7], playerPed);
  1137.     }
  1138.     PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[6], GAMEPLAY::GET_HASH_KEY("ENEMIES"));
  1139.     PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[7], GAMEPLAY::GET_HASH_KEY("ENEMIES"));
  1140.     PED::SET_PED_SEEING_RANGE(scPed[6], 150.0f);
  1141.  
  1142.  
  1143.     // CANCEL
  1144.     canCancel = true;
  1145.  
  1146. }
  1147.  
  1148. void menu(bool active, int type)
  1149. {
  1150.     if (active)
  1151.     {
  1152.  
  1153.         // TYPE ::
  1154.         // 0 : RECRUIT
  1155.         // 1 : ASSASSINATION
  1156.         // 2 : DRUG LORD TAKEDOWN
  1157.         // 3 : MOB CLEANING
  1158.  
  1159.         if (type == 0)
  1160.         {
  1161.             gxt = "INPUT_FRONTEND_RIGHT";
  1162.             setTextMsg(1000, "Press ~INPUT_CONTEXT~ or [K] for an Exemplar crew (~g~3 men~w~).~n~Price : ~g~$25,000");
  1163.             setTextMsg(1000, "Press ~INPUT_CONTEXT_SECONDARY~ or [L] for an Bison crew (~g~5 men~w~).~n~Price : ~g~$90,000");
  1164.             setTextMsg(1000, "Press LS or [J] for an ~y~elite~w~ crew (~g~3 ~y~elite~g~ men~w~).~n~Price : ~g~$40,000");
  1165.         }
  1166.     }
  1167. }
  1168.  
  1169. // HIRED PROTECTION.
  1170. void setAssassinBackup()
  1171. {
  1172.     DWORD vehH, pedH;
  1173.     vehH = GAMEPLAY::GET_HASH_KEY(cars[random]);
  1174.     pedH = GAMEPLAY::GET_HASH_KEY("G_M_Y_MexGoon_01");
  1175.  
  1176.     STREAMING::REQUEST_MODEL(vehH);
  1177.     STREAMING::REQUEST_MODEL(pedH);
  1178.  
  1179.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH))
  1180.         WAIT(100);
  1181.     set_spawn_points();
  1182.     scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, spawnPt1.x, spawnPt1.y, spawnPt1.z, 180.0f, 0, true);
  1183.     scVeh[8] = VEHICLE::CREATE_VEHICLE(vehH, spawnPt2.x, spawnPt2.y, spawnPt2.z, 180.0f, 0, true);
  1184.     //scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, position.x, position.y, position.z, 180.0f, 0, true);
  1185.     //scVeh[8] = VEHICLE::CREATE_VEHICLE(vehH, position.x, position.y, position.z, 180.0f, 0, true);
  1186.     scPed[8] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 18, pedH, -1, false, false);
  1187.     scPed[9] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 18, pedH, 0, false, false);
  1188.     scPed[10] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 18, pedH, 1, false, false);
  1189.     scPed[11] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 18, pedH, 2, false, false);
  1190.     scPed[12] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 18, pedH, -1, false, false);
  1191.     scPed[13] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 18, pedH, 0, false, false);
  1192.     scPed[14] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 18, pedH, 1, false, false);
  1193.     scPed[15] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 18, pedH, 2, false, false);
  1194.  
  1195.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  1196.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  1197.  
  1198.     for (int i = 7; i < 16; i++)
  1199.     {
  1200.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), 1000, false);
  1201.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i], 0x90c7da60);
  1202.         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), true);
  1203.     }
  1204.  
  1205.  
  1206.     AI::TASK_VEHICLE_CHASE(scPed[8], playerPed);
  1207.     AI::TASK_VEHICLE_CHASE(scPed[10], playerPed);
  1208. }
  1209.  
  1210. void setMobCleanBackup()
  1211. {
  1212.     setTextMsg(1000, "Oh shit! The Feds are gonna show up in no time, clean the place and get out quick!");
  1213.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1214.     DWORD vehH, pedH;
  1215.     vehH = GAMEPLAY::GET_HASH_KEY("police4");
  1216.     pedH = GAMEPLAY::GET_HASH_KEY("S_M_M_CIASec_01");
  1217.  
  1218.     STREAMING::REQUEST_MODEL(vehH);
  1219.     STREAMING::REQUEST_MODEL(pedH);
  1220.  
  1221.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH))
  1222.         WAIT(100);
  1223.     set_spawn_points();
  1224.  
  1225.     scVeh[9] = VEHICLE::CREATE_VEHICLE(vehH, spawnPt1.x, spawnPt1.y, spawnPt1.z, 180.0f, 0, true);
  1226.     scVeh[10] = VEHICLE::CREATE_VEHICLE(vehH, spawnPt2.x, spawnPt2.y, spawnPt2.z, 180.0f, 0, true);
  1227.     scPed[17] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[9], 18, pedH, -1, false, false);
  1228.     scPed[18] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[9], 18, pedH, 0, false, false);
  1229.     scPed[19] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[9], 18, pedH, 1, false, false);
  1230.     scPed[20] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[9], 18, pedH, 2, false, false);
  1231.     scPed[21] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[10], 18, pedH, -1, false, false);
  1232.     scPed[22] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[10], 18, pedH, 0, false, false);
  1233.     scPed[23] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[10], 18, pedH, 1, false, false);
  1234.     scPed[24] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[10], 18, pedH, 2, false, false);
  1235.  
  1236.     VEHICLE::SET_VEHICLE_SIREN(scVeh[9], true);
  1237.     VEHICLE::SET_VEHICLE_SIREN(scVeh[10], true);
  1238.  
  1239.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da61);
  1240.     PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da61, GAMEPLAY::GET_HASH_KEY("player"));
  1241.  
  1242.     for (int i = 17; i < 25; i++)
  1243.     {
  1244.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), 1000, false);
  1245.         PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i], 0x90c7da60);
  1246.         WEAPON::SET_CURRENT_PED_WEAPON(scPed[i], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), true);
  1247.     }
  1248.  
  1249.  
  1250.     AI::TASK_VEHICLE_CHASE(scPed[17], scPed[6]);
  1251.     AI::TASK_VEHICLE_CHASE(scPed[21], scPed[6]);
  1252.  
  1253. }
  1254.  
  1255. void recruit(int type)
  1256. {
  1257.     // types ::
  1258.     // 0 EXEMPLAR CREW
  1259.     // 1 BISON CREW
  1260.     // 2 ELITE CREW
  1261.     int pId;
  1262.     if (ENTITY::GET_ENTITY_MODEL(playerPed) == GAMEPLAY::GET_HASH_KEY("Player_Zero")) pId = 0;
  1263.     if (ENTITY::GET_ENTITY_MODEL(playerPed) == GAMEPLAY::GET_HASH_KEY("Player_One")) pId = 1;
  1264.     if (ENTITY::GET_ENTITY_MODEL(playerPed) == GAMEPLAY::GET_HASH_KEY("Player_Two")) pId = 2;
  1265.  
  1266.     // EXEMPLAR + 3 CREW GUY
  1267.     if (type == 0)
  1268.     {
  1269.         int val;
  1270.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&borVeh);
  1271.         DWORD exemp = GAMEPLAY::GET_HASH_KEY("exemplar");
  1272.         DWORD gang1 = GAMEPLAY::GET_HASH_KEY("g_m_y_korean_01");
  1273.         STREAMING::REQUEST_MODEL(exemp);
  1274.         STREAMING::REQUEST_MODEL(gang1);
  1275.         WAIT(1000);
  1276.         for (int i = 0; i < 5; i++)
  1277.         {
  1278.             WEAPON::REMOVE_ALL_PED_WEAPONS(bodyG[i], true);
  1279.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&bodyG[i]);
  1280.         }
  1281.  
  1282.         // REMOVE 25000$
  1283.         bool can = false;
  1284.         char statNameFull[32];
  1285.         sprintf_s(statNameFull, "SP%d_TOTAL_CASH", pId);
  1286.         Hash hash = GAMEPLAY::GET_HASH_KEY(statNameFull);
  1287.         STATS::STAT_GET_INT(hash, &val, -1);
  1288.         if (val > 25000) {
  1289.             can = true;
  1290.             val -= 25000;
  1291.             STATS::STAT_SET_INT(hash, val, 1);
  1292.         }
  1293.         else { setTextMsg(500, "You don't have enough cash."); }
  1294.         if (can) {
  1295.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&payVeh);
  1296.             borVeh = VEHICLE::CREATE_VEHICLE(exemp, 135.3, -1050.86, 29.3, 159.6, 0, true);
  1297.             VEHICLE::TOGGLE_VEHICLE_MOD(borVeh, 18, true);
  1298.             VEHICLE::TOGGLE_VEHICLE_MOD(borVeh, 22, true);
  1299.             VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(borVeh, false);
  1300.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&borVeh);
  1301.  
  1302.             // CREW
  1303.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"));
  1304.             PED::SET_PED_AS_GROUP_LEADER(playerPed, PLAYER::GET_PLAYER_GROUP(player));
  1305.             for (int i = 0; i < 3; i++)
  1306.             {
  1307.                 bodyG[i] = PED::CREATE_PED(26, gang1, 150, -1054, 29.2, 160, false, true);
  1308.                 WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"), 1000, false);
  1309.                 WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG"), 1000, false);
  1310.                 PED::SET_PED_RELATIONSHIP_GROUP_HASH(bodyG[i], GAMEPLAY::GET_HASH_KEY("player"));
  1311.                 PED::SET_PED_AS_GROUP_MEMBER(bodyG[i], PLAYER::GET_PLAYER_GROUP(player));
  1312.                 PED::SET_PED_CAN_RAGDOLL(bodyG[i], false);
  1313.                 PED::SET_PED_SHOOT_RATE(bodyG[i], 8000);
  1314.                 ENTITY::SET_ENTITY_HEALTH(bodyG[i], 250);
  1315.                 WEAPON::SET_CURRENT_PED_WEAPON(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"), true);
  1316.             }
  1317.             setTextMsg(1000, "Your Crew joined, the Exemplar is available in the garage.");
  1318.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1319.  
  1320.         }
  1321.         else { setTextMsg(500, "You don't have enough cash."); }
  1322.  
  1323.  
  1324.     }
  1325.     // BISON + 5 GUYS (AP PISTOLS + SNIPER + M4 + MG)
  1326.     if (type == 1)
  1327.     {
  1328.         int val;
  1329.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&borVeh);
  1330.         DWORD exemp = GAMEPLAY::GET_HASH_KEY("bison");
  1331.         DWORD gang1 = GAMEPLAY::GET_HASH_KEY("g_m_y_korean_01");
  1332.         STREAMING::REQUEST_MODEL(exemp);
  1333.         STREAMING::REQUEST_MODEL(gang1);
  1334.         WAIT(1000);
  1335.         for (int i = 0; i < 5; i++)
  1336.         {
  1337.             WEAPON::REMOVE_ALL_PED_WEAPONS(bodyG[i], true);
  1338.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&bodyG[i]);
  1339.         }
  1340.  
  1341.         // REMOVE 50000$
  1342.         bool can = false;
  1343.         char statNameFull[32];
  1344.         sprintf_s(statNameFull, "SP%d_TOTAL_CASH", pId);
  1345.         Hash hash = GAMEPLAY::GET_HASH_KEY(statNameFull);
  1346.         STATS::STAT_GET_INT(hash, &val, -1);
  1347.         if (val > 90000) {
  1348.             can = true;
  1349.             val -= 90000;
  1350.             STATS::STAT_SET_INT(hash, val, 1);
  1351.         }
  1352.         else { setTextMsg(500, "You don't have enough cash."); }
  1353.         if (can) {
  1354.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&payVeh);
  1355.             borVeh = VEHICLE::CREATE_VEHICLE(exemp, 135.3, -1050.86, 29.3, 159.6, 0, true);
  1356.             VEHICLE::TOGGLE_VEHICLE_MOD(borVeh, 18, true);
  1357.             VEHICLE::TOGGLE_VEHICLE_MOD(borVeh, 22, true);
  1358.             VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(borVeh, false);
  1359.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&borVeh);
  1360.  
  1361.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"));
  1362.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_APPISTOL"));
  1363.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_COMBATMG"));
  1364.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTSHOTGUN"));
  1365.             PED::SET_PED_AS_GROUP_LEADER(playerPed, PLAYER::GET_PLAYER_GROUP(player));
  1366.             for (int i = 0; i < 5; i++)
  1367.             {
  1368.                 bodyG[i] = PED::CREATE_PED(26, gang1, 150, -1054, 29.2, 160, false, true);
  1369.                 if (i < 3) WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"), 1000, false);
  1370.                 if (i > 2) WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_COMBATMG"), 1000, false);
  1371.                 if (i == 4)WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTSHOTGUN"), 1000, false);
  1372.                 WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_APPISTOL"), 1000, false);
  1373.                 PED::SET_PED_RELATIONSHIP_GROUP_HASH(bodyG[i], GAMEPLAY::GET_HASH_KEY("player"));
  1374.                 PED::SET_PED_AS_GROUP_MEMBER(bodyG[i], PLAYER::GET_PLAYER_GROUP(player));
  1375.                 PED::SET_PED_CAN_RAGDOLL(bodyG[i], false);
  1376.                 PED::SET_PED_SHOOT_RATE(bodyG[i], 8000);
  1377.                 ENTITY::SET_ENTITY_HEALTH(bodyG[i], 250);
  1378.                 WEAPON::SET_CURRENT_PED_WEAPON(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"), true);
  1379.             }
  1380.             PED::SET_GROUP_FORMATION(PLAYER::GET_PLAYER_GROUP(player), 3);
  1381.             setTextMsg(1000, "Your Tactical Crew joined, the Bison is available in the garage.");
  1382.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1383.  
  1384.         }
  1385.         else { setTextMsg(500, "You don't have enough cash."); }
  1386.  
  1387.     }
  1388.     if (type == 2)
  1389.     {
  1390.         int val;
  1391.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&borVeh);
  1392.         DWORD exemp;
  1393.         exemp = GAMEPLAY::GET_HASH_KEY("oracle2");
  1394.         if (rand() % 3 == 0)    exemp = GAMEPLAY::GET_HASH_KEY("oracle");
  1395.         if (rand() % 3 == 1) exemp = GAMEPLAY::GET_HASH_KEY("sultan");
  1396.         DWORD gang1 = GAMEPLAY::GET_HASH_KEY("G_M_Y_KorLieut_01");
  1397.         STREAMING::REQUEST_MODEL(exemp);
  1398.         STREAMING::REQUEST_MODEL(gang1);
  1399.         WAIT(1000);
  1400.         for (int i = 0; i < 5; i++)
  1401.         {
  1402.             WEAPON::REMOVE_ALL_PED_WEAPONS(bodyG[i], true);
  1403.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&bodyG[i]);
  1404.         }
  1405.  
  1406.         // REMOVE 40000$
  1407.         bool can = false;
  1408.         char statNameFull[32];
  1409.         sprintf_s(statNameFull, "SP%d_TOTAL_CASH", pId);
  1410.         Hash hash = GAMEPLAY::GET_HASH_KEY(statNameFull);
  1411.         STATS::STAT_GET_INT(hash, &val, -1);
  1412.         if (val > 40000) {
  1413.             can = true;
  1414.             val -= 40000;
  1415.             STATS::STAT_SET_INT(hash, val, 1);
  1416.         }
  1417.         else { setTextMsg(500, "You don't have enough cash."); }
  1418.         if (can) {
  1419.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&payVeh);
  1420.             borVeh = VEHICLE::CREATE_VEHICLE(exemp, 135.3, -1050.86, 29.3, 159.6, 0, true);
  1421.             pimpMyRide(1, 0);
  1422.             VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(borVeh, false);
  1423.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&borVeh);
  1424.  
  1425.             // CREW
  1426.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_SMG"));
  1427.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_ASSAULTSHOTGUN"));
  1428.             STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("WEAPON_GUSENBERG"));
  1429.             WAIT(1000);
  1430.             PED::SET_PED_AS_GROUP_LEADER(playerPed, PLAYER::GET_PLAYER_GROUP(player));
  1431.             for (int i = 0; i < 3; i++)
  1432.             {
  1433.                 bodyG[i] = PED::CREATE_PED(26, gang1, 150, -1054, 29.2, 160, false, true);
  1434.                 /*if (i == 0) { WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_SMG"), 1000, false); WEAPON::SET_AMMO_IN_CLIP(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_SMG"), 120); }
  1435.                 if (i == 1){ WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_MG"), 1000, false); WEAPON::SET_AMMO_IN_CLIP(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_MG"), 1500); }
  1436.                 if (i == 2){ WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_GUSENBERG"), 1000, false); WEAPON::SET_AMMO_IN_CLIP(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_GUSENBERG"), 500); }*/
  1437.                 // FULL SMG
  1438.                 DWORD weap = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  1439.                 WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], weap, 100, false);
  1440.                 WAIT(110);
  1441.                 WEAPON::SET_AMMO_IN_CLIP(bodyG[i], weap, 1000);
  1442.                 WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(bodyG[i], weap, GAMEPLAY::GET_HASH_KEY("COMPONENT_AT_PI_FLSH"));
  1443.                 if(rand() % 2 == 0) WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(bodyG[i], weap, GAMEPLAY::GET_HASH_KEY("COMPONENT_AT_AR_SUPP_02"));
  1444.                 WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(bodyG[i], weap, GAMEPLAY::GET_HASH_KEY("COMPONENT_AT_SCOPE_MACRO"));
  1445.                 WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(bodyG[i], weap, GAMEPLAY::GET_HASH_KEY("COMPONENT_MICROSMG_CLIP_02"));
  1446.                 WEAPON::SET_PED_WEAPON_TINT_INDEX(bodyG[i], weap, 6);
  1447.                 WEAPON::SET_CURRENT_PED_WEAPON(bodyG[i], weap, true);
  1448.                 // FULL SMG END
  1449.                 WEAPON::GIVE_DELAYED_WEAPON_TO_PED(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_APPISTOL"), 1000, false);
  1450.                 PED::SET_PED_RELATIONSHIP_GROUP_HASH(bodyG[i], GAMEPLAY::GET_HASH_KEY("player"));
  1451.                 PED::SET_PED_AS_GROUP_MEMBER(bodyG[i], PLAYER::GET_PLAYER_GROUP(player));
  1452.                 PED::SET_PED_CAN_RAGDOLL(bodyG[i], false);
  1453.                 PED::SET_PED_SHOOT_RATE(bodyG[i], 60000);
  1454.                 PED::SET_PED_ACCURACY(bodyG[i], 80);
  1455.                 ENTITY::SET_ENTITY_HEALTH(bodyG[i], 750);
  1456.                 PED::SET_PED_GROUP_MEMBER_PASSENGER_INDEX(bodyG[i], i);
  1457.                 PED::SET_PED_COMBAT_ABILITY(bodyG[i], 2);
  1458.                 PED::SET_PED_COMBAT_RANGE(bodyG[i], 2);
  1459.                 PED::SET_PED_FIRING_PATTERN(bodyG[i], 0xC6EE6B4C);
  1460.                 PED::SET_PED_SUFFERS_CRITICAL_HITS(bodyG[i], false);
  1461.                 PED::SET_PED_MONEY(bodyG[i], 7500);
  1462.                 PED::GIVE_PED_HELMET(bodyG[i], 1, 4096, -1);
  1463.                 PED::SET_PED_SEEING_RANGE(bodyG[i], 500);
  1464.                 //WEAPON::SET_CURRENT_PED_WEAPON(bodyG[i], GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE"), true);
  1465.             }
  1466.             setTextMsg(1000, "They will follow you everywhere, the sport vehicle is available in the garage.");
  1467.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1468.  
  1469.         }
  1470.         else { setTextMsg(500, "You don't have enough cash."); }
  1471.  
  1472.         setTextMsg(1000, "~b~Info:~n~~w~Press B or Left + ~y~Y~w~ to fire 1 bodyguard.");
  1473.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1474.  
  1475.     }
  1476. }
  1477.  
  1478. void setup_dealbreak()
  1479. {
  1480.     PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  1481.     PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  1482.     PLAYER::SET_MAX_WANTED_LEVEL(0);
  1483.     cancelMsg();
  1484.     mission = true;
  1485.     int vehId, step;
  1486.  
  1487.     // spawning vehicles
  1488.     // speeder as coke vehicle
  1489.     DWORD vehH, riotH, swatH, weapH, weapA, weapS, dubH, robH, helH;
  1490.     Any helB;
  1491.  
  1492.     dubH = GAMEPLAY::GET_HASH_KEY("dubsta2");
  1493.     weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE");
  1494.     weapA = GAMEPLAY::GET_HASH_KEY("COMPONENT_AT_AR_FLSH");
  1495.     weapS = GAMEPLAY::GET_HASH_KEY("COMPONENT_AT_AR_SUPP");
  1496.     vehH = GAMEPLAY::GET_HASH_KEY("speeder");
  1497.     riotH = GAMEPLAY::GET_HASH_KEY("riot");
  1498.     swatH = GAMEPLAY::GET_HASH_KEY("S_M_Y_Swat_01");
  1499.     robH = GAMEPLAY::GET_HASH_KEY("S_M_Y_Robber_01");
  1500.     helH = GAMEPLAY::GET_HASH_KEY("frogger2");
  1501.  
  1502.     STREAMING::REQUEST_MODEL(dubH);
  1503.     STREAMING::REQUEST_MODEL(vehH);
  1504.     STREAMING::REQUEST_MODEL(riotH);
  1505.     STREAMING::REQUEST_MODEL(swatH);
  1506.     STREAMING::REQUEST_MODEL(robH);
  1507.     STREAMING::REQUEST_MODEL(helH);
  1508.  
  1509.  
  1510.     while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(riotH) || !STREAMING::HAS_MODEL_LOADED(swatH) || !STREAMING::HAS_MODEL_LOADED(dubH) || !STREAMING::HAS_MODEL_LOADED(robH) || !STREAMING::HAS_MODEL_LOADED(helH))
  1511.         WAIT(100);
  1512.  
  1513.     scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, -1140, -1086, 0.23, 30, false, false);
  1514.     blips[1] = UI::ADD_BLIP_FOR_ENTITY(scVeh[7]);
  1515.     UI::SET_BLIP_COLOUR(blips[1], 3);
  1516.  
  1517.  
  1518.     while (!ENTITY::IS_ENTITY_AT_COORD(playerPed, -1130, -1068, 2.07, 100, 100, 100, false, true, false)) {
  1519.         if (ENTITY::IS_ENTITY_DEAD(playerPed) || ENTITY::IS_ENTITY_DEAD(scVeh[7])) { break; cleanupMissions(1); }
  1520.         if (GetAsyncKeyState('O') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 190) && CONTROLS::IS_CONTROL_JUST_PRESSED(0, 204)) { cleanupMissions(1); break; }
  1521.         message("Help your ~b~guys~w~ next to the ~b~boat~w~ full of heroin.");
  1522.         recruit_checks();
  1523.         WAIT(0);
  1524.     }
  1525.  
  1526.     // GOOD !! YOU KNOW WHERE IT IS STORED !
  1527.     if (mission) {
  1528.         scVeh[6] = VEHICLE::CREATE_VEHICLE(riotH, -1163, -1088, 2.1, 300, false, false);
  1529.         scVeh[8] = VEHICLE::CREATE_VEHICLE(riotH, -1179, -1097.6, 2.4, 237, false, false);
  1530.         scVeh[9] = VEHICLE::CREATE_VEHICLE(dubH, -1131.1, -1067, 2.07, 141, false, false);
  1531.         scVeh[10] = VEHICLE::CREATE_VEHICLE(dubH, -1131.62, -1087.63, 2.16, 209, false, false);
  1532.         scVeh[11] = VEHICLE::CREATE_VEHICLE(helH, -1156, -1106, 9.63 + 20.0f, 360, false, false);
  1533.         helB = UI::ADD_BLIP_FOR_ENTITY(scVeh[11]);
  1534.         UI::SET_BLIP_SPRITE(helB, 353);
  1535.         VEHICLE::SET_VEHICLE_LIVERY(scVeh[11], 0);
  1536.         VEHICLE::SET_VEHICLE_DOOR_OPEN(scVeh[10], 5, 0, 0);
  1537.         VEHICLE::SET_VEHICLE_SIREN(scVeh[6], true);
  1538.         VEHICLE::SET_VEHICLE_SIREN(scVeh[8], true);
  1539.         VEHICLE::SET_HELI_BLADES_FULL_SPEED(scVeh[11]);
  1540.         vehId = 6;
  1541.         step = 7;
  1542.  
  1543.         // ped id 6-22
  1544.         for (int i = -1; i < 9; i++)
  1545.         {
  1546.             scPed[i + step] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[vehId], 26, swatH, i, false, false);
  1547.             blips[i + step] = UI::ADD_BLIP_FOR_ENTITY(scPed[i + step]);
  1548.             UI::SET_BLIP_SCALE(blips[i + step], 0.75f);
  1549.             PED::SET_PED_AS_COP(scPed[i + 7], false);
  1550.             WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i + step], weapH, 100, false);
  1551.             WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(scPed[i + step], weapH, weapA);
  1552.             PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i + step], 0x783e3868);
  1553.             PED::SET_PED_AS_ENEMY(scPed[i + step], true);
  1554.             if (rand() % 2 == 1) WEAPON::GIVE_WEAPON_COMPONENT_TO_PED(scPed[i + step], weapH, weapS);
  1555.             if (i == 8 && vehId == 6) { vehId = 8; i = -1; step = 15; }
  1556.         }
  1557.  
  1558.         // ped id 23-31
  1559.  
  1560.  
  1561.         weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_MICROSMG");
  1562.  
  1563.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x783e3868);
  1564.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x783e3868, GAMEPLAY::GET_HASH_KEY("player"));
  1565.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, 0x783e3868);
  1566.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x783e3868, 0x90c7da60);
  1567.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  1568.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(2, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  1569.  
  1570.  
  1571.         // dubsta 1
  1572.         step = 23;
  1573.         vehId = 9;
  1574.         for (int i = -1; i < 5; i++)
  1575.         {
  1576.             scPed[i + step] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[vehId], 26, robH, i, false, false);
  1577.             blips[i + step] = UI::ADD_BLIP_FOR_ENTITY(scPed[i + step]);
  1578.             UI::SET_BLIP_COLOUR(blips[i + step], 3);
  1579.             UI::SET_BLIP_SCALE(blips[i + step], 0.75f);
  1580.             PED::SET_PED_CAN_RAGDOLL(scPed[i + step], false);
  1581.             WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i + step], weapH, 100, false);
  1582.             PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i + step], 0x90c7da60);
  1583.             AI::TASK_LEAVE_VEHICLE(scPed[i + step], scVeh[vehId], 8);
  1584.             ENTITY::SET_ENTITY_HEALTH(scPed[i + step], 250);
  1585.         }
  1586.  
  1587.         // dubsta 2
  1588.         step = 27;
  1589.         vehId = 10;
  1590.         for (int i = -1; i < 5; i++)
  1591.         {
  1592.             scPed[i + step] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[vehId], 26, robH, i, false, false);
  1593.             blips[i + step] = UI::ADD_BLIP_FOR_ENTITY(scPed[i + step]);
  1594.             UI::SET_BLIP_COLOUR(blips[i + step], 3);
  1595.             UI::SET_BLIP_SCALE(blips[i + step], 0.75f);
  1596.             PED::SET_PED_CAN_RAGDOLL(scPed[i + step], false);
  1597.             WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i + step], weapH, 100, false);
  1598.             PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i + step], 0x90c7da60);
  1599.             AI::TASK_LEAVE_VEHICLE(scPed[i + step], scVeh[vehId], 8);
  1600.         }
  1601.  
  1602.         //swat heli
  1603.         step = 31;
  1604.         vehId = 11;
  1605.         weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE");
  1606.         for (int i = -1; i < 5; i++)
  1607.         {
  1608.             PED::SET_PED_AS_COP(scPed[i + step], false);
  1609.             scPed[i + step] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[vehId], 26, swatH, i, false, false);
  1610.             PED::SET_PED_CAN_RAGDOLL(scPed[i + step], false);
  1611.             WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i + step], weapH, 100, false);
  1612.             PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i + step], 0x783e3868);
  1613.         }
  1614.  
  1615.  
  1616.         AI::TASK_COMBAT_PED(scPed[7], scPed[24], 0, 0);
  1617.         // is not yet there
  1618.  
  1619.         while (!PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true))
  1620.         {
  1621.             PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  1622.             PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  1623.             if (ENTITY::IS_ENTITY_DEAD(playerPed) || ENTITY::IS_ENTITY_DEAD(scVeh[7])) { break; cleanupMissions(1); }
  1624.             if (GetAsyncKeyState('O') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 190) && CONTROLS::IS_CONTROL_JUST_PRESSED(0, 204)) { cleanupMissions(1); break; }
  1625.             for (int i = 6; i < 64; i++) { if (ENTITY::IS_ENTITY_DEAD(scPed[i])) UI::REMOVE_BLIP(&blips[i]); }
  1626.             if (ENTITY::IS_ENTITY_DEAD(scVeh[11])) UI::REMOVE_BLIP(&helB);
  1627.             message("Kill the ~r~enemies~w~ and get in the ~b~boat.");
  1628.             WAIT(0);
  1629.         }
  1630.  
  1631.         blips[3] = UI::ADD_BLIP_FOR_COORD(-767, -1425, 1.6);
  1632.         UI::SET_BLIP_COLOUR(blips[3], 17);
  1633.  
  1634.         while (!ENTITY::IS_ENTITY_AT_COORD(scVeh[7], -767, -1425, 1.60, 7, 7, 7, 0, 1, 0))
  1635.         {
  1636.             if (ENTITY::IS_ENTITY_DEAD(playerPed) || ENTITY::IS_ENTITY_DEAD(scVeh[7])) { break; cleanupMissions(1); }
  1637.             if (GetAsyncKeyState('O') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 190) && CONTROLS::IS_CONTROL_JUST_PRESSED(0, 204)) { cleanupMissions(1); break; }
  1638.             for (int i = 6; i < 64; i++) { if (ENTITY::IS_ENTITY_DEAD(scPed[i])) UI::REMOVE_BLIP(&blips[i]); }
  1639.             if (ENTITY::IS_ENTITY_DEAD(scVeh[11])) UI::REMOVE_BLIP(&helB);
  1640.             if (ENTITY::IS_ENTITY_AT_COORD(scVeh[7], -767, -1425, 1.60, 9, 9, 9, 0, 1, 0)) { cleanupMissions(0); break; }
  1641.             message("Get the ~b~boat~w~ to the ~y~Marina.");
  1642.             WAIT(0);
  1643.         }
  1644.  
  1645.     }
  1646.  
  1647. }
  1648.  
  1649.  
  1650. void bodyguards_leave()
  1651. {
  1652.     if ((GetAsyncKeyState('B') || (CONTROLS::IS_CONTROL_JUST_PRESSED(0, 189) && CONTROLS::IS_CONTROL_JUST_PRESSED(0, 204))) && press_B_tick == 0) {
  1653.         press_B_tick = 1;
  1654.         if (bodyguard > 4) bodyguard = 0;
  1655.         WEAPON::REMOVE_ALL_PED_WEAPONS(bodyG[bodyguard], true);
  1656.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&bodyG[bodyguard]);
  1657.         bodyguard++;
  1658.     }
  1659. }
  1660.  
  1661. void generateRandomContracts_hot()
  1662. {
  1663.     int myRand;
  1664.  
  1665.     for (int i = 0; i < 3; i++) {
  1666.         std::ostringstream oss;
  1667.         myRand = rand() % 101;
  1668.         while (oldRand >= (myRand - 25) && oldRand <= (myRand + 25)) {
  1669.             myRand = rand() % 101;
  1670.             WAIT(0);
  1671.         }
  1672.         oldRand = myRand;
  1673.         // first contract
  1674.         if (myRand <= 24) {
  1675.             payout[i] = rand() % (50 - 20 + 1) + 20;
  1676.             contractPayout[i] = payout[i] * 1000;
  1677.             oss << "~r~Assassination ~g~$" << payout[i] << ",000";
  1678.             contracts[i] = oss.str();
  1679.             randContract[i] = 1;
  1680.         }
  1681.         if (myRand >= 25 && myRand <= 49) {
  1682.             payout[i] = rand() % (150 - 75 + 1) + 75;
  1683.             contractPayout[i] = payout[i] * 1000;
  1684.             oss << "~y~Mob Cleaning ~g~$" << payout[i] << ",000";
  1685.             contracts[i] = oss.str();
  1686.             randContract[i] = 2;
  1687.         }
  1688.         if (myRand >= 50 && myRand <= 74) {
  1689.             payout[i] = rand() % (410 - 275 + 1) + 275;
  1690.             contractPayout[i] = payout[i] * 1000;
  1691.             oss << "~b~VIP Protection ~g~$" << payout[i] << ",000";
  1692.             contracts[i] = oss.str();
  1693.             randContract[i] = 3;
  1694.         }
  1695.         if (myRand >= 75 && myRand <= 94) {
  1696.             payout[i] = rand() % (275 - 150 + 1) + 150;
  1697.             contractPayout[i] = payout[i] * 1000;
  1698.             oss << "~m~Deal Breaker ~g~$" << payout[i] << ",000";
  1699.             contracts[i] = oss.str();
  1700.             randContract[i] = 5;
  1701.         }
  1702.         if (myRand >= 95 && myRand <= 100) {
  1703.             if (totalMission > 4){
  1704.                 contracts[i] = "~p~Big Score ~g~+$3,000,000";
  1705.                 randContract[i] = 4;
  1706.             }
  1707.             else { i--; }
  1708.            
  1709.         }
  1710.     }
  1711.  
  1712. }
  1713.  
  1714. void generateRandomContracts_cold()
  1715. {
  1716.     // HERE
  1717.     contracts[0] = "Op. Nightfall ~w~(~g~$450,000~w~)";
  1718.     contracts[1] = "Op. Nightfall ~w~(~r~HC~w~) (~g~$950,000~w~)";
  1719.     contracts[2] = "Op. Black Thunder ~w~(~g~$640,000~w~)";
  1720. }
  1721.  
  1722. void redhouse_1()
  1723. {
  1724.     // CONTRACTS
  1725.     if (ENTITY::IS_ENTITY_AT_COORD(playerPed, 125.6, -1044.59, 29.3, 5.0f, 5.0f, 5.0f, 0, 1, 0) && !menuDisplayed[0]) {
  1726.         // 25 % chance assassination (1)
  1727.         // 25 % chance mob cleaning (2)
  1728.         // 20% chance deal breaker (5)
  1729.         // 25% protect contract (3)
  1730.         // 5% heist (4)
  1731.         menuDisplayed[0] = true;
  1732.         generateRandomContracts_hot();
  1733.         random_text = rand() % 6;
  1734.         // GENERATE 3 RANDOM CONTRACTS HERE
  1735.     }
  1736.  
  1737.     if (!ENTITY::IS_ENTITY_AT_COORD(playerPed, 125.6, -1044.59, 29.3, 5.0f, 5.0f, 5.0f, 0, 1, 0)) menuDisplayed[0] = false;
  1738.    
  1739.     if (menuDisplayed[0]) menuHandler();
  1740.  
  1741.     // RED HOUSE 1 CHECKS
  1742.     if (ENTITY::IS_ENTITY_AT_COORD(playerPed, 125.6, -1044.59, 29.3, 75.0f, 75.0f, 75.0f, 0, 1, 0) && !isAtRedHouse1) {
  1743.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&payVeh);
  1744.         isAtRedHouse1 = true;
  1745.     }
  1746.     if (!ENTITY::IS_ENTITY_AT_COORD(playerPed, 125.6, -1044.59, 29.3, 75.0f, 75.0f, 75.0f, 0, 1, 0) && isAtRedHouse1) {
  1747.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&payVeh);
  1748.         isAtRedHouse1 = false;
  1749.     }
  1750.  
  1751.  
  1752. }
  1753.  
  1754. void assassinsChecks()
  1755. {
  1756.     message("Kill the ~r~target~w~.");
  1757.     if (PED::IS_PED_SHOOTING(scPed[6]) || PED::IS_PED_SHOOTING(scPed[7])) {
  1758.         if (rand() % 3 == 1 && callBack < 4) {
  1759.             callBack++;
  1760.             setTextMsg(2000, "~b~Info ~w~:~n~The target just called the hired protection, they'll be chasing you now!");
  1761.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1762.             sposition = ENTITY::GET_ENTITY_COORDS(playerPed, false);
  1763.             set_spawn_points();
  1764.             setAssassinBackup();
  1765.         }
  1766.     }
  1767.     if (ENTITY::IS_ENTITY_DEAD(scPed[6])) cleanupMissions(0);
  1768. }
  1769.  
  1770. void cleanChecks()
  1771. {
  1772.     if (ENTITY::IS_ENTITY_AT_COORD(playerPed, mobClean.x, mobClean.y, mobClean.z, 40.0f, 40.0f, 40.0f, false, true, false) && !joinedClean) { joinedClean = true;  UI::REMOVE_BLIP(&blips[1]); sposition = ENTITY::GET_ENTITY_COORDS(playerPed, false); mobCleanBlips(true); if (rand() % 3 == 1) setMobCleanBackup(); }
  1773.     if (!joinedClean) message("Go to the ~y~destination~w~.");
  1774.     if (joinedClean) message("Kill ~r~everyone~w~.");
  1775.     if (mobDead > 9) cleanupMissions(0);
  1776.     if (joinedClean){
  1777.         mobDead = 0;
  1778.         mobCleanBlips(false);
  1779.         for (int i = 6; i < 17; i++)
  1780.         {
  1781.             if (ENTITY::IS_ENTITY_DEAD(scPed[i])) {
  1782.                 mobDead++; ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  1783.             }
  1784.         }
  1785.     }
  1786. }
  1787.  
  1788. void protectChecks()
  1789. {
  1790.     if (ENTITY::IS_ENTITY_AT_COORD(playerPed, mobProtect.x, mobProtect.y, mobProtect.z, 10.0f, 10.0f, 10.0f, false, true, false) && !joinedProtect) { joinedProtect = true;  UI::REMOVE_BLIP(&blips[1]); sposition = ENTITY::GET_ENTITY_COORDS(playerPed, false); PED::SET_PED_AS_GROUP_MEMBER(scPed[6], PLAYER::GET_PLAYER_GROUP(player)); }
  1791.     if (!joinedProtect) message("Get to the ~b~destination~w~ quickly.");
  1792.     if (joinedProtect && !finishedProtect) message("Kill the ~r~enemies~w~ and keep the ~b~contractor~w~ alive.");
  1793.     if (finishedProtect && !isDrivingAway) { while (!PED::IS_PED_IN_VEHICLE(playerPed, scVeh[6], true)) { WAIT(0); cleanupBlips(); if (ENTITY::IS_ENTITY_DEAD(playerPed) || ENTITY::IS_ENTITY_DEAD(scVeh[6])) break; message("Get in the ~b~contractor's~w~ vehicle."); } protectLoop(); message("Take the ~b~contractor~w~ back to the ~r~Red House~w~."); if (!blipSet) { UI::SET_BLIP_ROUTE(mainBlip[0], true); blipSet = true; } }
  1794.     if (finishedProtect) cleanupBlips();
  1795.     if (finishedProtect && isDrivingAway) message("Wait for the ~b~contractor~w~ to leave the area.");
  1796.     if (joinedProtect && !finishedProtect) protectLoop();
  1797.     if (mobDead > 36) finishedProtect = true;
  1798.     if (finishedProtect && ENTITY::IS_ENTITY_AT_COORD(scPed[6], 125.6, -1044.59, 29.24, 15, 15, 15, false, true, false)) {
  1799.  
  1800.         WEAPON::REMOVE_ALL_PED_WEAPONS(scPed[6], true);
  1801.         while (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[6], false)) { WAIT(0); message("Get out of the vehicle."); }
  1802.         PED::REMOVE_PED_FROM_GROUP(scPed[6]);
  1803.         UI::SET_BLIP_ROUTE(mainBlip[0], false);
  1804.         blipSet = false;
  1805.         //AI::TASK_ENTER_VEHICLE(scPed[6], scVeh[6], 2000, -1, 30.0f, 0, 0);
  1806.         AI::TASK_SHUFFLE_TO_NEXT_VEHICLE_SEAT(-1, scPed[6]);
  1807.         WAIT(3000);
  1808.         AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[6], scVeh[6], 490, -3359, 6.5, 100, 1, ENTITY::GET_ENTITY_MODEL(scVeh[6]), 1, 5.0, -1);
  1809.         isDrivingAway = true;
  1810.     }
  1811.     if (isDrivingAway) { if (!ENTITY::IS_ENTITY_AT_COORD(scPed[6], position.x, position.y, position.z, 70.0f, 70.0f, 70.0f, 0, 1, 0)) cleanupMissions(0); }
  1812.     //if (selectedType == 3 && joinedProtect && mobDead > 60) { PED::REMOVE_PED_FROM_GROUP(scPed[6]); WEAPON::REMOVE_ALL_PED_WEAPONS(scPed[6], true); AI::TASK_ENTER_VEHICLE(scPed[6], scVeh[6], 100, -1, 10.0f, 0, 0); cleanupMissions(0); }
  1813.     if (joinedProtect && ENTITY::IS_ENTITY_DEAD(scPed[6])){ cleanupMissions(1); setTextMsg(2000, "~r~Mission failed ~w~:~n~I just heard the guy died ! How are people gonna trust me after this? Please be careful next time."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); }
  1814.     if (joinedProtect && ENTITY::IS_ENTITY_DEAD(scVeh[6])){ cleanupMissions(1); setTextMsg(2000, "~r~Mission failed ~w~:~n~The car is totaled ! This car is worth more than what the guy payed me!"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); }
  1815. }
  1816.  
  1817. void check()
  1818. {
  1819.     if (mission) {
  1820.         // display objectives
  1821.         if (selectedType == 1) assassinsChecks();
  1822.         if (selectedType == 2) cleanChecks();
  1823.         if (selectedType == 3) protectChecks();
  1824.  
  1825.         if (selectedType > 1) {
  1826.             PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  1827.             PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  1828.         }
  1829.  
  1830.     }
  1831. }
  1832.  
  1833. void heist_1()
  1834. {
  1835.     ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[1]);
  1836.     AUDIO::STOP_AUDIO_SCENE("JSH_1_GET_TO_ROOF");
  1837.     AUDIO::STOP_AUDIO_SCENE("EXILE_2_SNIPE_STAGE");
  1838.     AUDIO::STOP_AUDIO_SCENE("FAMILY_1_YACHT_ARRIVES");
  1839.     mission = true;
  1840.     //GAMEPLAY::SET_MISSION_FLAG(true);
  1841.     AUDIO::REQUEST_SCRIPT_AUDIO_BANK("FAMILY_1_CHASE_01", 0);
  1842.     AUDIO::REQUEST_MISSION_AUDIO_BANK("JWL_HEIST_SETUP", 0);
  1843.     //AUDIO::REQUEST_SCRIPT_AUDIO_BANK("CAR_THEFT_FINALE", 0);
  1844.     AUDIO::PREPARE_MUSIC_EVENT("FAM1_START");
  1845.     AUDIO::PREPARE_MUSIC_EVENT("JH1_START");
  1846.  
  1847.  
  1848.  
  1849.     for (int i = 0; i < 5; i++)
  1850.     {
  1851.         WEAPON::REMOVE_ALL_PED_WEAPONS(bodyG[i], true);
  1852.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&bodyG[i]);
  1853.     }
  1854.     bool changedBlip = false;
  1855.     bool stage1 = false;
  1856.     bool stage2 = false;
  1857.     bool stage3 = false;
  1858.     bool stage4 = false;
  1859.     WAIT(0);
  1860.     setTextMsg(1000, "Alright, time for a big score now.");
  1861.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1862.     WAIT(5000);
  1863.  
  1864.     // AUDIO PLAYING (1)
  1865.     AUDIO::START_AUDIO_SCENE("JSH_1_GET_TO_ROOF");
  1866.     AUDIO::TRIGGER_MUSIC_EVENT("JH1_START");
  1867.     setTextMsg(1000, "This one is gonna get you pretty big money..");
  1868.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1869.     WAIT(4000);
  1870.     setTextMsg(1000, "This is not your regular contract, so you can't let me down on this one.");
  1871.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1872.     WAIT(3000);
  1873.     setTextMsg(1000, "Alright, I just got an Insurgent from some guys. You now have 2 choices.");
  1874.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1875.     WAIT(1000);
  1876.     setTextMsg(1000, "A : You drive the Insurgent all the way back here with the cops along the ride.");
  1877.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1878.     WAIT(4000);
  1879.     setTextMsg(1000, "B : You steal a Cargobob and someone will transport the Insurgent without the cops.");
  1880.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1881.     WAIT(1000);
  1882.     setTextMsg(1000, "Your choice.");
  1883.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1884.  
  1885.  
  1886.  
  1887.     if (!stage1) {
  1888.         blips[1] = UI::ADD_BLIP_FOR_COORD(1531.1, 1715.5, 110);
  1889.         UI::SET_BLIP_COLOUR(blips[1], 3);
  1890.         UI::SET_BLIP_ROUTE(blips[1], true);
  1891.         UI::FLASH_MINIMAP_DISPLAY();
  1892.  
  1893.         DWORD vehH, helH, pedH, weapH, polH;
  1894.         vehH = GAMEPLAY::GET_HASH_KEY("insurgent");
  1895.         helH = GAMEPLAY::GET_HASH_KEY("cargobob2");
  1896.         polH = GAMEPLAY::GET_HASH_KEY("police");
  1897.         pedH = GAMEPLAY::GET_HASH_KEY("S_M_M_Security_01");
  1898.         STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("S_M_Y_Cop_01"));
  1899.         STREAMING::REQUEST_MODEL(polH);
  1900.         STREAMING::REQUEST_MODEL(pedH);
  1901.         STREAMING::REQUEST_MODEL(vehH);
  1902.         STREAMING::REQUEST_MODEL(helH);
  1903.         STREAMING::REQUEST_MODEL(GAMEPLAY::GET_HASH_KEY("dubsta"));
  1904.         WAIT(1000);
  1905.         while (!STREAMING::HAS_MODEL_LOADED(vehH) && !STREAMING::HAS_MODEL_LOADED(helH) && !STREAMING::HAS_MODEL_LOADED(pedH))
  1906.         {
  1907.             WAIT(0);
  1908.         }
  1909.         scVeh[6] = VEHICLE::CREATE_VEHICLE(vehH, 1531.1, 1715.5, 110, 147.0f, 0, true);
  1910.         scVeh[5] = VEHICLE::CREATE_VEHICLE(helH, 884.76, 2352, 52.68, 147.0f, 0, true);
  1911.         scVeh[7] = VEHICLE::CREATE_VEHICLE(GAMEPLAY::GET_HASH_KEY("dubsta"), 904, 2361, 51.73, 126.0f, 0, true);
  1912.         scVeh[8] = VEHICLE::CREATE_VEHICLE(GAMEPLAY::GET_HASH_KEY("dubsta"), 897, 2344, 51.93, 40.0f, 0, true);
  1913.         scVeh[9] = VEHICLE::CREATE_VEHICLE(polH, 1523, 1728, 110.1, 206, 0, true);
  1914.  
  1915.         // blips
  1916.         blips[2] = UI::ADD_BLIP_FOR_ENTITY(scVeh[5]);
  1917.         UI::SET_BLIP_SPRITE(blips[2], 353);
  1918.         //UI::SET_BLIP_AS_FRIENDLY(blips[2], true);
  1919.         UI::SET_BLIP_ROUTE(blips[2], true);
  1920.  
  1921.         scPed[6] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 26, pedH, -1, false, false);
  1922.         scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 26, pedH, 0, false, false);
  1923.         scPed[8] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 26, pedH, 1, false, false);
  1924.         scPed[9] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 26, pedH, 2, false, false);
  1925.         scPed[10] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 26, pedH, -1, false, false);
  1926.         scPed[11] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 26, pedH, 0, false, false);
  1927.         scPed[12] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 26, pedH, 1, false, false);
  1928.         scPed[13] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[8], 26, pedH, 2, false, false);
  1929.         scPed[14] = PED::CREATE_PED(26, pedH, 880, 2362, 52, 290, false, true);
  1930.         scPed[15] = PED::CREATE_PED(26, pedH, 870, 2335, 53, 311, false, true);
  1931.         scPed[16] = PED::CREATE_PED(26, GAMEPLAY::GET_HASH_KEY("S_M_Y_Cop_01"), 1523, 1717, 110, 253, false, true);
  1932.  
  1933.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, GAMEPLAY::GET_HASH_KEY("player"), 0x90c7da60);
  1934.         PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x90c7da60, GAMEPLAY::GET_HASH_KEY("player"));
  1935.         PED::SET_PED_AS_COP(scPed[16], true);
  1936.  
  1937.         for (int i = 6; i < 17; i++)
  1938.         {
  1939.             if (rand() % 3 == 0) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  1940.             if (rand() % 3 == 1) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PUMPSHOTGUN");
  1941.             if (rand() % 3 == 2) weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_CARBINERIFLE");
  1942.             STREAMING::REQUEST_MODEL(weapH);
  1943.             PED::SET_PED_ACCURACY(scPed[i], 50);
  1944.             WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[i], weapH, 1000, false);
  1945.             WEAPON::SET_CURRENT_PED_WEAPON(scPed[i], weapH, true);
  1946.             PED::SET_PED_RELATIONSHIP_GROUP_HASH(scPed[i], 0x90c7da60);
  1947.  
  1948.         }
  1949.     }
  1950.  
  1951.     WAIT(2000);
  1952.     setTextMsg(1000, "The vehicle is at a farm near the desert. There will be cops... so careful.");
  1953.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1954.     WAIT(2000);
  1955.     setTextMsg(1000, "Bring it back at the Red House, we'll store it inside the Garage.");
  1956.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1957.     WAIT(3000);
  1958.     setTextMsg(1000, "Oh and one thing... Find a way to kill the cop without alerting everyone. Like, no guns, okay?");
  1959.     AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  1960.  
  1961.     bool cargobob = false;
  1962.     bool insurgent = false;
  1963.     bool cops = false;
  1964.  
  1965.     // PICKUP THE INSURGENT
  1966.     while (!stage1)
  1967.     {
  1968.         WAIT(0);
  1969.         if (PLAYER::GET_PLAYER_WANTED_LEVEL(player) > 0) { cops = true; }
  1970.         else { cops = false; }
  1971.  
  1972.         if (!PED::IS_PED_IN_VEHICLE(playerPed, scVeh[6], true) && !PED::IS_PED_IN_VEHICLE(playerPed, scVeh[5], true)) message("Find a way to bring the ~b~Insurgent~w~.");
  1973.         if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[5], true)) message("Take the Cargobob back to the ~y~Marina~w~.");
  1974.         if (ENTITY::IS_ENTITY_DEAD(playerPed) || PLAYER::IS_PLAYER_BEING_ARRESTED(player, false)) { setTextMsg(1000, "I don't know how you managed to fuck up this..."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); break; cleanupMissions(1); }
  1975.         if (ENTITY::IS_ENTITY_DEAD(scVeh[6]) || ENTITY::IS_ENTITY_DEAD(scVeh[5])) { setTextMsg(1000, "How did you just managed to blow up the vehicle ? Good thing that thing was free!"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); break; cleanupMissions(1); }
  1976.         if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[6], true)) {
  1977.             if (!cops) message("Get the ~b~Insurgent~w~ to the ~y~garage~w~.");
  1978.             if (cops) message("Lose the cops.");
  1979.             if (!changedBlip){
  1980.                 insurgent = true;
  1981.                 if (!PED::IS_PED_IN_VEHICLE(playerPed, scVeh[5], true)) {
  1982.                     if (!PED::WAS_PED_KILLED_BY_STEALTH(scPed[16])) {
  1983.                         AUDIO::START_AUDIO_SCENE("FAMILY_1_YACHT_ARRIVES");
  1984.                         AUDIO::TRIGGER_MUSIC_EVENT("FAM1_START");
  1985.                         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 4, false);
  1986.                         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  1987.                     }
  1988.                 }
  1989.                 UI::REMOVE_BLIP(&blips[1]);
  1990.                 UI::REMOVE_BLIP(&blips[2]);
  1991.                 blips[1] = UI::ADD_BLIP_FOR_COORD(135.3, -1050.86, 29.2);
  1992.                 UI::SET_BLIP_COLOUR(blips[1], 17);
  1993.                 UI::SET_BLIP_ROUTE(blips[1], true);
  1994.                 changedBlip = true;
  1995.             }
  1996.  
  1997.         }
  1998.         if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[5], true) && !cargobob) { cargobob = true; setTextMsg(1000, "Cargogbob heh ? Take it back to the Marina, one of my guy will bring the Insurgent."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); }
  1999.         //if (VEHICLE::IS_VEHICLE_ATTACHED_TO_CARGOBOB(scVeh[6], scVeh[5]) && !cargobob) { cargobob = true; setTextMsg(1000, "Cargogbob heh ? Well as long as you drive the Insurgent to the garage..."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); }
  2000.         if (ENTITY::IS_ENTITY_AT_COORD(playerPed, 880, 2370, 52, 60, 60, 60, 0, 1, 0)) { UI::TOGGLE_STEALTH_RADAR(true); }
  2001.         else { UI::TOGGLE_STEALTH_RADAR(false); }
  2002.         if (ENTITY::IS_ENTITY_AT_COORD(scVeh[6], 135.3, -1050.86, 29.3, 3, 3, 3, 0, 1, 0) && !cops) { stage1 = true; UI::REMOVE_BLIP(&blips[1]); }
  2003.         if (ENTITY::IS_ENTITY_AT_COORD(scVeh[5], -735, -1455, 5, 8, 8, 3, 0, 1, 0) && !cops) { stage1 = true; UI::REMOVE_BLIP(&blips[1]); }
  2004.         if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[5], true) && !changedBlip) { changedBlip = true; UI::REMOVE_BLIP(&blips[1]); UI::REMOVE_BLIP(&blips[2]); blips[1] = UI::ADD_BLIP_FOR_COORD(-735, -1455, 5); UI::SET_BLIP_COLOUR(blips[1], 17); UI::SET_BLIP_ROUTE(blips[1], true); }
  2005.  
  2006.     }
  2007.  
  2008.     if (stage1) {
  2009.         stopMusic();
  2010.         AUDIO::TRIGGER_MUSIC_EVENT("JH1_START");
  2011.         for (int i = 5; i < 31; i++)
  2012.         {
  2013.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[i]);
  2014.             ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[i]);
  2015.         }
  2016.         if (insurgent) {
  2017.             setTextMsg(1000, "Great! Now we have our Insurgent. Now it's time for me to brief you on the attack.");
  2018.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2019.         }
  2020.         else {
  2021.             setTextMsg(1000, "I'll charge on of my men to bring the Insurgent back with the Cargobob. Time for another mission.");
  2022.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2023.         }
  2024.  
  2025.         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  2026.         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2027.  
  2028.  
  2029.         DWORD vehH, pedH;
  2030.         vehH = GAMEPLAY::GET_HASH_KEY("comet2");
  2031.         pedH = GAMEPLAY::GET_HASH_KEY("A_M_M_Business_01");
  2032.         STREAMING::REQUEST_MODEL(vehH);
  2033.         STREAMING::REQUEST_MODEL(pedH);
  2034.         WAIT(6000);
  2035.  
  2036.         scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, -128, -767, 33.37, 92.0f, 0, true);
  2037.         scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 3, pedH, -1, false, false);
  2038.         AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[7], scVeh[7], -631, -371, 34, 20, 1, ENTITY::GET_ENTITY_MODEL(scVeh[7]), 1, 5.0, -1);
  2039.         WAIT(2000);
  2040.  
  2041.         // camera work
  2042.         Any cam;
  2043.         cam = CAM::CREATE_CAMERA_WITH_PARAMS(0x19286a9, CAM::_0xA200EB1EE790F448().x, CAM::_0xA200EB1EE790F448().y, CAM::_0xA200EB1EE790F448().z, CAM::_0x5B4E4C817FCC2DFB(2).x, CAM::_0x5B4E4C817FCC2DFB(2).y, CAM::_0x5B4E4C817FCC2DFB(2).z, CAM::_0x80EC114669DAEFF4(), 1, 2);
  2044.         CAM::POINT_CAM_AT_ENTITY(cam, scVeh[7], 1.5073, 1.6429, 0.717, 1);
  2045.         CAM::ATTACH_CAM_TO_ENTITY(cam, scVeh[7], 3.582200050354, 3.3028998374938965, 1.5527, 1);
  2046.         CAM::SET_CAM_ACTIVE(cam, true);
  2047.         CAM::DO_SCREEN_FADE_OUT(1000);
  2048.         while (!CAM::IS_SCREEN_FADED_OUT()) {
  2049.             WAIT(0);
  2050.         }
  2051.         CAM::DO_SCREEN_FADE_IN(1000);
  2052.         CAM::RENDER_SCRIPT_CAMS(1, 0, 3000, 1, 0);
  2053.         Vector3 oldpos = ENTITY::GET_ENTITY_COORDS(playerPed, false);
  2054.         ENTITY::SET_ENTITY_COORDS(playerPed, -153.5, -730, 42, 1, false, false, false);
  2055.         while (!CAM::IS_SCREEN_FADED_IN()) {
  2056.             WAIT(0);
  2057.         }
  2058.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[6]);
  2059.         UI::DISPLAY_RADAR(0);
  2060.         //CAM::SET_GAMEPLAY_VEHICLE_HINT(scVeh[7], camStuff.x, camStuff.y, camStuff.z, 1, -1, 600, 600);
  2061.         CAM::_0xF8BDBF3D573049A1(0.95f);
  2062.         CONTROLS::DISABLE_ALL_CONTROL_ACTIONS(0);
  2063.         setTextMsg(1000, "Okay here is the target, he works for some security company that we don't really care about..");
  2064.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2065.         WAIT(4000);
  2066.         setTextMsg(1000, "When a bank does a money transfer, they give a bank account filled with the same amount.");
  2067.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2068.         WAIT(4000);
  2069.         setTextMsg(1000, "Just in case if the Stockade gets robbed, the cash is marked and the money isn't lost.");
  2070.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2071.         WAIT(3000);
  2072.         setTextMsg(1000, "And the feds are gonna be all over that money... So yeah, not a good idea.");
  2073.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2074.         WAIT(4000);
  2075.         setTextMsg(1000, "We need the documents that contains info on wich Stockade is stored the cash.");
  2076.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2077.         WAIT(4000);
  2078.         setTextMsg(1000, "Kill him. Bring the documents and the car, and we'll continue.");
  2079.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2080.         WAIT(3000);
  2081.         ENTITY::SET_ENTITY_COORDS(playerPed, oldpos.x, oldpos.y, oldpos.z, 1, false, false, false);
  2082.         UI::DISPLAY_RADAR(1);
  2083.         CONTROLS::ENABLE_ALL_CONTROL_ACTIONS(0);
  2084.         CAM::DESTROY_CAM(cam, 0);
  2085.         CAM::RENDER_SCRIPT_CAMS(0, 0, 3000, 1, 0);
  2086.         //ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[7]);
  2087.         //ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[7]);
  2088.         stopMusic();
  2089.  
  2090.     }
  2091.  
  2092.  
  2093.     if (stage1){
  2094.         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  2095.         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2096.         setTextMsg(1000, "Target's gonna take the subway. Get there and wait until he arrives.");
  2097.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2098.         WAIT(3000);
  2099.  
  2100.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[1]);
  2101.         ENTITY::DELETE_ENTITY(&scVeh[1]);
  2102.         ENTITY::SET_ENTITY_COORDS(scVeh[1], -1816, -1210, 14, 1, false, false, false);
  2103.         DWORD zent = GAMEPLAY::GET_HASH_KEY("zentorno");
  2104.         STREAMING::REQUEST_MODEL(zent);
  2105.         while (!STREAMING::HAS_MODEL_LOADED(zent))
  2106.             WAIT(100);
  2107.  
  2108.         if (insurgent) scVeh[1] = VEHICLE::CREATE_VEHICLE(zent, 138.63, -1060.6, 29.3, 319, 0, true);
  2109.         if (insurgent == false) scVeh[1] = VEHICLE::CREATE_VEHICLE(zent, -692, -1411, 5.1, 319, 0, true);
  2110.  
  2111.  
  2112.         blips[1] = UI::ADD_BLIP_FOR_ENTITY(scVeh[1]);
  2113.         UI::SET_BLIP_COLOUR(blips[1], 3);
  2114.         UI::FLASH_MINIMAP_DISPLAY();
  2115.  
  2116.  
  2117.         setTextMsg(1000, "Take my Zentorno. You'll get faster there.");
  2118.         AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2119.         WAIT(2000);
  2120.     }
  2121.  
  2122.  
  2123.     while (stage1 && !PED::IS_PED_IN_VEHICLE(playerPed, scVeh[1], true))
  2124.     {
  2125.         if (ENTITY::IS_ENTITY_DEAD(scVeh[1])) {
  2126.             cleanupMissions(1);
  2127.             setTextMsg(1000, "Really ?");
  2128.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2129.             break;
  2130.  
  2131.         }
  2132.         WAIT(0);
  2133.         message("Get in the ~b~Zentorno~w~");
  2134.     }
  2135.  
  2136.     if (stage1) {
  2137.         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  2138.         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2139.         UI::REMOVE_BLIP(&blips[1]);
  2140.         blips[1] = UI::ADD_BLIP_FOR_COORD(-809.2, 40.75, 48.55);
  2141.         UI::SET_BLIP_COLOUR(blips[1], 3);
  2142.         UI::SET_BLIP_ROUTE(blips[1], true);
  2143.     }
  2144.  
  2145.     changedBlip = false;
  2146.     bool joined = false;
  2147.     bool givenOrder = false;
  2148.     bool sentMsg = false;
  2149.     bool sentOrder = false;
  2150.     bool leftVeh = false;
  2151.  
  2152.  
  2153.     if (stage1) {
  2154.         OBJECT::CREATE_PICKUP_ROTATE(GAMEPLAY::GET_HASH_KEY("PICKUP_WEAPON_HEAVYSNIPER"), -807.406, 41.6, 47.76, -90.0, 0.0, 90, 0, 0, 2, 1, 0);
  2155.     }
  2156.  
  2157.     if (stage1) while (!stage2)
  2158.     {
  2159.         WAIT(0);
  2160.         if (!ENTITY::IS_ENTITY_AT_COORD(playerPed, -809.2, 40.75, 48.55, 4, 4, 4, 0, 1, 0) && !joined) { message("Get in ~b~position~w~ for the assassination."); }
  2161.         if (ENTITY::IS_ENTITY_AT_COORD(playerPed, -809.2, 40.75, 48.55, 4, 4, 4, 0, 1, 0) && !joined) {
  2162.             joined = true;
  2163.             setTextMsg(1000, "Alright, he'll be coming in a moment. He's gonna take the subway. Wait for him, don't shoot yet.");
  2164.             AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2165.             UI::REMOVE_BLIP(&blips[1]);
  2166.             CONTROLS::DISABLE_CONTROL_ACTION(0, 266, 1);
  2167.             CONTROLS::DISABLE_CONTROL_ACTION(0, 267, 1);
  2168.             CONTROLS::DISABLE_CONTROL_ACTION(0, 268, 1);
  2169.             CONTROLS::DISABLE_CONTROL_ACTION(0, 269, 1);
  2170.             CONTROLS::DISABLE_CONTROL_ACTION(0, 195, 1);
  2171.             CONTROLS::DISABLE_CONTROL_ACTION(0, 196, 1);
  2172.  
  2173.         }
  2174.         if (joined && !givenOrder) { AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[7], scVeh[7], -789.024, -95.215, 37.192, 50, 1, ENTITY::GET_ENTITY_MODEL(scVeh[7]), 1, 5.0, -1); givenOrder = true; blips[2] = UI::ADD_BLIP_FOR_ENTITY(scPed[7]); }
  2175.         if (joined && givenOrder && !ENTITY::IS_ENTITY_DEAD(scPed[7]) && !leftVeh) message("Wait for the ~r~target~w~ to arrive.");
  2176.         if (joined && givenOrder && ENTITY::IS_ENTITY_AT_COORD(scPed[7], -789.024, -95.215, 37.192, 4, 4, 4, 0, 1, 0) && !leftVeh) {
  2177.             Any sequence;
  2178.             AI::OPEN_SEQUENCE_TASK(&sequence);
  2179.             AI::TASK_VEHICLE_PARK(scPed[7], scVeh[7], -760.5, -80.215, 36.588, 295.0f, -1, 5.0f, 0);
  2180.             AI::TASK_LEAVE_VEHICLE(scPed[7], scVeh[7], true);
  2181.             AI::CLOSE_SEQUENCE_TASK(sequence);
  2182.             AI::TASK_PERFORM_SEQUENCE(scPed[7], sequence);
  2183.             setTextMsg(1000, "Take the shot now."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); WAIT(1000); AI::TASK_WANDER_STANDARD(scPed[7], 0x471c4000, 0);
  2184.             leftVeh = true;
  2185.             AI::TASK_GO_STRAIGHT_TO_COORD(scPed[7], -830, -103, 28.2, 1.0f, -1, 27.0f, 0.5f);
  2186.         }
  2187.         if (joined && givenOrder && !ENTITY::IS_ENTITY_DEAD(scPed[7]) && !PED::IS_PED_IN_VEHICLE(scPed[7], scVeh[7], 0)) message("Take the shot now.");
  2188.         if (ENTITY::IS_ENTITY_AT_COORD(scPed[7], -821, -108, 28.2, 5, 5, 5, 0, 1, 0)) {
  2189.             sentMsg = true; setTextMsg(1000, "Wow. After all of this, and you didn't manage to kill him ?"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2190.             cleanupMissions(1);
  2191.             break;
  2192.         }
  2193.         if (ENTITY::IS_ENTITY_DEAD(scPed[7]) && !sentMsg) {
  2194.             CONTROLS::ENABLE_CONTROL_ACTION(0, 266, 1);
  2195.             CONTROLS::ENABLE_CONTROL_ACTION(0, 267, 1);
  2196.             CONTROLS::ENABLE_CONTROL_ACTION(0, 268, 1);
  2197.             CONTROLS::ENABLE_CONTROL_ACTION(0, 269, 1);
  2198.             CONTROLS::ENABLE_CONTROL_ACTION(0, 195, 1);
  2199.             CONTROLS::ENABLE_CONTROL_ACTION(0, 196, 1);
  2200.             sentMsg = true; setTextMsg(1000, "Great. Now take the Comet back to the garage. Files are inside."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); UI::REMOVE_BLIP(&blips[2]); ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[7]); blips[2] = UI::ADD_BLIP_FOR_ENTITY(scVeh[7]); UI::SET_BLIP_COLOUR(blips[2], 3);
  2201.         }
  2202.         if (sentMsg && !PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true)) message("Get inside the ~b~Comet~w~.");
  2203.         if (sentMsg && PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true) && !sentOrder) { sentOrder = true; setTextMsg(1000, "Alright, take it back to the garage now."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); }
  2204.         //if (sentMsg && PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true)) message("Drive the ~b~Comet~w~ back to the Red House's garage.");
  2205.         if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true)) { message("Get the ~b~Comet~w~ to the ~y~garage~w~."); if (!changedBlip){ changedBlip = true; UI::REMOVE_BLIP(&blips[1]); blips[1] = UI::ADD_BLIP_FOR_COORD(135.3, -1050.86, 29.2); UI::SET_BLIP_COLOUR(blips[1], 17); UI::SET_BLIP_ROUTE(blips[1], true); } }
  2206.         if (ENTITY::IS_ENTITY_AT_COORD(scVeh[7], 135.3, -1050.86, 29.3, 4, 4, 4, 0, 1, 0)) { stage2 = true; }
  2207.         if (ENTITY::IS_ENTITY_DEAD(playerPed) || PLAYER::IS_PLAYER_BEING_ARRESTED(player, false)) { setTextMsg(1000, "You're really bad at this job..."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); break; cleanupMissions(1); }
  2208.         if (ENTITY::IS_ENTITY_DEAD(scVeh[7])) { setTextMsg(1000, "Great! Now we lost the files! How are we gonna know wich Stockade to attack now?"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); break; cleanupMissions(1); }
  2209.  
  2210.     }
  2211.  
  2212.     joined = false;
  2213.     givenOrder = false;
  2214.     sentMsg = false;
  2215.     sentOrder = false;
  2216.     if (stage2){
  2217.         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  2218.         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2219.         UI::REMOVE_BLIP(&blips[1]);
  2220.         UI::REMOVE_BLIP(&blips[2]);
  2221.         VEHICLE::SET_VEHICLE_ENGINE_HEALTH(scVeh[7], 0.0f);
  2222.         WAIT(2000);
  2223.         setTextMsg(1000, "Excellent. Now we got the files. I'll text you the rest of the details."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2224.         WAIT(4000);
  2225.         setTextMsg(1000, "It's gonna me a little minute to decrypt these files. I'll send you a message when I'm done."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2226.         // TODO :: change to 30000
  2227.         WAIT(5000);
  2228.         setTextMsg(1000, "Hmm... Okay, the money will be in Stockade #141, 224 and 162."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2229.         WAIT(4000);
  2230.         setTextMsg(1000, "I've just located the Stockades in the city. Get there and blow them up."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2231.         WAIT(3000);
  2232.         setTextMsg(1000, "I've recruited a guy to drive the Insurgent when things gets hot."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2233.  
  2234.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[7]);
  2235.  
  2236.         // spawn insurgent with Cheng
  2237.  
  2238.         DWORD vehH, pedH;
  2239.         vehH = GAMEPLAY::GET_HASH_KEY("insurgent");
  2240.         pedH = GAMEPLAY::GET_HASH_KEY("G_M_Y_KorLieut_01");
  2241.         STREAMING::REQUEST_MODEL(vehH);
  2242.         STREAMING::REQUEST_MODEL(pedH);
  2243.         while (!STREAMING::HAS_MODEL_LOADED(vehH) || !STREAMING::HAS_MODEL_LOADED(pedH)) WAIT(100);
  2244.         scVeh[7] = VEHICLE::CREATE_VEHICLE(vehH, -807, -792, 19, 176.0f, 0, true);
  2245.         scPed[7] = PED::CREATE_PED_INSIDE_VEHICLE(scVeh[7], 3, pedH, 0, false, false);
  2246.  
  2247.         vehH = GAMEPLAY::GET_HASH_KEY("stockade");
  2248.         STREAMING::REQUEST_MODEL(vehH);
  2249.         while (!STREAMING::HAS_MODEL_LOADED(vehH)) WAIT(100);
  2250.         // stockades
  2251.         scVeh[8] = VEHICLE::CREATE_VEHICLE(vehH, -692.5, -613, 24.94, 266.0f, 0, true);
  2252.         scVeh[9] = VEHICLE::CREATE_VEHICLE(vehH, -693, -618.5, 24.94, 266.0f, 0, true);
  2253.         scVeh[10] = VEHICLE::CREATE_VEHICLE(vehH, -692.8, -624.2, 24.94, 266.0f, 0, true);
  2254.         WAIT(3000);
  2255.         setTextMsg(1000, "The Insurgent is hidden in a little place downtown. Yeah I know, hidden, downtown... Trust me."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2256.         WAIT(3000);
  2257.         UI::FLASH_MINIMAP_DISPLAY();
  2258.         blips[1] = UI::ADD_BLIP_FOR_COORD(-807, -792, 19);
  2259.         UI::SET_BLIP_COLOUR(blips[1], 3);
  2260.         UI::SET_BLIP_ROUTE(blips[1], true);
  2261.     }
  2262.  
  2263.     if (stage2) while (!stage3)
  2264.     {
  2265.         WAIT(0);
  2266.         if (!PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true) && !sentMsg) { message("Get in the ~b~Insurgent~w~."); }
  2267.         if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true) && !joined){
  2268.             setTextMsg(1000, "Get in the Insurgent, and park it near the Stockade Center."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); joined = true;
  2269.             PED::SET_PED_AS_GROUP_LEADER(playerPed, PLAYER::GET_PLAYER_GROUP(player));
  2270.             PED::SET_PED_AS_GROUP_MEMBER(scPed[7], PLAYER::GET_PLAYER_GROUP(player));
  2271.             ENTITY::SET_ENTITY_INVINCIBLE(scPed[7], true);
  2272.             UI::REMOVE_BLIP(&blips[1]);
  2273.             UI::FLASH_MINIMAP_DISPLAY();
  2274.             blips[1] = UI::ADD_BLIP_FOR_COORD(-691, -576, 26);
  2275.             UI::SET_BLIP_COLOUR(blips[1], 3);
  2276.             UI::SET_BLIP_ROUTE(blips[1], true);
  2277.         }
  2278.         if (ENTITY::IS_ENTITY_AT_COORD(scVeh[7], -691, -576, 26, 6, 6, 6, 0, 1, 0) && joined && !sentMsg) {
  2279.             sentMsg = true; setTextMsg(1000, "Good. Now go blow up the 3 Stockades."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2280.             UI::REMOVE_BLIP(&blips[1]);
  2281.             blips[1] = UI::ADD_BLIP_FOR_ENTITY(scVeh[8]);
  2282.             blips[2] = UI::ADD_BLIP_FOR_ENTITY(scVeh[9]);
  2283.             blips[3] = UI::ADD_BLIP_FOR_ENTITY(scVeh[10]);
  2284.         }
  2285.         if ((!ENTITY::IS_ENTITY_DEAD(scVeh[8]) || !ENTITY::IS_ENTITY_DEAD(scVeh[9]) || !ENTITY::IS_ENTITY_DEAD(scVeh[10])) && sentMsg) {
  2286.             message("Blow up the ~r~Stockades~w~.");
  2287.             if (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true)) {
  2288.                 AI::TASK_LEAVE_VEHICLE(playerPed, scVeh[7], 0x8);
  2289.                 VEHICLE::SET_VEHICLE_FORWARD_SPEED(scVeh[7], 0.0f);
  2290.             }
  2291.         }
  2292.         for (int i = 1; i <= 3; i++) { if (ENTITY::IS_ENTITY_DEAD(scVeh[i + 7])) UI::REMOVE_BLIP(&blips[i]); }
  2293.         if ((ENTITY::IS_ENTITY_DEAD(scVeh[8]) && ENTITY::IS_ENTITY_DEAD(scVeh[9]) && ENTITY::IS_ENTITY_DEAD(scVeh[10])) && !sentOrder) {
  2294.             AUDIO::START_AUDIO_SCENE("FAMILY_1_YACHT_ARRIVES");
  2295.             AUDIO::TRIGGER_MUSIC_EVENT("FAM1_START");
  2296.             setTextMsg(1000, "Look at all that cash... Well cops are coming now."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2297.             WAIT(2000);
  2298.             sentOrder = true;
  2299.             CONTROLS::DISABLE_ALL_CONTROL_ACTIONS(0);
  2300.             DWORD weapH = GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL");
  2301.             STREAMING::REQUEST_MODEL(weapH);
  2302.             WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[7], weapH, 1000, false);
  2303.             //PED::REMOVE_PED_FROM_GROUP(scPed[7]);
  2304.             AI::TASK_ENTER_VEHICLE(scPed[7], scVeh[7], 15000, -1, 30, 0, 0);
  2305.             AI::TASK_ENTER_VEHICLE(playerPed, scVeh[7], 15000, 7, 30, 1, 0);
  2306.             WAIT(1000);
  2307.             while (!PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], false)) WAIT(0);
  2308.             WAIT(2000);
  2309.             if (VEHICLE::GET_PED_IN_VEHICLE_SEAT(scVeh[7], 7) != playerPed) PED::SET_PED_INTO_VEHICLE(playerPed, scVeh[7], 7);
  2310.             PLAYER::SET_PLAYER_WANTED_LEVEL(player, 5, false);
  2311.             PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2312.             VEHICLE::SET_VEHICLE_HAS_STRONG_AXLES(scVeh[7], 1);
  2313.             VEHICLE::STEER_UNLOCK_BIAS(scVeh[7], 1);
  2314.             AI::CLEAR_PED_TASKS(scPed[7]);
  2315.             PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(scPed[7], 1);
  2316.             //AI::TASK_SMART_FLEE_PED(scPed[7], playerPed, 200.0, 20000, 0, 0);
  2317.             AI::TASK_SMART_FLEE_COORD(scPed[7], ENTITY::GET_ENTITY_COORDS(scPed[7], true).x, ENTITY::GET_ENTITY_COORDS(scPed[7], true).y, ENTITY::GET_ENTITY_COORDS(scPed[7], true).z, 1000.0, -1, 1, 0);
  2318.             WAIT(1000);
  2319.             AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[7], scVeh[7], 153.3, -1050.86, 29.26, 200.0, 0, 0, 786599, 5.0, 2.0);
  2320.             PED::SET_PED_SPHERE_DEFENSIVE_AREA(scPed[7], ENTITY::GET_ENTITY_COORDS(scPed[7], 1).x, ENTITY::GET_ENTITY_COORDS(scPed[7], 1).y, ENTITY::GET_ENTITY_COORDS(scPed[7], 1).z, 10.0, 0, 0);
  2321.             //AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[7], scVeh[7], 135.3, -1050.86, 29.265299224853516, 50.0f, 0, ENTITY::GET_ENTITY_MODEL(scVeh[7]), 786603, 2.0, 4.0);
  2322.             VEHICLE::SET_VEHICLE_DOORS_LOCKED_FOR_ALL_PLAYERS(scVeh[7], true);
  2323.             CONTROLS::ENABLE_ALL_CONTROL_ACTIONS(0);
  2324.             PED::SET_AI_WEAPON_DAMAGE_MODIFIER(0.25);
  2325.             setTextMsg(1000, "I wish you good luck."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2326.         }
  2327.  
  2328.         if (sentOrder && PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true)) {
  2329.             WAIT(2500);
  2330.             AI::CLEAR_PED_TASKS(scPed[7]); AI::TASK_SMART_FLEE_COORD(scPed[7], ENTITY::GET_ENTITY_COORDS(scPed[7], true).x, ENTITY::GET_ENTITY_COORDS(scPed[7], true).y, ENTITY::GET_ENTITY_COORDS(scPed[7], true).z, 1000.0, -1, 1, 0);
  2331.             WAIT(2000);
  2332.             if (!PED::IS_PED_IN_VEHICLE(scPed[7], scVeh[7], true)) PED::SET_PED_INTO_VEHICLE(scPed[7], scVeh[7], -1);
  2333.             AI::TASK_VEHICLE_DRIVE_TO_COORD(scPed[7], scVeh[7], 153.3, -1050.86, 29.26, 200.0, 0, 0, 786599, 5.0, 2.0);
  2334.         }
  2335.  
  2336.         if (ENTITY::IS_ENTITY_DEAD(playerPed)) { setTextMsg(1000, "Damn it! And I thought you were the one!"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); break; cleanupMissions(1); }
  2337.         if (ENTITY::IS_ENTITY_DEAD(scVeh[7])) { setTextMsg(1000, "How did the vehicle blow up!? It's supposed to be armored!"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0); break; cleanupMissions(1); }
  2338.         if (ENTITY::IS_ENTITY_AT_COORD(scVeh[7], 135.3, -1050.86, 29.2, 70, 70, 70, 0, 1, 0)) { stage3 = true; CONTROLS::DISABLE_ALL_CONTROL_ACTIONS(0); }
  2339.  
  2340.     }
  2341.  
  2342.  
  2343.     if (stage3){
  2344.         stopMusic();
  2345.         WAIT(1000);
  2346.         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  2347.         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2348.         PLAYER::SET_MAX_WANTED_LEVEL(0);
  2349.         WAIT(2000);
  2350.         setTextMsg(1000, "Wow that was impressive. I think Weazel news is gonna have a blast tonight."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2351.         WAIT(2000);
  2352.         CONTROLS::ENABLE_ALL_CONTROL_ACTIONS(0);
  2353.         while (PED::IS_PED_IN_VEHICLE(playerPed, scVeh[7], true)) { WAIT(0); message("Get out of the Insurgent."); }
  2354.         AI::TASK_SMART_FLEE_COORD(scPed[7], ENTITY::GET_ENTITY_COORDS(scPed[7], true).x, ENTITY::GET_ENTITY_COORDS(scPed[7], true).y, ENTITY::GET_ENTITY_COORDS(scPed[7], true).z, 1000.0, -1, 1, 0);
  2355.         WAIT(5000);
  2356.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[7]);
  2357.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[6]);
  2358.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scPed[7]);
  2359.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[8]);
  2360.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[9]);
  2361.         ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&scVeh[10]);
  2362.         setTextMsg(1000, "Okay wait a little moment... I'll send you a message when I'll transfer the cash."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2363.         WAIT(20000);
  2364.         setTextMsg(1000, "Alright, time for a little clean up."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2365.         WAIT(2000);
  2366.         Vector3 oldpos;
  2367.         oldpos = ENTITY::GET_ENTITY_COORDS(playerPed, false);
  2368.         setTextMsg(1000, "The guy who drove the Insurgent is at Del Perro Beach."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2369.         WAIT(2000);
  2370.         DWORD pedH;
  2371.         pedH = GAMEPLAY::GET_HASH_KEY("G_M_Y_KorLieut_01");
  2372.         STREAMING::REQUEST_MODEL(pedH);
  2373.         while (!STREAMING::HAS_MODEL_LOADED(pedH)) WAIT(100);
  2374.         scPed[6] = PED::CREATE_PED(26, pedH, -1836, -1248, 13.02, 144, false, true);
  2375.         Any cam, cam2;
  2376.         cam = CAM::CREATE_CAMERA_WITH_PARAMS(0x19286a9, CAM::_0xA200EB1EE790F448().x, CAM::_0xA200EB1EE790F448().y, CAM::_0xA200EB1EE790F448().z, CAM::_0x5B4E4C817FCC2DFB(2).x, CAM::_0x5B4E4C817FCC2DFB(2).y, CAM::_0x5B4E4C817FCC2DFB(2).z, CAM::_0x80EC114669DAEFF4(), 1, 2);
  2377.         cam2 = CAM::CREATE_CAMERA_WITH_PARAMS(0x19286a9, CAM::_0xA200EB1EE790F448().x, CAM::_0xA200EB1EE790F448().y, CAM::_0xA200EB1EE790F448().z, CAM::_0x5B4E4C817FCC2DFB(2).x, CAM::_0x5B4E4C817FCC2DFB(2).y, CAM::_0x5B4E4C817FCC2DFB(2).z, CAM::_0x80EC114669DAEFF4(), 1, 2);
  2378.         //CAM::POINT_CAM_AT_ENTITY(cam, scPed[6], 1.5073, 1.6429, 0.717, 1);
  2379.         //CAM::ATTACH_CAM_TO_ENTITY(cam, scPed[6], 2.582200050354, 2.3028998374938965, 1.0527, 1);
  2380.         CAM::POINT_CAM_AT_COORD(cam2, -1789, -1203, 13.01);
  2381.         CAM::SET_CAM_COORD(cam, -1816.77, -1249.5, 15);
  2382.         CAM::SET_CAM_COORD(cam2, -1760, -1207, 18);
  2383.         CAM::SET_CAM_ACTIVE(cam, true);
  2384.         CAM::SET_CAM_ACTIVE_WITH_INTERP(cam2, cam, 35000, true, true);
  2385.         CAM::DO_SCREEN_FADE_OUT(1000);
  2386.         while (!CAM::IS_SCREEN_FADED_OUT()) {
  2387.             WAIT(0);
  2388.         }
  2389.         ENTITY::SET_ENTITY_COORDS(playerPed, -1816, -1210, 14, 1, false, false, false);
  2390.         CAM::DO_SCREEN_FADE_IN(1000);
  2391.         CAM::RENDER_SCRIPT_CAMS(1, 0, 3000, 1, 0);
  2392.         while (!CAM::IS_SCREEN_FADED_IN()) {
  2393.             WAIT(0);
  2394.         }
  2395.         PLAYER::SET_PLAYER_WANTED_LEVEL(player, 0, false);
  2396.         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, false);
  2397.         AI::TASK_WANDER_STANDARD(scPed[6], 0x471c4000, 0);
  2398.         UI::DISPLAY_RADAR(0);
  2399.         CAM::_0xF8BDBF3D573049A1(0.95f);
  2400.         setTextMsg(1000, "Don't worry, you've done enough."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2401.         WAIT(5000);
  2402.         setTextMsg(1000, "I just sent one guy do the job. I trust him."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2403.         WAIT(6000);
  2404.         setTextMsg(1000, "You know you did good out there. Money get's transfered very often to various banks."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2405.         WAIT(6000);
  2406.         scPed[7] = PED::CREATE_PED(26, pedH, -1793, -1197, 13.05, 144, false, true);
  2407.         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(scPed[7], GAMEPLAY::GET_HASH_KEY("WEAPON_PISTOL"), 100, false);
  2408.         AI::TASK_COMBAT_PED(scPed[7], scPed[6], 0, 16);
  2409.         setTextMsg(1000, "The regular guys prefer to rob the bank, I prefer to steal the money from the bank account."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2410.         WAIT(4000);
  2411.         setTextMsg(1000, "I've got someone who works in a big bank, he takes a fair cut but atleast I get the money."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2412.         WAIT(4000);
  2413.         setTextMsg(1000, "And I don't even have to fire a single shot. Isn't this amazing?"); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2414.         WAIT(4000);
  2415.         setTextMsg(1000, "I'm gonna receive a call in a minute from the guy I sent that the target's dead."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2416.         WAIT(5000);
  2417.         setTextMsg(1000, "If you worry about the same happening to you, don't. You're far too valuable."); AUDIO::PLAY_SOUND_FRONTEND(-1, "Text_Arrive_Tone", "Phone_SoundSet_Default", 0);
  2418.         WAIT(4000);
  2419.         UI::DISPLAY_RADAR(1);
  2420.         CAM::DO_SCREEN_FADE_OUT(1000);
  2421.         while (!CAM::IS_SCREEN_FADED_OUT()) {
  2422.             WAIT(0);
  2423.         }
  2424.         ENTITY::SET_ENTITY_COORDS(playerPed, oldpos.x, oldpos.y, oldpos.z + 1.0f, 1, false, false, false);
  2425.         CAM::DO_SCREEN_FADE_IN(1000);
  2426.         CAM::RENDER_SCRIPT_CAMS(1, 0, 3000, 1, 0);
  2427.         while (!CAM::IS_SCREEN_FADED_IN()) {
  2428.             WAIT(0);
  2429.         }
  2430.         CAM::DESTROY_CAM(cam, 0);
  2431.         CAM::RENDER_SCRIPT_CAMS(0, 0, 3000, 1, 0);
  2432.  
  2433.         int pId;
  2434.         if (ENTITY::GET_ENTITY_MODEL(playerPed) == GAMEPLAY::GET_HASH_KEY("Player_Zero")) pId = 0;
  2435.         if (ENTITY::GET_ENTITY_MODEL(playerPed) == GAMEPLAY::GET_HASH_KEY("Player_One")) pId = 1;
  2436.         if (ENTITY::GET_ENTITY_MODEL(playerPed) == GAMEPLAY::GET_HASH_KEY("Player_Two")) pId = 2;
  2437.  
  2438.         int val;
  2439.         char statNameFull[32];
  2440.         sprintf_s(statNameFull, "SP%d_TOTAL_CASH", pId);
  2441.         Hash hash = GAMEPLAY::GET_HASH_KEY(statNameFull);
  2442.         STATS::STAT_GET_INT(hash, &val, -1);
  2443.  
  2444.         val += rand() % (5000000 - 3500000 + 1) + 3500000;
  2445.         STATS::STAT_SET_INT(hash, val, 1);
  2446.         PLAYER::SET_MAX_WANTED_LEVEL(5);
  2447.         cleanupMissions(1);
  2448.     }
  2449.  
  2450.     cleanupMissions(1);
  2451.  
  2452.  
  2453. }
  2454.  
  2455.  
  2456.  
  2457. void recruit_checks()
  2458. {
  2459.  
  2460.     // RECRUIT ZONE
  2461.     if (ENTITY::IS_ENTITY_AT_COORD(playerPed, 144.805, -1060.32, 29.2, 7.0f, 7.0f, 5.0f, 0, 1, 0) && !menuDisplayed[1]) {
  2462.         menu(true, 0);
  2463.         menuDisplayed[1] = true;
  2464.     }
  2465.     if (!ENTITY::IS_ENTITY_AT_COORD(playerPed, 144.805, -1060.32, 29.2, 7.0f, 7.0f, 5.0f, 0, 1, 0)) menuDisplayed[1] = false;
  2466.  
  2467.     // RECRUIT CHECKS
  2468.     if (menuDisplayed[1]) {
  2469.         // right button
  2470.         if (GetAsyncKeyState('K') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 190))  {
  2471.             recruit(0);
  2472.             WAIT(1000);
  2473.         }
  2474.         // left button
  2475.         if (GetAsyncKeyState('L') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 189)) {
  2476.             recruit(1);
  2477.             WAIT(1000);
  2478.         }
  2479.         // left stick
  2480.         if ((GetAsyncKeyState('J') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 209)) && !GetAsyncKeyState(0x10)) {
  2481.             recruit(2);
  2482.             WAIT(1000);
  2483.         }
  2484.     }
  2485.  
  2486.  
  2487. }
  2488.  
  2489. void menu_title(int font, char * text)
  2490. {
  2491.     UI::SET_TEXT_FONT(font);
  2492.     UI::SET_TEXT_SCALE(0.8f, 0.8f);
  2493.     if(isAtRedHouse1) UI::SET_TEXT_COLOUR(255, 150, 255, 255);
  2494.     UI::SET_TEXT_WRAP(0.0, 1.0);
  2495.     UI::SET_TEXT_CENTRE(true);
  2496.     UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);
  2497.     UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  2498.     UI::_SET_TEXT_ENTRY("STRING");
  2499.     UI::_ADD_TEXT_COMPONENT_STRING(text);
  2500.     UI::_DRAW_TEXT(0.25, 0.375);
  2501.  
  2502.     UI::SET_TEXT_FONT(font);
  2503.     UI::SET_TEXT_SCALE(0.35f, 0.35f);
  2504.     UI::SET_TEXT_COLOUR(255, 255, 150, 255);
  2505.     UI::SET_TEXT_WRAP(0.0, 1.0);
  2506.     UI::SET_TEXT_CENTRE(true);
  2507.     UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);
  2508.     UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  2509.     UI::_SET_TEXT_ENTRY("STRING");
  2510.     if (random_text == 0) UI::_ADD_TEXT_COMPONENT_STRING("I hope one of these contract interest you. - Shan");
  2511.     if (random_text == 1) UI::_ADD_TEXT_COMPONENT_STRING("Don't hesitate to come back, there is always work. - Shan");
  2512.     if (random_text == 2) UI::_ADD_TEXT_COMPONENT_STRING("With this kind of payout, even cops will start working for me. - Shan");
  2513.     if (random_text == 3) UI::_ADD_TEXT_COMPONENT_STRING("Still looking to buy that Golf thing ? - Shan");
  2514.     if (random_text == 4) UI::_ADD_TEXT_COMPONENT_STRING("Don't hesitate to recruit some men, they can help. - Shan");
  2515.     if (random_text == 5) UI::_ADD_TEXT_COMPONENT_STRING("Don't hesitate to recruit some men, they can help. - Shan");
  2516.     // JACK
  2517.     if (random_text == 6) UI::_ADD_TEXT_COMPONENT_STRING("Ain't no Shan here, can't just show up with an RPG. - Roy");
  2518.     if (random_text == 7) UI::_ADD_TEXT_COMPONENT_STRING("We can't just blow up stuff and call it a day. - Roy");
  2519.     if (random_text == 8) UI::_ADD_TEXT_COMPONENT_STRING("Shan loves paper, I prefer bank transfers. - Roy");
  2520.     if (random_text == 9) UI::_ADD_TEXT_COMPONENT_STRING("We only work at night here. - Roy");
  2521.     if (random_text == 10) UI::_ADD_TEXT_COMPONENT_STRING("I hope you can see in the dark, friend. - Roy");
  2522.     if (random_text == 11) UI::_ADD_TEXT_COMPONENT_STRING("I pay more, but no explosions alright?. - Roy");
  2523.     UI::_DRAW_TEXT(0.25, 0.585);
  2524. }
  2525.  
  2526. void menu_line()
  2527. {
  2528.     float scrp;
  2529.     if (uiSelected == 0) { scrp = 0.45; }
  2530.     if (uiSelected == 1) { scrp = 0.50; }
  2531.     if (uiSelected == 2) { scrp = 0.55; }
  2532.     GRAPHICS::DRAW_RECT(0.25, scrp, 0.25, 0.05, 0, 20, 120, 80);
  2533.  
  2534.     std::string tmp;
  2535.  
  2536.     UI::SET_TEXT_FONT(0);
  2537.     UI::SET_TEXT_SCALE(0.45f, 0.45f);
  2538.     if(isAtRedHouse1) UI::SET_TEXT_COLOUR(120, 0, 0, 220);
  2539.     UI::SET_TEXT_WRAP(0.0, 1.0);
  2540.     UI::SET_TEXT_CENTRE(true);
  2541.     UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);
  2542.     UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  2543.     UI::_SET_TEXT_ENTRY("STRING");
  2544.  
  2545.     UI::_ADD_TEXT_COMPONENT_STRING((char*)contracts[0].c_str());
  2546.     UI::_DRAW_TEXT(0.25, 0.435);
  2547.  
  2548.     // line 2
  2549.     UI::SET_TEXT_FONT(0);
  2550.     UI::SET_TEXT_SCALE(0.45f, 0.45f);
  2551.     if (isAtRedHouse1) UI::SET_TEXT_COLOUR(120, 0, 0, 220);
  2552.     UI::SET_TEXT_WRAP(0.0, 1.0);
  2553.     UI::SET_TEXT_CENTRE(true);
  2554.     UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);
  2555.     UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  2556.     UI::_SET_TEXT_ENTRY("STRING");
  2557.  
  2558.     tmp = "";
  2559.     tmp += " ~w~(~g~$50,000~w~)";
  2560.  
  2561.     UI::_ADD_TEXT_COMPONENT_STRING((char*)contracts[1].c_str());
  2562.     UI::_DRAW_TEXT(0.25, 0.485);
  2563.  
  2564.     // line 3
  2565.     UI::SET_TEXT_FONT(0);
  2566.     UI::SET_TEXT_SCALE(0.45f, 0.45f);
  2567.     if (isAtRedHouse1) UI::SET_TEXT_COLOUR(120, 0, 0, 220);
  2568.     UI::SET_TEXT_WRAP(0.0, 1.0);
  2569.     UI::SET_TEXT_CENTRE(true);
  2570.     UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0);
  2571.     UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  2572.     UI::_SET_TEXT_ENTRY("STRING");
  2573.  
  2574.     tmp = "";
  2575.     tmp += " ~w~(~g~$50,000~w~)";
  2576.  
  2577.     UI::_ADD_TEXT_COMPONENT_STRING((char*)contracts[2].c_str());
  2578.     UI::_DRAW_TEXT(0.25, 0.535);
  2579. }
  2580.  
  2581. void menuHandler()
  2582. {
  2583.     // SHITTY ANIMATION
  2584.     if (rand() % 2 == 0)blue++;
  2585.     if (blue % 2 == 0 && rand() % 2 == 0) blue--;
  2586.     if (blue > 20) blue -= 10;
  2587.  
  2588.  
  2589.     // BASE RECTANGLE BACKGROUND
  2590.     GRAPHICS::DRAW_RECT(0.25, 0.5, 0.25, 0.25, blue / 2, 0, blue, 50);
  2591.  
  2592.     GRAPHICS::DRAW_RECT(0.25, 0.40, 0.25, 0.05, 0, 0, 50, 100);
  2593.     // SELECTED RECTANGLE
  2594.  
  2595.     if(isAtRedHouse1) menu_title(1, "Contracts available");
  2596.     menu_line();
  2597.  
  2598.     if ((GetAsyncKeyState(VK_NUMPAD5) || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 190)) && press_B_tick == 0)
  2599.     {
  2600.         fiveTick++;
  2601.         if (fiveTick > 4){
  2602.             fiveTick = 0;
  2603.             if (isAtRedHouse1){
  2604.                 AUDIO::PLAY_SOUND_FRONTEND(-1, "HACKING_CLICK_BAD", 0, 1);
  2605.                 press_B_tick = 0;
  2606.                 if (randContract[uiSelected] == 1) { selectedType = 1; setup_Assassination(); }
  2607.                 if (randContract[uiSelected] == 2) { selectedType = 2; setup_mobClean(); }
  2608.                 if (randContract[uiSelected] == 3) { selectedType = 3; setup_protect(); }
  2609.                 if (randContract[uiSelected] == 4) { selectedType = 4; heist_1(); }
  2610.                 if (randContract[uiSelected] == 5) { selectedType = 5; setup_dealbreak(); }
  2611.             }
  2612.         }
  2613.     }
  2614.  
  2615.     if ((GetAsyncKeyState(VK_NUMPAD2) || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 187)) && press_B_tick == 0)
  2616.     {
  2617.         AUDIO::PLAY_SOUND_FRONTEND(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
  2618.         press_B_tick = 52;
  2619.         uiSelected++;
  2620.         if (uiSelected > 2) uiSelected = 0;
  2621.     }
  2622.    
  2623.  
  2624.     if ((GetAsyncKeyState(VK_NUMPAD8) || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 188)) && press_B_tick == 0)
  2625.     {
  2626.         AUDIO::PLAY_SOUND_FRONTEND(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
  2627.         press_B_tick = 52;
  2628.         uiSelected--;
  2629.         if (uiSelected > 2) uiSelected = 0;
  2630.         if (uiSelected < 0) uiSelected = 2;
  2631.     }
  2632.  
  2633.  
  2634. }
  2635.  
  2636. void update()
  2637. {
  2638.  
  2639.     player = PLAYER::PLAYER_ID();
  2640.     playerPed = PLAYER::PLAYER_PED_ID();
  2641.     position = ENTITY::GET_ENTITY_COORDS(playerPed, 1);
  2642.     //GAMEPLAY::SET_MISSION_FLAG(0);
  2643.     //randtick++;
  2644.  
  2645.     // MENU DISPLAYED IDs
  2646.     // 0 :: RED HOUSE 1 CONTRACT ZONE
  2647.     // 1 :: RED HOUSE 1 RECRUIT ZONE
  2648.     // 2 :: RED HOUSE 2 CONTRACT ZONE
  2649.     // 3 :: RED HOUSE 2 RECRUIT ZONE
  2650.  
  2651.     if (GetAsyncKeyState('J') && press_B_tick == 0)
  2652.     {
  2653.         std::string mystr;
  2654.         mystr = std::to_string(ENTITY::GET_ENTITY_HEADING(playerPed));
  2655.         setTextMsg(0, (char*)mystr.c_str());
  2656.         press_B_tick++;
  2657.     }
  2658.  
  2659.  
  2660.  
  2661.     // TICKS
  2662.     if (press_B_tick > 0) press_B_tick++;
  2663.     if (press_B_tick > 60) press_B_tick = 0;
  2664.  
  2665.     // AIR CHECKS
  2666.     isInAir = false;
  2667.     if (PED::IS_PED_IN_FLYING_VEHICLE(playerPed)) isInAir = true;
  2668.     if (ENTITY::IS_ENTITY_IN_WATER(playerPed)) isInAir = true;
  2669.     if (PED::IS_PED_IN_ANY_BOAT(playerPed)) isInAir = true;
  2670.  
  2671.     bodyguards_leave();
  2672.     check();
  2673.     recruit_checks();
  2674.     debug_func();
  2675.  
  2676.     if (!mission) {
  2677.         redhouse_1();
  2678.     }
  2679.     else {
  2680.         // SAVING ON IF STATEMENTS - IF IN MISSION THEN PRESSING O WILL CANCEL MISSION
  2681.         // PRESSING O ONLY WHEN POSSIBLE.
  2682.         // MADE SO THAT YOU CAN CANCEL REALLY QUICK WITHOUT IT LAGGING OUT.
  2683.         //if (canCancel) { if (GetAsyncKeyState('O') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 190) && CONTROLS::IS_CONTROL_JUST_PRESSED(0, 204)) { cleanupMissions(1); } }
  2684.         if (canCancel) { if (GetAsyncKeyState('O') || CONTROLS::IS_CONTROL_JUST_PRESSED(0, 52)) { cleanupMissions(1); } }
  2685.         // IS PLAYER DEAD?
  2686.         basic_check();
  2687.     }
  2688.  
  2689.    
  2690.  
  2691.  
  2692. }
  2693.  
  2694.  
  2695. void main()
  2696. {
  2697.     //WAIT(10000);
  2698.     while (true)
  2699.     {
  2700.         update();
  2701.         WAIT(0);
  2702.     }
  2703. }
  2704.  
  2705. void ScriptMain()
  2706. {
  2707.     srand(GetTickCount());
  2708.     main();
  2709. }
RAW Paste Data