GoroUnreal

NativeTrainer - GU Version 1.1 Source

Apr 27th, 2015
3,817
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK
  3.                 http://dev-c.com           
  4.             (C) Alexander Blade 2015
  5. */
  6.  
  7. /*
  8.     F4                  activate
  9.     NUM2/8/4/6          navigate thru the menus and lists (numlock must be on)
  10.     NUM5                select
  11.     NUM0/BACKSPACE/F4   back
  12.     NUM9/3              use vehicle boost when active
  13.     NUM+                use vehicle rockets when active
  14. */
  15.  
  16. #include "script.h"
  17.  
  18. #include <string>
  19. #include <ctime>
  20.  
  21. // GU includes
  22. #include <iostream>
  23. #include <fstream>
  24. #include <sstream>
  25. #include <vector>
  26. #include <math.h>
  27. // End
  28.  
  29. #pragma warning(disable : 4244 4305) // double <-> float conversions
  30.  
  31. void draw_rect(float A_0, float A_1, float A_2, float A_3, int A_4, int A_5, int A_6, int A_7)
  32. {
  33.     GRAPHICS::DRAW_RECT((A_0 + (A_2 * 0.5f)), (A_1 + (A_3 * 0.5f)), A_2, A_3, A_4, A_5, A_6, A_7);
  34. }
  35.  
  36. void draw_menu_line(std::string caption, float lineWidth, float lineHeight, float lineTop, float lineLeft, float textLeft, bool active, bool title, bool rescaleText = true)
  37. {
  38.     // default values
  39.     int text_col[4] = {255, 255, 255, 255},
  40.         rect_col[4] = {70, 95, 95, 255};
  41.     float text_scale = 0.35;
  42.     int font = 0;
  43.  
  44.     // correcting values for active line
  45.     if (active)
  46.     {
  47.         text_col[0] = 0;
  48.         text_col[1] = 0;
  49.         text_col[2] = 0;
  50.  
  51.         rect_col[0] = 218;
  52.         rect_col[1] = 242;
  53.         rect_col[2] = 216;
  54.  
  55.         if (rescaleText) text_scale = 0.40;
  56.     }
  57.  
  58.     if (title)
  59.     {
  60.         rect_col[0] = 0;
  61.         rect_col[1] = 0;
  62.         rect_col[2] = 0;
  63.  
  64.         if (rescaleText) text_scale = 0.50;
  65.         font = 1;
  66.     }
  67.  
  68.     int screen_w, screen_h;
  69.     GRAPHICS::GET_SCREEN_RESOLUTION(&screen_w, &screen_h);
  70.  
  71.     textLeft += lineLeft;
  72.  
  73.     float lineWidthScaled = lineWidth / (float)screen_w; // line width
  74.     float lineTopScaled = lineTop / (float)screen_h; // line top offset
  75.     float textLeftScaled = textLeft / (float)screen_w; // text left offset
  76.     float lineHeightScaled = lineHeight / (float)screen_h; // line height
  77.  
  78.     float lineLeftScaled = lineLeft / (float)screen_w;
  79.  
  80.     // this is how it's done in original scripts
  81.  
  82.     // text upper part
  83.     UI::SET_TEXT_FONT(font);
  84.     UI::SET_TEXT_SCALE(0.0, text_scale);
  85.     UI::SET_TEXT_COLOUR(text_col[0], text_col[1], text_col[2], text_col[3]);
  86.     UI::SET_TEXT_CENTRE(0);
  87.     UI::SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0);
  88.     UI::SET_TEXT_EDGE(0, 0, 0, 0, 0);
  89.     UI::_SET_TEXT_ENTRY("STRING");
  90.     UI::_ADD_TEXT_COMPONENT_STRING((LPSTR)caption.c_str());
  91.     UI::_DRAW_TEXT(textLeftScaled, (((lineTopScaled + 0.00278f) + lineHeightScaled) - 0.005f));
  92.  
  93.     // text lower part
  94.     UI::SET_TEXT_FONT(font);
  95.     UI::SET_TEXT_SCALE(0.0, text_scale);
  96.     UI::SET_TEXT_COLOUR(text_col[0], text_col[1], text_col[2], text_col[3]);
  97.     UI::SET_TEXT_CENTRE(0);
  98.     UI::SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0);
  99.     UI::SET_TEXT_EDGE(0, 0, 0, 0, 0);
  100.     UI::_0x521FB041D93DD0E4("STRING");
  101.     UI::_ADD_TEXT_COMPONENT_STRING((LPSTR)caption.c_str());
  102.     int num25 = UI::_0x9040DFB09BE75706(textLeftScaled, (((lineTopScaled + 0.00278f) + lineHeightScaled) - 0.005f));
  103.  
  104.     // rect
  105.     draw_rect(lineLeftScaled, lineTopScaled + (0.00278f),
  106.         lineWidthScaled, ((((float)(num25)* UI::_0xDB88A37483346780(text_scale, 0)) + (lineHeightScaled * 2.0f)) + 0.005f),
  107.         rect_col[0], rect_col[1], rect_col[2], rect_col[3]);   
  108. }
  109.  
  110. bool get_key_pressed(int nVirtKey)
  111. {
  112.     //return (GetKeyState(nVirtKey) & 0x8000) != 0;
  113.     return (GetAsyncKeyState(nVirtKey) & 0x8000) != 0;
  114. }
  115.  
  116. DWORD trainerResetTime = 0;
  117.  
  118. bool trainer_switch_pressed()
  119. {
  120.     return (GetTickCount() > trainerResetTime + 1000) && get_key_pressed(VK_F4);
  121. }
  122.  
  123. void reset_trainer_switch()
  124. {
  125.     trainerResetTime = GetTickCount();
  126. }
  127.  
  128. void get_button_state(bool *a, bool *b, bool *up, bool *down, bool *l, bool *r)
  129. {
  130.     if (a) *a = get_key_pressed(VK_NUMPAD5);
  131.     if (b) *b = get_key_pressed(VK_NUMPAD0) || trainer_switch_pressed() || get_key_pressed(VK_BACK);
  132.     if (up) *up = get_key_pressed(VK_NUMPAD8);
  133.     if (down) *down = get_key_pressed(VK_NUMPAD2);
  134.     if (r) *r = get_key_pressed(VK_NUMPAD6);
  135.     if (l) *l = get_key_pressed(VK_NUMPAD4);
  136. }
  137.  
  138. void menu_beep()
  139. {
  140.     AUDIO::PLAY_SOUND_FRONTEND(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", 0);
  141. }
  142.  
  143. std::string statusText;
  144. DWORD statusTextDrawTicksMax;
  145. bool statusTextGxtEntry;
  146.  
  147. void update_status_text()
  148. {
  149.     if (GetTickCount() < statusTextDrawTicksMax)
  150.     {
  151.         UI::SET_TEXT_FONT(0);
  152.         UI::SET_TEXT_SCALE(0.55, 0.55);
  153.         UI::SET_TEXT_COLOUR(255, 255, 255, 255);
  154.         UI::SET_TEXT_WRAP(0.0, 1.0);
  155.         UI::SET_TEXT_CENTRE(1);
  156.         UI::SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0);
  157.         UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
  158.         if (statusTextGxtEntry)
  159.         {
  160.             UI::_SET_TEXT_ENTRY((char *)statusText.c_str());
  161.         } else
  162.         {
  163.             UI::_SET_TEXT_ENTRY("STRING");
  164.             UI::_ADD_TEXT_COMPONENT_STRING((char *)statusText.c_str());
  165.         }
  166.         UI::_DRAW_TEXT(0.5, 0.5);
  167.     }
  168. }
  169.  
  170. void set_status_text(std::string str, DWORD time = 2500, bool isGxtEntry = false)
  171. {
  172.     statusText = str;
  173.     statusTextDrawTicksMax = GetTickCount() + time;
  174.     statusTextGxtEntry = isGxtEntry;
  175. }
  176.  
  177. // features
  178. bool featurePlayerInvincible            =   false;
  179. bool featurePlayerInvincibleUpdated     =   false;
  180. bool featurePlayerNeverWanted           =   false;
  181. bool featurePlayerIgnored               =   false;
  182. bool featurePlayerIgnoredUpdated        =   false;
  183. bool featurePlayerUnlimitedAbility      =   false;
  184. bool featurePlayerNoNoise               =   false;
  185. bool featurePlayerNoNoiseUpdated        =   false;
  186. bool featurePlayerFastSwim              =   false;
  187. bool featurePlayerFastSwimUpdated       =   false;
  188. bool featurePlayerFastRun               =   false;
  189. bool featurePlayerFastRunUpdated        =   false;
  190. bool featurePlayerSuperJump             =   false;
  191.  
  192. bool featureWeaponNoReload              =   false;
  193. bool featureWeaponFireAmmo              =   false;
  194. bool featureWeaponExplosiveAmmo         =   false;
  195. bool featureWeaponExplosiveMelee        =   false;
  196. bool featureWeaponVehRockets            =   false;
  197.  
  198. DWORD featureWeaponVehShootLastTime     =   0;
  199.  
  200. bool featureVehInvincible               =   false;
  201. bool featureVehInvincibleUpdated        =   false;
  202. bool featureVehSpeedBoost               =   false;
  203. bool featureVehWrapInSpawned            =   false;
  204.  
  205. bool featureWorldMoonGravity            =   false;
  206. bool featureWorldRandomCops             =   true;
  207. bool featureWorldRandomTrains           =   true;
  208. bool featureWorldRandomBoats            =   true;
  209. bool featureWorldGarbageTrucks          =   true;
  210.  
  211. bool featureTimePaused                  =   false;
  212. bool featureTimePausedUpdated           =   false;
  213. bool featureTimeSynced                  =   false;
  214.  
  215. bool featureWeatherWind                 =   false;
  216.  
  217. bool featureMiscLockRadio               =   false;
  218. bool featureMiscHideHud                 =   false;
  219.  
  220. // GU feature toggles
  221. bool featureChangePosHoldPos = false;
  222. bool featureMiscMobileRadio = false;
  223.  
  224. // player model control, switching on normal ped model when needed 
  225.  
  226. LPCSTR animalModels[] = { "a_c_boar", "a_c_chimp", "a_c_cow", "a_c_coyote", "a_c_deer", "a_c_fish", "a_c_hen", "a_c_cat_01", "a_c_chickenhawk",
  227.     "a_c_cormorant", "a_c_crow", "a_c_dolphin", "a_c_humpback", "a_c_killerwhale", "a_c_pigeon", "a_c_seagull", "a_c_sharkhammer",
  228.     "a_c_pig", "a_c_rat", "a_c_rhesus", "a_c_chop", "a_c_husky", "a_c_mtlion", "a_c_retriever", "a_c_sharktiger", "a_c_shepherd" };
  229.  
  230. void check_player_model()
  231. {
  232.     // common variables
  233.     Player player = PLAYER::PLAYER_ID();
  234.     Ped playerPed = PLAYER::PLAYER_PED_ID();   
  235.  
  236.     if (!ENTITY::DOES_ENTITY_EXIST(playerPed)) return;
  237.  
  238.     Hash model = ENTITY::GET_ENTITY_MODEL(playerPed);
  239.     if (ENTITY::IS_ENTITY_DEAD(playerPed))
  240.         for (int i = 0; i < (sizeof(animalModels) / sizeof(animalModels[0])); i++)
  241.             if (GAMEPLAY::GET_HASH_KEY((char *)animalModels[i]) == model)
  242.             {
  243.                 set_status_text("turning to human");
  244.                 model = GAMEPLAY::GET_HASH_KEY("player_zero");
  245.                 STREAMING::REQUEST_MODEL(model);
  246.                 while (!STREAMING::HAS_MODEL_LOADED(model))
  247.                     WAIT(0);
  248.                 PLAYER::SET_PLAYER_MODEL(PLAYER::PLAYER_ID(), model);
  249.                 PED::SET_PED_DEFAULT_COMPONENT_VARIATION(PLAYER::PLAYER_PED_ID());
  250.                 STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(model);
  251.  
  252.                 // wait until player is ressurected
  253.                 while (ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID()))
  254.                     WAIT(0);
  255.  
  256.                 break;
  257.             }
  258. }
  259.  
  260. void update_vehicle_guns()
  261. {
  262.     Player player = PLAYER::PLAYER_ID();
  263.     Ped playerPed = PLAYER::PLAYER_PED_ID();   
  264.  
  265.     if (!ENTITY::DOES_ENTITY_EXIST(playerPed) || !featureWeaponVehRockets) return;
  266.  
  267.     bool bSelect = get_key_pressed(0x6B); // num plus
  268.     if (bSelect && featureWeaponVehShootLastTime + 150 < GetTickCount() &&
  269.         PLAYER::IS_PLAYER_CONTROL_ON(player) && PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  270.     {
  271.         Vehicle veh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
  272.  
  273.         Vector3 v0, v1;
  274.         GAMEPLAY::GET_MODEL_DIMENSIONS(ENTITY::GET_ENTITY_MODEL(veh), &v0, &v1);
  275.  
  276.         Hash weaponAssetRocket = GAMEPLAY::GET_HASH_KEY("WEAPON_VEHICLE_ROCKET");
  277.         if (!WEAPON::HAS_WEAPON_ASSET_LOADED(weaponAssetRocket))
  278.         {
  279.             WEAPON::REQUEST_WEAPON_ASSET(weaponAssetRocket, 31, 0);
  280.             while (!WEAPON::HAS_WEAPON_ASSET_LOADED(weaponAssetRocket))
  281.                 WAIT(0);
  282.         }
  283.  
  284.         Vector3 coords0from = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(veh, -(v1.x + 0.25f), v1.y + 1.25f, 0.1);
  285.         Vector3 coords1from = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(veh,  (v1.x + 0.25f), v1.y + 1.25f, 0.1);
  286.         Vector3 coords0to = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(veh, -v1.x, v1.y + 100.0f, 0.1f);
  287.         Vector3 coords1to = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(veh,  v1.x, v1.y + 100.0f, 0.1f);
  288.  
  289.         GAMEPLAY::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords0from.x, coords0from.y, coords0from.z,
  290.                                                      coords0to.x, coords0to.y, coords0to.z,
  291.                                                      250, 1, weaponAssetRocket, playerPed, 1, 0, -1.0);
  292.         GAMEPLAY::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords1from.x, coords1from.y, coords1from.z,
  293.                                                      coords1to.x, coords1to.y, coords1to.z,
  294.                                                      250, 1, weaponAssetRocket, playerPed, 1, 0, -1.0);
  295.  
  296.         featureWeaponVehShootLastTime = GetTickCount();
  297.     }
  298. }
  299.  
  300. bool skinchanger_used = false;
  301.  
  302. // Updates all features that can be turned off by the game, being called each game frame
  303. void update_features()
  304. {
  305.     update_status_text();
  306.  
  307.     update_vehicle_guns();
  308.  
  309.     // changing player model if died while being an animal, since it can cause inf loading loop
  310.     if (skinchanger_used)
  311.         check_player_model();
  312.  
  313.     // read default feature values from the game
  314.     featureWorldRandomCops = PED::CAN_CREATE_RANDOM_COPS() == TRUE;
  315.  
  316.     // common variables
  317.     Player player = PLAYER::PLAYER_ID();
  318.     Ped playerPed = PLAYER::PLAYER_PED_ID();   
  319.     BOOL bPlayerExists = ENTITY::DOES_ENTITY_EXIST(playerPed);
  320.  
  321.     // player invincible
  322.     if (featurePlayerInvincibleUpdated)
  323.     {
  324.         if (bPlayerExists && !featurePlayerInvincible)
  325.             PLAYER::SET_PLAYER_INVINCIBLE(player, FALSE);
  326.         featurePlayerInvincibleUpdated = false;
  327.     }
  328.     if (featurePlayerInvincible)
  329.     {
  330.         if (bPlayerExists)
  331.             PLAYER::SET_PLAYER_INVINCIBLE(player, TRUE);
  332.     }
  333.  
  334.     // player never wanted
  335.     if (featurePlayerNeverWanted)
  336.     {
  337.         if (bPlayerExists)
  338.             PLAYER::CLEAR_PLAYER_WANTED_LEVEL(player);
  339.     }
  340.  
  341.     // police ignore player
  342.     if (featurePlayerIgnoredUpdated)
  343.     {
  344.         if (bPlayerExists)
  345.             PLAYER::SET_POLICE_IGNORE_PLAYER(player, featurePlayerIgnored);
  346.         featurePlayerIgnoredUpdated = false;
  347.     }
  348.  
  349.     // player special ability
  350.     if (featurePlayerUnlimitedAbility)
  351.     {
  352.         if (bPlayerExists)
  353.             PLAYER::_RECHARGE_SPECIAL_ABILITY(player, 1);
  354.     }
  355.  
  356.     // player no noise
  357.     if (featurePlayerNoNoiseUpdated)
  358.     {
  359.         if (bPlayerExists && !featurePlayerNoNoise)
  360.             PLAYER::SET_PLAYER_NOISE_MULTIPLIER(player, 1.0);
  361.         featurePlayerNoNoiseUpdated = false;
  362.     }
  363.     if (featurePlayerNoNoise)
  364.         PLAYER::SET_PLAYER_NOISE_MULTIPLIER(player, 0.0);
  365.  
  366.     // player fast swim
  367.     if (featurePlayerFastSwimUpdated)
  368.     {
  369.         if (bPlayerExists && !featurePlayerFastSwim)
  370.             PLAYER::_SET_SWIM_SPEED_MULTIPLIER(player, 1.0);
  371.         featurePlayerFastSwimUpdated = false;
  372.     }
  373.     if (featurePlayerFastSwim)
  374.         PLAYER::_SET_SWIM_SPEED_MULTIPLIER(player, 1.49);
  375.  
  376.     // player fast run
  377.     if (featurePlayerFastRunUpdated)
  378.     {
  379.         if (bPlayerExists && !featurePlayerFastRun)
  380.             PLAYER::_SET_MOVE_SPEED_MULTIPLIER(player, 1.0);
  381.         featurePlayerFastRunUpdated = false;
  382.     }
  383.     if (featurePlayerFastRun)
  384.         PLAYER::_SET_MOVE_SPEED_MULTIPLIER(player, 1.49);
  385.  
  386.     // player super jump
  387.     if (featurePlayerSuperJump)
  388.     {
  389.         if (bPlayerExists)
  390.             GAMEPLAY::SET_SUPER_JUMP_THIS_FRAME(player);
  391.     }
  392.  
  393.     // weapon
  394.     if (featureWeaponFireAmmo)
  395.     {
  396.         if (bPlayerExists)
  397.             GAMEPLAY::SET_FIRE_AMMO_THIS_FRAME(player);
  398.     }
  399.     if (featureWeaponExplosiveAmmo)
  400.     {
  401.         if (bPlayerExists)
  402.             GAMEPLAY::SET_EXPLOSIVE_AMMO_THIS_FRAME(player);
  403.     }
  404.     if (featureWeaponExplosiveMelee)
  405.     {
  406.         if (bPlayerExists)
  407.             GAMEPLAY::SET_EXPLOSIVE_MELEE_THIS_FRAME(player);
  408.     }
  409.  
  410.     // weapon no reload
  411.     if (bPlayerExists && featureWeaponNoReload)
  412.     {
  413.         Hash cur;
  414.         if (WEAPON::GET_CURRENT_PED_WEAPON(playerPed, &cur, 1))
  415.         {
  416.             if (WEAPON::IS_WEAPON_VALID(cur))
  417.             {
  418.                 int maxAmmo;
  419.                 if (WEAPON::GET_MAX_AMMO(playerPed, cur, &maxAmmo))
  420.                 {
  421.                     WEAPON::SET_PED_AMMO(playerPed, cur, maxAmmo);
  422.  
  423.                     maxAmmo = WEAPON::GET_MAX_AMMO_IN_CLIP(playerPed, cur, 1);
  424.                     if (maxAmmo > 0)
  425.                         WEAPON::SET_AMMO_IN_CLIP(playerPed, cur, maxAmmo);
  426.                 }
  427.             }
  428.         }
  429.     }
  430.  
  431.     // player's vehicle invincible
  432.     if (featureVehInvincibleUpdated)
  433.     {
  434.         if (bPlayerExists && !featureVehInvincible && PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  435.         {
  436.             Vehicle veh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
  437.             ENTITY::SET_ENTITY_INVINCIBLE(veh, FALSE);
  438.             ENTITY::SET_ENTITY_PROOFS(veh, 0, 0, 0, 0, 0, 0, 0, 0);
  439.             VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(veh, 1);
  440.             VEHICLE::SET_VEHICLE_WHEELS_CAN_BREAK(veh, 1);
  441.             VEHICLE::SET_VEHICLE_CAN_BE_VISIBLY_DAMAGED(veh, 1);
  442.         }
  443.         featureVehInvincibleUpdated = false;
  444.     }
  445.     if (featureVehInvincible)
  446.     {
  447.         if (bPlayerExists && PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  448.         {
  449.             Vehicle veh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
  450.             ENTITY::SET_ENTITY_INVINCIBLE(veh, TRUE);
  451.             ENTITY::SET_ENTITY_PROOFS(veh, 1, 1, 1, 1, 1, 1, 1, 1);
  452.             VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(veh, 0);
  453.             VEHICLE::SET_VEHICLE_WHEELS_CAN_BREAK(veh, 0);
  454.             VEHICLE::SET_VEHICLE_CAN_BE_VISIBLY_DAMAGED(veh, 0);
  455.         }
  456.     }
  457.  
  458.     // player's vehicle boost
  459.     if (featureVehSpeedBoost && bPlayerExists && PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  460.     {
  461.         Vehicle veh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
  462.         DWORD model = ENTITY::GET_ENTITY_MODEL(veh);
  463.  
  464.         bool bUp = get_key_pressed(VK_NUMPAD9);
  465.         bool bDown = get_key_pressed(VK_NUMPAD3);
  466.  
  467.         if (bUp || bDown)
  468.         {          
  469.             float speed = ENTITY::GET_ENTITY_SPEED(veh);
  470.             if (bUp)
  471.             {
  472.                 speed += speed * 0.05f;
  473.                 VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, speed);
  474.             } else
  475.             if (ENTITY::IS_ENTITY_IN_AIR(veh) || speed > 5.0)
  476.                 VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, 0.0);
  477.         }
  478.     }
  479.  
  480.     // time pause
  481.     if (featureTimePausedUpdated)
  482.     {
  483.         TIME::PAUSE_CLOCK(featureTimePaused);
  484.         featureTimePausedUpdated = false;
  485.     }
  486.  
  487.     // time sync
  488.     if (featureTimeSynced)
  489.     {
  490.         time_t now = time(0);
  491.         tm t;
  492.         localtime_s(&t, &now);
  493.         TIME::SET_CLOCK_TIME(t.tm_hour, t.tm_min, t.tm_sec);
  494.     }
  495.  
  496.     // hide hud
  497.     if (featureMiscHideHud)
  498.         UI::HIDE_HUD_AND_RADAR_THIS_FRAME();
  499.  
  500.     // change pos hold pos
  501.     if (featureChangePosHoldPos)
  502.     {
  503.         Entity e = PLAYER::PLAYER_PED_ID();
  504.         if (PED::IS_PED_IN_ANY_VEHICLE(e, 0))
  505.             e = PED::GET_VEHICLE_PED_IS_USING(e);
  506.  
  507.         Vector3 holdposCoords = ENTITY::GET_ENTITY_COORDS(e, TRUE);
  508.         ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, holdposCoords.x, holdposCoords.y, holdposCoords.z, 0, 0, 1);
  509.     }
  510. }
  511.  
  512. LPCSTR pedModels[69][10] = {
  513.     {"player_zero", "player_one", "player_two", "a_c_boar", "a_c_chimp", "a_c_cow", "a_c_coyote", "a_c_deer", "a_c_fish", "a_c_hen"},
  514.     { "a_c_cat_01", "a_c_chickenhawk", "a_c_cormorant", "a_c_crow", "a_c_dolphin", "a_c_humpback", "a_c_killerwhale", "a_c_pigeon", "a_c_seagull", "a_c_sharkhammer"},
  515.     {"a_c_pig", "a_c_rat", "a_c_rhesus", "a_c_chop", "a_c_husky", "a_c_mtlion", "a_c_retriever", "a_c_sharktiger", "a_c_shepherd", "s_m_m_movalien_01"},
  516.     {"a_f_m_beach_01", "a_f_m_bevhills_01", "a_f_m_bevhills_02", "a_f_m_bodybuild_01", "a_f_m_business_02", "a_f_m_downtown_01", "a_f_m_eastsa_01", "a_f_m_eastsa_02", "a_f_m_fatbla_01", "a_f_m_fatcult_01"},
  517.     {"a_f_m_fatwhite_01", "a_f_m_ktown_01", "a_f_m_ktown_02", "a_f_m_prolhost_01", "a_f_m_salton_01", "a_f_m_skidrow_01", "a_f_m_soucentmc_01", "a_f_m_soucent_01", "a_f_m_soucent_02", "a_f_m_tourist_01"},
  518.     {"a_f_m_trampbeac_01", "a_f_m_tramp_01", "a_f_o_genstreet_01", "a_f_o_indian_01", "a_f_o_ktown_01", "a_f_o_salton_01", "a_f_o_soucent_01", "a_f_o_soucent_02", "a_f_y_beach_01", "a_f_y_bevhills_01"},
  519.     {"a_f_y_bevhills_02", "a_f_y_bevhills_03", "a_f_y_bevhills_04", "a_f_y_business_01", "a_f_y_business_02", "a_f_y_business_03", "a_f_y_business_04", "a_f_y_eastsa_01", "a_f_y_eastsa_02", "a_f_y_eastsa_03"},
  520.     {"a_f_y_epsilon_01", "a_f_y_fitness_01", "a_f_y_fitness_02", "a_f_y_genhot_01", "a_f_y_golfer_01", "a_f_y_hiker_01", "a_f_y_hippie_01", "a_f_y_hipster_01", "a_f_y_hipster_02", "a_f_y_hipster_03"},
  521.     {"a_f_y_hipster_04", "a_f_y_indian_01", "a_f_y_juggalo_01", "a_f_y_runner_01", "a_f_y_rurmeth_01", "a_f_y_scdressy_01", "a_f_y_skater_01", "a_f_y_soucent_01", "a_f_y_soucent_02", "a_f_y_soucent_03"},
  522.     {"a_f_y_tennis_01", "a_f_y_topless_01", "a_f_y_tourist_01", "a_f_y_tourist_02", "a_f_y_vinewood_01", "a_f_y_vinewood_02", "a_f_y_vinewood_03", "a_f_y_vinewood_04", "a_f_y_yoga_01", "a_m_m_acult_01"},
  523.     {"a_m_m_afriamer_01", "a_m_m_beach_01", "a_m_m_beach_02", "a_m_m_bevhills_01", "a_m_m_bevhills_02", "a_m_m_business_01", "a_m_m_eastsa_01", "a_m_m_eastsa_02", "a_m_m_farmer_01", "a_m_m_fatlatin_01"},
  524.     {"a_m_m_genfat_01", "a_m_m_genfat_02", "a_m_m_golfer_01", "a_m_m_hasjew_01", "a_m_m_hillbilly_01", "a_m_m_hillbilly_02", "a_m_m_indian_01", "a_m_m_ktown_01", "a_m_m_malibu_01", "a_m_m_mexcntry_01"},
  525.     {"a_m_m_mexlabor_01", "a_m_m_og_boss_01", "a_m_m_paparazzi_01", "a_m_m_polynesian_01", "a_m_m_prolhost_01", "a_m_m_rurmeth_01", "a_m_m_salton_01", "a_m_m_salton_02", "a_m_m_salton_03", "a_m_m_salton_04"},
  526.     {"a_m_m_skater_01", "a_m_m_skidrow_01", "a_m_m_socenlat_01", "a_m_m_soucent_01", "a_m_m_soucent_02", "a_m_m_soucent_03", "a_m_m_soucent_04", "a_m_m_stlat_02", "a_m_m_tennis_01", "a_m_m_tourist_01"},
  527.     {"a_m_m_trampbeac_01", "a_m_m_tramp_01", "a_m_m_tranvest_01", "a_m_m_tranvest_02", "a_m_o_acult_01", "a_m_o_acult_02", "a_m_o_beach_01", "a_m_o_genstreet_01", "a_m_o_ktown_01", "a_m_o_salton_01"},
  528.     {"a_m_o_soucent_01", "a_m_o_soucent_02", "a_m_o_soucent_03", "a_m_o_tramp_01", "a_m_y_acult_01", "a_m_y_acult_02", "a_m_y_beachvesp_01", "a_m_y_beachvesp_02", "a_m_y_beach_01", "a_m_y_beach_02"},
  529.     {"a_m_y_beach_03", "a_m_y_bevhills_01", "a_m_y_bevhills_02", "a_m_y_breakdance_01", "a_m_y_busicas_01", "a_m_y_business_01", "a_m_y_business_02", "a_m_y_business_03", "a_m_y_cyclist_01", "a_m_y_dhill_01"},
  530.     {"a_m_y_downtown_01", "a_m_y_eastsa_01", "a_m_y_eastsa_02", "a_m_y_epsilon_01", "a_m_y_epsilon_02", "a_m_y_gay_01", "a_m_y_gay_02", "a_m_y_genstreet_01", "a_m_y_genstreet_02", "a_m_y_golfer_01"},
  531.     {"a_m_y_hasjew_01", "a_m_y_hiker_01", "a_m_y_hippy_01", "a_m_y_hipster_01", "a_m_y_hipster_02", "a_m_y_hipster_03", "a_m_y_indian_01", "a_m_y_jetski_01", "a_m_y_juggalo_01", "a_m_y_ktown_01"},
  532.     {"a_m_y_ktown_02", "a_m_y_latino_01", "a_m_y_methhead_01", "a_m_y_mexthug_01", "a_m_y_motox_01", "a_m_y_motox_02", "a_m_y_musclbeac_01", "a_m_y_musclbeac_02", "a_m_y_polynesian_01", "a_m_y_roadcyc_01"},
  533.     {"a_m_y_runner_01", "a_m_y_runner_02", "a_m_y_salton_01", "a_m_y_skater_01", "a_m_y_skater_02", "a_m_y_soucent_01", "a_m_y_soucent_02", "a_m_y_soucent_03", "a_m_y_soucent_04", "a_m_y_stbla_01"},
  534.     {"a_m_y_stbla_02", "a_m_y_stlat_01", "a_m_y_stwhi_01", "a_m_y_stwhi_02", "a_m_y_sunbathe_01", "a_m_y_surfer_01", "a_m_y_vindouche_01", "a_m_y_vinewood_01", "a_m_y_vinewood_02", "a_m_y_vinewood_03"},
  535.     {"a_m_y_vinewood_04", "a_m_y_yoga_01", "u_m_y_proldriver_01", "u_m_y_rsranger_01", "u_m_y_sbike", "u_m_y_staggrm_01", "u_m_y_tattoo_01", "csb_abigail", "csb_anita", "csb_anton"},
  536.     {"csb_ballasog", "csb_bride", "csb_burgerdrug", "csb_car3guy1", "csb_car3guy2", "csb_chef", "csb_chin_goon", "csb_cletus", "csb_cop", "csb_customer"},
  537.     {"csb_denise_friend", "csb_fos_rep", "csb_g", "csb_groom", "csb_grove_str_dlr", "csb_hao", "csb_hugh", "csb_imran", "csb_janitor", "csb_maude"},
  538.     {"csb_mweather", "csb_ortega", "csb_oscar", "csb_porndudes", "csb_porndudes_p", "csb_prologuedriver", "csb_prolsec", "csb_ramp_gang", "csb_ramp_hic", "csb_ramp_hipster"},
  539.     {"csb_ramp_marine", "csb_ramp_mex", "csb_reporter", "csb_roccopelosi", "csb_screen_writer", "csb_stripper_01", "csb_stripper_02", "csb_tonya", "csb_trafficwarden", "cs_amandatownley"},
  540.     {"cs_andreas", "cs_ashley", "cs_bankman", "cs_barry", "cs_barry_p", "cs_beverly", "cs_beverly_p", "cs_brad", "cs_bradcadaver", "cs_carbuyer"},
  541.     {"cs_casey", "cs_chengsr", "cs_chrisformage", "cs_clay", "cs_dale", "cs_davenorton", "cs_debra", "cs_denise", "cs_devin", "cs_dom"},
  542.     {"cs_dreyfuss", "cs_drfriedlander", "cs_fabien", "cs_fbisuit_01", "cs_floyd", "cs_guadalope", "cs_gurk", "cs_hunter", "cs_janet", "cs_jewelass"},
  543.     {"cs_jimmyboston", "cs_jimmydisanto", "cs_joeminuteman", "cs_johnnyklebitz", "cs_josef", "cs_josh", "cs_lamardavis", "cs_lazlow", "cs_lestercrest", "cs_lifeinvad_01"},
  544.     {"cs_magenta", "cs_manuel", "cs_marnie", "cs_martinmadrazo", "cs_maryann", "cs_michelle", "cs_milton", "cs_molly", "cs_movpremf_01", "cs_movpremmale"},
  545.     {"cs_mrk", "cs_mrsphillips", "cs_mrs_thornhill", "cs_natalia", "cs_nervousron", "cs_nigel", "cs_old_man1a", "cs_old_man2", "cs_omega", "cs_orleans"},
  546.     {"cs_paper", "cs_paper_p", "cs_patricia", "cs_priest", "cs_prolsec_02", "cs_russiandrunk", "cs_siemonyetarian", "cs_solomon", "cs_stevehains", "cs_stretch"},
  547.     {"cs_tanisha", "cs_taocheng", "cs_taostranslator", "cs_tenniscoach", "cs_terry", "cs_tom", "cs_tomepsilon", "cs_tracydisanto", "cs_wade", "cs_zimbor"},
  548.     {"g_f_y_ballas_01", "g_f_y_families_01", "g_f_y_lost_01", "g_f_y_vagos_01", "g_m_m_armboss_01", "g_m_m_armgoon_01", "g_m_m_armlieut_01", "g_m_m_chemwork_01", "g_m_m_chemwork_01_p", "g_m_m_chiboss_01"},
  549.     {"g_m_m_chiboss_01_p", "g_m_m_chicold_01", "g_m_m_chicold_01_p", "g_m_m_chigoon_01", "g_m_m_chigoon_01_p", "g_m_m_chigoon_02", "g_m_m_korboss_01", "g_m_m_mexboss_01", "g_m_m_mexboss_02", "g_m_y_armgoon_02"},
  550.     {"g_m_y_azteca_01", "g_m_y_ballaeast_01", "g_m_y_ballaorig_01", "g_m_y_ballasout_01", "g_m_y_famca_01", "g_m_y_famdnf_01", "g_m_y_famfor_01", "g_m_y_korean_01", "g_m_y_korean_02", "g_m_y_korlieut_01"},
  551.     {"g_m_y_lost_01", "g_m_y_lost_02", "g_m_y_lost_03", "g_m_y_mexgang_01", "g_m_y_mexgoon_01", "g_m_y_mexgoon_02", "g_m_y_mexgoon_03", "g_m_y_mexgoon_03_p", "g_m_y_pologoon_01", "g_m_y_pologoon_01_p"},
  552.     {"g_m_y_pologoon_02", "g_m_y_pologoon_02_p", "g_m_y_salvaboss_01", "g_m_y_salvagoon_01", "g_m_y_salvagoon_02", "g_m_y_salvagoon_03", "g_m_y_salvagoon_03_p", "g_m_y_strpunk_01", "g_m_y_strpunk_02", "hc_driver"},
  553.     {"hc_gunman", "hc_hacker", "ig_abigail", "ig_amandatownley", "ig_andreas", "ig_ashley", "ig_ballasog", "ig_bankman", "ig_barry", "ig_barry_p"},
  554.     {"ig_bestmen", "ig_beverly", "ig_beverly_p", "ig_brad", "ig_bride", "ig_car3guy1", "ig_car3guy2", "ig_casey", "ig_chef", "ig_chengsr"},
  555.     {"ig_chrisformage", "ig_clay", "ig_claypain", "ig_cletus", "ig_dale", "ig_davenorton", "ig_denise", "ig_devin", "ig_dom", "ig_dreyfuss"},
  556.     {"ig_drfriedlander", "ig_fabien", "ig_fbisuit_01", "ig_floyd", "ig_groom", "ig_hao", "ig_hunter", "ig_janet", "ig_jay_norris", "ig_jewelass"},
  557.     {"ig_jimmyboston", "ig_jimmydisanto", "ig_joeminuteman", "ig_johnnyklebitz", "ig_josef", "ig_josh", "ig_kerrymcintosh", "ig_lamardavis", "ig_lazlow", "ig_lestercrest"},
  558.     {"ig_lifeinvad_01", "ig_lifeinvad_02", "ig_magenta", "ig_manuel", "ig_marnie", "ig_maryann", "ig_maude", "ig_michelle", "ig_milton", "ig_molly"},
  559.     {"ig_mrk", "ig_mrsphillips", "ig_mrs_thornhill", "ig_natalia", "ig_nervousron", "ig_nigel", "ig_old_man1a", "ig_old_man2", "ig_omega", "ig_oneil"},
  560.     {"ig_orleans", "ig_ortega", "ig_paper", "ig_patricia", "ig_priest", "ig_prolsec_02", "ig_ramp_gang", "ig_ramp_hic", "ig_ramp_hipster", "ig_ramp_mex"},
  561.     {"ig_roccopelosi", "ig_russiandrunk", "ig_screen_writer", "ig_siemonyetarian", "ig_solomon", "ig_stevehains", "ig_stretch", "ig_talina", "ig_tanisha", "ig_taocheng"},
  562.     {"ig_taostranslator", "ig_taostranslator_p", "ig_tenniscoach", "ig_terry", "ig_tomepsilon", "ig_tonya", "ig_tracydisanto", "ig_trafficwarden", "ig_tylerdix", "ig_wade"},
  563.     {"ig_zimbor", "mp_f_deadhooker", "mp_f_freemode_01", "mp_f_misty_01", "mp_f_stripperlite", "mp_g_m_pros_01", "mp_headtargets", "mp_m_claude_01", "mp_m_exarmy_01", "mp_m_famdd_01"},
  564.     {"mp_m_fibsec_01", "mp_m_freemode_01", "mp_m_marston_01", "mp_m_niko_01", "mp_m_shopkeep_01", "mp_s_m_armoured_01", "", "", "", ""},
  565.     {"", "s_f_m_fembarber", "s_f_m_maid_01", "s_f_m_shop_high", "s_f_m_sweatshop_01", "s_f_y_airhostess_01", "s_f_y_bartender_01", "s_f_y_baywatch_01", "s_f_y_cop_01", "s_f_y_factory_01"},
  566.     {"s_f_y_hooker_01", "s_f_y_hooker_02", "s_f_y_hooker_03", "s_f_y_migrant_01", "s_f_y_movprem_01", "s_f_y_ranger_01", "s_f_y_scrubs_01", "s_f_y_sheriff_01", "s_f_y_shop_low", "s_f_y_shop_mid"},
  567.     {"s_f_y_stripperlite", "s_f_y_stripper_01", "s_f_y_stripper_02", "s_f_y_sweatshop_01", "s_m_m_ammucountry", "s_m_m_armoured_01", "s_m_m_armoured_02", "s_m_m_autoshop_01", "s_m_m_autoshop_02", "s_m_m_bouncer_01"},
  568.     {"s_m_m_chemsec_01", "s_m_m_ciasec_01", "s_m_m_cntrybar_01", "s_m_m_dockwork_01", "s_m_m_doctor_01", "s_m_m_fiboffice_01", "s_m_m_fiboffice_02", "s_m_m_gaffer_01", "s_m_m_gardener_01", "s_m_m_gentransport"},
  569.     {"s_m_m_hairdress_01", "s_m_m_highsec_01", "s_m_m_highsec_02", "s_m_m_janitor", "s_m_m_lathandy_01", "s_m_m_lifeinvad_01", "s_m_m_linecook", "s_m_m_lsmetro_01", "s_m_m_mariachi_01", "s_m_m_marine_01"},
  570.     {"s_m_m_marine_02", "s_m_m_migrant_01", "u_m_y_zombie_01", "s_m_m_movprem_01", "s_m_m_movspace_01", "s_m_m_paramedic_01", "s_m_m_pilot_01", "s_m_m_pilot_02", "s_m_m_postal_01", "s_m_m_postal_02"},
  571.     {"s_m_m_prisguard_01", "s_m_m_scientist_01", "s_m_m_security_01", "s_m_m_snowcop_01", "s_m_m_strperf_01", "s_m_m_strpreach_01", "s_m_m_strvend_01", "s_m_m_trucker_01", "s_m_m_ups_01", "s_m_m_ups_02"},
  572.     {"s_m_o_busker_01", "s_m_y_airworker", "s_m_y_ammucity_01", "s_m_y_armymech_01", "s_m_y_autopsy_01", "s_m_y_barman_01", "s_m_y_baywatch_01", "s_m_y_blackops_01", "s_m_y_blackops_02", "s_m_y_busboy_01"},
  573.     {"s_m_y_chef_01", "s_m_y_clown_01", "s_m_y_construct_01", "s_m_y_construct_02", "s_m_y_cop_01", "s_m_y_dealer_01", "s_m_y_devinsec_01", "s_m_y_dockwork_01", "s_m_y_doorman_01", "s_m_y_dwservice_01"},
  574.     {"s_m_y_dwservice_02", "s_m_y_factory_01", "s_m_y_fireman_01", "s_m_y_garbage", "s_m_y_grip_01", "s_m_y_hwaycop_01", "s_m_y_marine_01", "s_m_y_marine_02", "s_m_y_marine_03", "s_m_y_mime"},
  575.     {"s_m_y_pestcont_01", "s_m_y_pilot_01", "s_m_y_prismuscl_01", "s_m_y_prisoner_01", "s_m_y_ranger_01", "s_m_y_robber_01", "s_m_y_sheriff_01", "s_m_y_shop_mask", "s_m_y_strvend_01", "s_m_y_swat_01"},
  576.     {"s_m_y_uscg_01", "s_m_y_valet_01", "s_m_y_waiter_01", "s_m_y_winclean_01", "s_m_y_xmech_01", "s_m_y_xmech_02", "u_f_m_corpse_01", "u_f_m_miranda", "u_f_m_promourn_01", "u_f_o_moviestar"},
  577.     {"u_f_o_prolhost_01", "u_f_y_bikerchic", "u_f_y_comjane", "u_f_y_corpse_01", "u_f_y_corpse_02", "u_f_y_hotposh_01", "u_f_y_jewelass_01", "u_f_y_mistress", "u_f_y_poppymich", "u_f_y_princess"},
  578.     {"u_f_y_spyactress", "u_m_m_aldinapoli", "u_m_m_bankman", "u_m_m_bikehire_01", "u_m_m_fibarchitect", "u_m_m_filmdirector", "u_m_m_glenstank_01", "u_m_m_griff_01", "u_m_m_jesus_01", "u_m_m_jewelsec_01"},
  579.     {"u_m_m_jewelthief", "u_m_m_markfost", "u_m_m_partytarget", "u_m_m_prolsec_01", "u_m_m_promourn_01", "u_m_m_rivalpap", "u_m_m_spyactor", "u_m_m_willyfist", "u_m_o_finguru_01", "u_m_o_taphillbilly"},
  580.     {"u_m_o_tramp_01", "u_m_y_abner", "u_m_y_antonb", "u_m_y_babyd", "u_m_y_baygor", "u_m_y_burgerdrug_01", "u_m_y_chip", "u_m_y_cyclist_01", "u_m_y_fibmugger_01", "u_m_y_guido_01"},
  581.     {"u_m_y_gunvend_01", "u_m_y_hippie_01", "u_m_y_imporage", "u_m_y_justin", "u_m_y_mani", "u_m_y_militarybum", "u_m_y_paparazzi", "u_m_y_party_01", "u_m_y_pogo_01", "u_m_y_prisoner_01"}
  582. };
  583.  
  584. LPCSTR pedModelNames[69][10] = {
  585.     {"MICHAEL", "FRANKLIN", "TREVOR", "BOAR", "CHIMP", "COW", "COYOTE", "DEER", "FISH", "HEN"},
  586.     { "CAT", "HAWK", "CORMORANT", "CROW", "DOLPHIN", "HUMPBACK", "WHALE", "PIGEON", "SEAGULL", "SHARKHAMMER" },
  587.     {"PIG", "RAT", "RHESUS", "CHOP", "HUSKY", "MTLION", "RETRIEVER", "SHARKTIGER", "SHEPHERD", "ALIEN"},
  588.     {"BEACH", "BEVHILLS", "BEVHILLS", "BODYBUILD", "BUSINESS", "DOWNTOWN", "EASTSA", "EASTSA", "FATBLA", "FATCULT"},
  589.     {"FATWHITE", "KTOWN", "KTOWN", "PROLHOST", "SALTON", "SKIDROW", "SOUCENTMC", "SOUCENT", "SOUCENT", "TOURIST"},
  590.     {"TRAMPBEAC", "TRAMP", "GENSTREET", "INDIAN", "KTOWN", "SALTON", "SOUCENT", "SOUCENT", "BEACH", "BEVHILLS"},
  591.     {"BEVHILLS", "BEVHILLS", "BEVHILLS", "BUSINESS", "BUSINESS", "BUSINESS", "BUSINESS", "EASTSA", "EASTSA", "EASTSA"},
  592.     {"EPSILON", "FITNESS", "FITNESS", "GENHOT", "GOLFER", "HIKER", "HIPPIE", "HIPSTER", "HIPSTER", "HIPSTER"},
  593.     {"HIPSTER", "INDIAN", "JUGGALO", "RUNNER", "RURMETH", "SCDRESSY", "SKATER", "SOUCENT", "SOUCENT", "SOUCENT"},
  594.     {"TENNIS", "TOPLESS", "TOURIST", "TOURIST", "VINEWOOD", "VINEWOOD", "VINEWOOD", "VINEWOOD", "YOGA", "ACULT"},
  595.     {"AFRIAMER", "BEACH", "BEACH", "BEVHILLS", "BEVHILLS", "BUSINESS", "EASTSA", "EASTSA", "FARMER", "FATLATIN"},
  596.     {"GENFAT", "GENFAT", "GOLFER", "HASJEW", "HILLBILLY", "HILLBILLY", "INDIAN", "KTOWN", "MALIBU", "MEXCNTRY"},
  597.     {"MEXLABOR", "OG_BOSS", "PAPARAZZI", "POLYNESIAN", "PROLHOST", "RURMETH", "SALTON", "SALTON", "SALTON", "SALTON"},
  598.     {"SKATER", "SKIDROW", "SOCENLAT", "SOUCENT", "SOUCENT", "SOUCENT", "SOUCENT", "STLAT", "TENNIS", "TOURIST"},
  599.     {"TRAMPBEAC", "TRAMP", "TRANVEST", "TRANVEST", "ACULT", "ACULT", "BEACH", "GENSTREET", "KTOWN", "SALTON"},
  600.     {"SOUCENT", "SOUCENT", "SOUCENT", "TRAMP", "ACULT", "ACULT", "BEACHVESP", "BEACHVESP", "BEACH", "BEACH"},
  601.     {"BEACH", "BEVHILLS", "BEVHILLS", "BREAKDANCE", "BUSICAS", "BUSINESS", "BUSINESS", "BUSINESS", "CYCLIST", "DHILL"},
  602.     {"DOWNTOWN", "EASTSA", "EASTSA", "EPSILON", "EPSILON", "GAY", "GAY", "GENSTREET", "GENSTREET", "GOLFER"},
  603.     {"HASJEW", "HIKER", "HIPPY", "HIPSTER", "HIPSTER", "HIPSTER", "INDIAN", "JETSKI", "JUGGALO", "KTOWN"},
  604.     {"KTOWN", "LATINO", "METHHEAD", "MEXTHUG", "MOTOX", "MOTOX", "MUSCLBEAC", "MUSCLBEAC", "POLYNESIAN", "ROADCYC"},
  605.     {"RUNNER", "RUNNER", "SALTON", "SKATER", "SKATER", "SOUCENT", "SOUCENT", "SOUCENT", "SOUCENT", "STBLA"},
  606.     {"STBLA", "STLAT", "STWHI", "STWHI", "SUNBATHE", "SURFER", "VINDOUCHE", "VINEWOOD", "VINEWOOD", "VINEWOOD"},
  607.     {"VINEWOOD", "YOGA", "PROLDRIVER", "RSRANGER", "SBIKE", "STAGGRM", "TATTOO", "ABIGAIL", "ANITA", "ANTON"},
  608.     {"BALLASOG", "BRIDE", "BURGERDRUG", "CAR3GUY1", "CAR3GUY2", "CHEF", "CHIN_GOON", "CLETUS", "COP", "CUSTOMER"},
  609.     {"DENISE_FRIEND", "FOS_REP", "G", "GROOM", "DLR", "HAO", "HUGH", "IMRAN", "JANITOR", "MAUDE"},
  610.     {"MWEATHER", "ORTEGA", "OSCAR", "PORNDUDES", "PORNDUDES_P", "PROLOGUEDRIVER", "PROLSEC", "GANG", "HIC", "HIPSTER"},
  611.     {"MARINE", "MEX", "REPORTER", "ROCCOPELOSI", "SCREEN_WRITER", "STRIPPER", "STRIPPER", "TONYA", "TRAFFICWARDEN", "AMANDATOWNLEY"},
  612.     {"ANDREAS", "ASHLEY", "BANKMAN", "BARRY", "BARRY_P", "BEVERLY", "BEVERLY_P", "BRAD", "BRADCADAVER", "CARBUYER"},
  613.     {"CASEY", "CHENGSR", "CHRISFORMAGE", "CLAY", "DALE", "DAVENORTON", "DEBRA", "DENISE", "DEVIN", "DOM"},
  614.     {"DREYFUSS", "DRFRIEDLANDER", "FABIEN", "FBISUIT", "FLOYD", "GUADALOPE", "GURK", "HUNTER", "JANET", "JEWELASS"},
  615.     {"JIMMYBOSTON", "JIMMYDISANTO", "JOEMINUTEMAN", "JOHNNYKLEBITZ", "JOSEF", "JOSH", "LAMARDAVIS", "LAZLOW", "LESTERCREST", "LIFEINVAD"},
  616.     {"MAGENTA", "MANUEL", "MARNIE", "MARTINMADRAZO", "MARYANN", "MICHELLE", "MILTON", "MOLLY", "MOVPREMF", "MOVPREMMALE"},
  617.     {"MRK", "MRSPHILLIPS", "MRS_THORNHILL", "NATALIA", "NERVOUSRON", "NIGEL", "OLD_MAN1A", "OLD_MAN2", "OMEGA", "ORLEANS"},
  618.     {"PAPER", "PAPER_P", "PATRICIA", "PRIEST", "PROLSEC", "RUSSIANDRUNK", "SIEMONYETARIAN", "SOLOMON", "STEVEHAINS", "STRETCH"},
  619.     {"TANISHA", "TAOCHENG", "TAOSTRANSLATOR", "TENNISCOACH", "TERRY", "TOM", "TOMEPSILON", "TRACYDISANTO", "WADE", "ZIMBOR"},
  620.     {"BALLAS", "FAMILIES", "LOST", "VAGOS", "ARMBOSS", "ARMGOON", "ARMLIEUT", "CHEMWORK", "CHEMWORK_P", "CHIBOSS"},
  621.     {"CHIBOSS_P", "CHICOLD", "CHICOLD_P", "CHIGOON", "CHIGOON_P", "CHIGOON", "KORBOSS", "MEXBOSS", "MEXBOSS", "ARMGOON"},
  622.     {"AZTECA", "BALLAEAST", "BALLAORIG", "BALLASOUT", "FAMCA", "FAMDNF", "FAMFOR", "KOREAN", "KOREAN", "KORLIEUT"},
  623.     {"LOST", "LOST", "LOST", "MEXGANG", "MEXGOON", "MEXGOON", "MEXGOON", "MEXGOON_P", "POLOGOON", "POLOGOON_P"},
  624.     {"POLOGOON", "POLOGOON_P", "SALVABOSS", "SALVAGOON", "SALVAGOON", "SALVAGOON", "SALVAGOON_P", "STRPUNK", "STRPUNK", "HC_DRIVER"},
  625.     {"HC_GUNMAN", "HC_HACKER", "ABIGAIL", "AMANDATOWNLEY", "ANDREAS", "ASHLEY", "BALLASOG", "BANKMAN", "BARRY", "BARRY_P"},
  626.     {"BESTMEN", "BEVERLY", "BEVERLY_P", "BRAD", "BRIDE", "CAR3GUY1", "CAR3GUY2", "CASEY", "CHEF", "CHENGSR"},
  627.     {"CHRISFORMAGE", "CLAY", "CLAYPAIN", "CLETUS", "DALE", "DAVENORTON", "DENISE", "DEVIN", "DOM", "DREYFUSS"},
  628.     {"DRFRIEDLANDER", "FABIEN", "FBISUIT", "FLOYD", "GROOM", "HAO", "HUNTER", "JANET", "JAY_NORRIS", "JEWELASS"},
  629.     {"JIMMYBOSTON", "JIMMYDISANTO", "JOEMINUTEMAN", "JOHNNYKLEBITZ", "JOSEF", "JOSH", "KERRYMCINTOSH", "LAMARDAVIS", "LAZLOW", "LESTERCREST"},
  630.     {"LIFEINVAD", "LIFEINVAD", "MAGENTA", "MANUEL", "MARNIE", "MARYANN", "MAUDE", "MICHELLE", "MILTON", "MOLLY"},
  631.     {"MRK", "MRSPHILLIPS", "MRS_THORNHILL", "NATALIA", "NERVOUSRON", "NIGEL", "OLD_MAN1A", "OLD_MAN2", "OMEGA", "ONEIL"},
  632.     {"ORLEANS", "ORTEGA", "PAPER", "PATRICIA", "PRIEST", "PROLSEC", "GANG", "HIC", "HIPSTER", "MEX"},
  633.     {"ROCCOPELOSI", "RUSSIANDRUNK", "SCREEN_WRITER", "SIEMONYETARIAN", "SOLOMON", "STEVEHAINS", "STRETCH", "TALINA", "TANISHA", "TAOCHENG"},
  634.     {"TAOSTRANSLATOR", "TAOSTRANSLATOR_P", "TENNISCOACH", "TERRY", "TOMEPSILON", "TONYA", "TRACYDISANTO", "TRAFFICWARDEN", "TYLERDIX", "WADE"},
  635.     {"ZIMBOR", "DEADHOOKER", "FREEMODE", "MISTY", "STRIPPERLITE", "PROS", "MP_HEADTARGETS", "CLAUDE", "EXARMY", "FAMDD"},
  636.     {"FIBSEC", "FREEMODE", "MARSTON", "NIKO", "SHOPKEEP", "ARMOURED", "NONE", "NONE", "NONE", "NONE"},
  637.     {"NONE", "FEMBARBER", "MAID", "SHOP_HIGH", "SWEATSHOP", "AIRHOSTESS", "BARTENDER", "BAYWATCH", "COP", "FACTORY"},
  638.     {"HOOKER", "HOOKER", "HOOKER", "MIGRANT", "MOVPREM", "RANGER", "SCRUBS", "SHERIFF", "SHOP_LOW", "SHOP_MID"},
  639.     {"STRIPPERLITE", "STRIPPER", "STRIPPER", "SWEATSHOP", "AMMUCOUNTRY", "ARMOURED", "ARMOURED", "AUTOSHOP", "AUTOSHOP", "BOUNCER"},
  640.     {"CHEMSEC", "CIASEC", "CNTRYBAR", "DOCKWORK", "DOCTOR", "FIBOFFICE", "FIBOFFICE", "GAFFER", "GARDENER", "GENTRANSPORT"},
  641.     {"HAIRDRESS", "HIGHSEC", "HIGHSEC", "JANITOR", "LATHANDY", "LIFEINVAD", "LINECOOK", "LSMETRO", "MARIACHI", "MARINE"},
  642.     {"MARINE", "MIGRANT", "ZOMBIE", "MOVPREM", "MOVSPACE", "PARAMEDIC", "PILOT", "PILOT", "POSTAL", "POSTAL"},
  643.     {"PRISGUARD", "SCIENTIST", "SECURITY", "SNOWCOP", "STRPERF", "STRPREACH", "STRVEND", "TRUCKER", "UPS", "UPS"},
  644.     {"BUSKER", "AIRWORKER", "AMMUCITY", "ARMYMECH", "AUTOPSY", "BARMAN", "BAYWATCH", "BLACKOPS", "BLACKOPS", "BUSBOY"},
  645.     {"CHEF", "CLOWN", "CONSTRUCT", "CONSTRUCT", "COP", "DEALER", "DEVINSEC", "DOCKWORK", "DOORMAN", "DWSERVICE"},
  646.     {"DWSERVICE", "FACTORY", "FIREMAN", "GARBAGE", "GRIP", "HWAYCOP", "MARINE", "MARINE", "MARINE", "MIME"},
  647.     {"PESTCONT", "PILOT", "PRISMUSCL", "PRISONER", "RANGER", "ROBBER", "SHERIFF", "SHOP_MASK", "STRVEND", "SWAT"},
  648.     {"USCG", "VALET", "WAITER", "WINCLEAN", "XMECH", "XMECH", "CORPSE", "MIRANDA", "PROMOURN", "MOVIESTAR"},
  649.     {"PROLHOST", "BIKERCHIC", "COMJANE", "CORPSE", "CORPSE", "HOTPOSH", "JEWELASS", "MISTRESS", "POPPYMICH", "PRINCESS"},
  650.     {"SPYACTRESS", "ALDINAPOLI", "BANKMAN", "BIKEHIRE", "FIBARCHITECT", "FILMDIRECTOR", "GLENSTANK", "GRIFF", "JESUS", "JEWELSEC"},
  651.     {"JEWELTHIEF", "MARKFOST", "PARTYTARGET", "PROLSEC", "PROMOURN", "RIVALPAP", "SPYACTOR", "WILLYFIST", "FINGURU", "TAPHILLBILLY"},
  652.     {"TRAMP", "ABNER", "ANTONB", "BABYD", "BAYGOR", "BURGERDRUG", "CHIP", "CYCLIST", "FIBMUGGER", "GUIDO"},
  653.     {"GUNVEND", "HIPPIE", "IMPORAGE", "JUSTIN", "MANI", "MILITARYBUM", "PAPARAZZI", "PARTY", "POGO", "PRISONER"}
  654. };
  655.  
  656. int skinchangerActiveLineIndex = 0;
  657. int skinchangerActiveItemIndex = 0;
  658.  
  659. bool process_skinchanger_menu()
  660. {
  661.     DWORD waitTime = 150;
  662.     const int lineCount = 69;
  663.     const int itemCount = 10;
  664.     const int itemCountLastLine = itemCount;
  665.     while (true)
  666.     {
  667.         // timed menu draw, used for pause after active line switch
  668.         DWORD maxTickCount = GetTickCount() + waitTime;
  669.         do
  670.         {
  671.             // draw menu
  672.             char caption[32];
  673.             sprintf_s(caption, "SKIN CHANGER   %d / %d", skinchangerActiveLineIndex + 1, lineCount);
  674.             draw_menu_line(caption, 350.0, 15.0, 18.0, 0.0, 5.0, false, true);
  675.             for (int i = 0; i < itemCount; i++)
  676.                 if (strlen(pedModels[skinchangerActiveLineIndex][i]))
  677.                     draw_menu_line(pedModelNames[skinchangerActiveLineIndex][i], 100.0f, 5.0f, 200.0f, 100.0f + i * 110.0f, 5.0f, i == skinchangerActiveItemIndex, false, false);
  678.            
  679.             update_features();
  680.             WAIT(0);
  681.         } while (GetTickCount() < maxTickCount);
  682.         waitTime = 0;
  683.  
  684.         bool bSelect, bBack, bUp, bDown, bLeft, bRight;
  685.         get_button_state(&bSelect, &bBack, &bUp, &bDown, &bLeft, &bRight);
  686.        
  687.         if (bSelect)
  688.         {
  689.             menu_beep();
  690.             DWORD model = GAMEPLAY::GET_HASH_KEY((char *)pedModels[skinchangerActiveLineIndex][skinchangerActiveItemIndex]);
  691.             if (STREAMING::IS_MODEL_IN_CDIMAGE(model) && STREAMING::IS_MODEL_VALID(model))
  692.             {
  693.                 STREAMING::REQUEST_MODEL(model);               
  694.                 while (!STREAMING::HAS_MODEL_LOADED(model)) WAIT(0);
  695.                 //STREAMING::LOAD_ALL_OBJECTS_NOW();
  696.                 PLAYER::SET_PLAYER_MODEL(PLAYER::PLAYER_ID(), model);
  697.                 //PED::SET_PED_RANDOM_COMPONENT_VARIATION(PLAYER::PLAYER_PED_ID(), FALSE);
  698.                 PED::SET_PED_DEFAULT_COMPONENT_VARIATION(PLAYER::PLAYER_PED_ID());             
  699.                 WAIT(0);
  700.                 for (int i = 0; i < 12; i++)
  701.                     for (int j = 0; j < 100; j++)
  702.                     {
  703.                         int drawable = rand() % 10;
  704.                         int texture = rand() % 10;
  705.                         if (PED::IS_PED_COMPONENT_VARIATION_VALID(PLAYER::PLAYER_PED_ID(), i, drawable, texture))
  706.                         {
  707.                             PED::SET_PED_COMPONENT_VARIATION(PLAYER::PLAYER_PED_ID(), i, drawable, texture, 0);
  708.                             break;
  709.                         }
  710.                     }
  711.                 skinchanger_used = true;
  712.                 WAIT(100);
  713.                 STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(model);               
  714.                 waitTime = 200;
  715.             }
  716.         } else
  717.         if (bBack)
  718.         {
  719.             menu_beep();
  720.             break;
  721.         } else
  722.         if (bRight)
  723.         {
  724.             menu_beep();
  725.             skinchangerActiveItemIndex++;
  726.             int itemsMax = (skinchangerActiveLineIndex == (lineCount - 1)) ? itemCountLastLine : itemCount;
  727.             if (skinchangerActiveItemIndex == itemsMax)
  728.                 skinchangerActiveItemIndex = 0;        
  729.             waitTime = 100;
  730.         } else
  731.         if (bLeft)
  732.         {
  733.             menu_beep();
  734.             if (skinchangerActiveItemIndex == 0)
  735.                 skinchangerActiveItemIndex = (skinchangerActiveLineIndex == (lineCount - 1)) ? itemCountLastLine : itemCount;
  736.             skinchangerActiveItemIndex--;
  737.             waitTime = 100;
  738.         } else
  739.         if (bUp)
  740.         {
  741.             menu_beep();
  742.             if (skinchangerActiveLineIndex == 0)
  743.                 skinchangerActiveLineIndex = lineCount;
  744.             skinchangerActiveLineIndex--;
  745.             waitTime = 200;
  746.         } else
  747.         if (bDown)
  748.         {
  749.             menu_beep();
  750.             skinchangerActiveLineIndex++;
  751.             if (skinchangerActiveLineIndex == lineCount)
  752.                 skinchangerActiveLineIndex = 0;        
  753.             waitTime = 200;
  754.         }
  755.         if (skinchangerActiveLineIndex == (lineCount - 1))
  756.             if (skinchangerActiveItemIndex >= itemCountLastLine)
  757.                 skinchangerActiveItemIndex = 0;
  758.     }
  759.     return false;
  760. }
  761.  
  762. int teleportActiveLineIndex = 0;
  763.  
  764. bool process_teleport_menu()
  765. {
  766.     const float lineWidth = 250.0;
  767.     const int lineCount = 17;
  768.  
  769.     std::string caption = "TELEPORT";
  770.  
  771.     static struct {
  772.         LPCSTR  text;
  773.         float x;
  774.         float y;
  775.         float z;
  776.     } lines[lineCount] = {
  777.             { "MARKER" },
  778.             { "MICHAEL'S HOUSE", -852.4f, 160.0f, 65.6f },
  779.             { "FRANKLIN'S HOUSE", 7.9f, 548.1f, 175.5f },
  780.             { "TREVOR'S TRAILER", 1985.7f, 3812.2f, 32.2f },
  781.             { "AIRPORT ENTRANCE", -1034.6f, -2733.6f, 13.8f },
  782.             { "AIRPORT FIELD", -1336.0f, -3044.0f, 13.9f },
  783.             { "ELYSIAN ISLAND", 338.2f, -2715.9f, 38.5f },
  784.             { "JETSAM", 760.4f, -2943.2f, 5.8f },
  785.             { "STRIPCLUB", 127.4f, -1307.7f, 29.2f },
  786.             { "ELBURRO HEIGHTS", 1384.0f, -2057.1f, 52.0f },
  787.             { "FERRIS WHEEL", -1670.7f, -1125.0f, 13.0f },
  788.             { "CHUMASH", -3192.6f, 1100.0f, 20.2f },
  789.             { "WINDFARM", 2354.0f, 1830.3f, 101.1f },
  790.             { "MILITARY BASE", -2047.4f, 3132.1f, 32.8f },
  791.             { "MCKENZIE AIRFIELD", 2121.7f, 4796.3f, 41.1f },
  792.             { "DESERT AIRFIELD", 1747.0f, 3273.7f, 41.1f },
  793.             { "CHILLIAD", 425.4f, 5614.3f, 766.5f }
  794.     };
  795.  
  796.     DWORD waitTime = 150;
  797.     while (true)
  798.     {
  799.         // timed menu draw, used for pause after active line switch
  800.         DWORD maxTickCount = GetTickCount() + waitTime;
  801.         do
  802.         {
  803.             // draw menu
  804.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  805.             for (int i = 0; i < lineCount; i++)
  806.                 if (i != teleportActiveLineIndex)
  807.                     draw_menu_line(lines[i].text, lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  808.             draw_menu_line(lines[teleportActiveLineIndex].text, lineWidth + 1.0, 11.0, 56.0 + teleportActiveLineIndex * 36.0, 0.0, 7.0, true, false);
  809.  
  810.             update_features();
  811.             WAIT(0);
  812.         } while (GetTickCount() < maxTickCount);
  813.         waitTime = 0;
  814.  
  815.         // process buttons
  816.         bool bSelect, bBack, bUp, bDown;
  817.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  818.         if (bSelect)
  819.         {
  820.             menu_beep();
  821.  
  822.             // get entity to teleport
  823.             Entity e = PLAYER::PLAYER_PED_ID();
  824.             if (PED::IS_PED_IN_ANY_VEHICLE(e, 0))
  825.                 e = PED::GET_VEHICLE_PED_IS_USING(e);
  826.  
  827.             // get coords
  828.             Vector3 coords;
  829.             bool success = false;
  830.             if (teleportActiveLineIndex == 0) // marker
  831.             {
  832.                 bool blipFound = false;
  833.                 // search for marker blip
  834.                 int blipIterator = UI::_GET_BLIP_INFO_ID_ITERATOR();
  835.                 for (Blip i = UI::GET_FIRST_BLIP_INFO_ID(blipIterator); UI::DOES_BLIP_EXIST(i) != 0; i = UI::GET_NEXT_BLIP_INFO_ID(blipIterator))
  836.                 {
  837.                     if (UI::GET_BLIP_INFO_ID_TYPE(i) == 4)
  838.                     {
  839.                         coords = UI::GET_BLIP_INFO_ID_COORD(i);
  840.                         blipFound = true;
  841.                         break;
  842.                     }
  843.                 }
  844.                 if (blipFound)
  845.                 {
  846.                     // load needed map region and check height levels for ground existence
  847.                     bool groundFound = false;
  848.                     static float groundCheckHeight[] = {
  849.                         100.0, 150.0, 50.0, 0.0, 200.0, 250.0, 300.0, 350.0, 400.0,
  850.                         450.0, 500.0, 550.0, 600.0, 650.0, 700.0, 750.0, 800.0
  851.                     };
  852.                     for (int i = 0; i < sizeof(groundCheckHeight) / sizeof(float); i++)
  853.                     {
  854.                         ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, coords.x, coords.y, groundCheckHeight[i], 0, 0, 1);
  855.                         WAIT(100);
  856.                         if (GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(coords.x, coords.y, groundCheckHeight[i], &coords.z))
  857.                         {
  858.                             groundFound = true;
  859.                             coords.z += 3.0;
  860.                             break;
  861.                         }
  862.                     }
  863.                     // if ground not found then set Z in air and give player a parachute
  864.                     if (!groundFound)
  865.                     {
  866.                         coords.z = 1000.0;
  867.                         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), 0xFBAB5776, 1, 0);
  868.                     }
  869.                     success = true;
  870.                 }
  871.                 else
  872.                 {
  873.                     set_status_text("map marker isn't set");
  874.                 }
  875.  
  876.             } else // predefined coords
  877.             {
  878.                 coords.x = lines[teleportActiveLineIndex].x;
  879.                 coords.y = lines[teleportActiveLineIndex].y;
  880.                 coords.z = lines[teleportActiveLineIndex].z;
  881.                 success = true;
  882.             }
  883.  
  884.             // set player pos
  885.             if (success)
  886.             {
  887.                 ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, coords.x, coords.y, coords.z, 0, 0, 1);
  888.                 WAIT(0);
  889.                 set_status_text("teleported");
  890.                 return true;
  891.             }
  892.            
  893.             waitTime = 200;
  894.         } else
  895.         if (bBack || trainer_switch_pressed())
  896.         {
  897.             menu_beep();
  898.             break;
  899.         } else
  900.         if (bUp)
  901.         {
  902.             menu_beep();
  903.             if (teleportActiveLineIndex == 0)
  904.                 teleportActiveLineIndex = lineCount;
  905.             teleportActiveLineIndex--;
  906.             waitTime = 150;
  907.         } else
  908.         if (bDown)
  909.         {
  910.             menu_beep();
  911.             teleportActiveLineIndex++;
  912.             if (teleportActiveLineIndex == lineCount)
  913.                 teleportActiveLineIndex = 0;           
  914.             waitTime = 150;
  915.         }
  916.     }
  917.     return false;
  918. }
  919.  
  920. std::string line_as_str(std::string text, bool *pState)
  921. {
  922.     while (text.size() < 18) text += " ";
  923.     return text + (pState ? (*pState ? " [ON]" : " [OFF]") : "");
  924. }
  925.  
  926. int activeLineIndexPlayer = 0;
  927.  
  928. void process_player_menu()
  929. {
  930.     const float lineWidth = 250.0;
  931.     const int lineCount = 15;
  932.    
  933.     std::string caption = "PLAYER  OPTIONS";
  934.  
  935.     static struct {
  936.         LPCSTR      text;
  937.         bool        *pState;
  938.         bool        *pUpdated;
  939.     } lines[lineCount] = {
  940.         {"SKIN CHANGER", NULL, NULL},
  941.         {"TELEPORT", NULL, NULL},
  942.         {"FIX PLAYER", NULL, NULL},
  943.         {"RESET SKIN", NULL, NULL},
  944.         {"ADD CASH", NULL, NULL},
  945.         {"WANTED UP", NULL, NULL},
  946.         {"WANTED DOWN", NULL, NULL},
  947.         {"NEVER WANTED", &featurePlayerNeverWanted, NULL},
  948.         {"INVINCIBLE", &featurePlayerInvincible, &featurePlayerInvincibleUpdated},
  949.         {"POLICE IGNORED", &featurePlayerIgnored, &featurePlayerIgnoredUpdated},
  950.         {"UNLIM ABILITY", &featurePlayerUnlimitedAbility, NULL},
  951.         {"NOISELESS", &featurePlayerNoNoise, &featurePlayerNoNoiseUpdated},
  952.         {"FAST SWIM", &featurePlayerFastSwim, &featurePlayerFastSwimUpdated},
  953.         {"FAST RUN", &featurePlayerFastRun, &featurePlayerFastRunUpdated},
  954.         {"SUPER JUMP", &featurePlayerSuperJump, NULL}
  955.     };
  956.  
  957.     DWORD waitTime = 150;
  958.     while (true)
  959.     {
  960.         // timed menu draw, used for pause after active line switch
  961.         DWORD maxTickCount = GetTickCount() + waitTime;
  962.         do
  963.         {
  964.             // draw menu
  965.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  966.             for (int i = 0; i < lineCount; i++)
  967.                 if (i != activeLineIndexPlayer)
  968.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  969.                                    lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  970.             draw_menu_line(line_as_str(lines[activeLineIndexPlayer].text, lines[activeLineIndexPlayer].pState),
  971.                            lineWidth + 1.0, 11.0, 56.0 + activeLineIndexPlayer * 36.0, 0.0, 7.0, true, false);
  972.  
  973.             update_features();
  974.             WAIT(0);
  975.         } while (GetTickCount() < maxTickCount);
  976.         waitTime = 0;
  977.  
  978.         // process buttons
  979.         bool bSelect, bBack, bUp, bDown;
  980.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  981.         if (bSelect)
  982.         {
  983.             menu_beep();
  984.  
  985.             // common variables
  986.             BOOL bPlayerExists = ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID());
  987.             Player player = PLAYER::PLAYER_ID();
  988.             Ped playerPed = PLAYER::PLAYER_PED_ID();
  989.  
  990.             switch (activeLineIndexPlayer)
  991.             {
  992.                 // skin changer
  993.                 case 0:
  994.                     if (process_skinchanger_menu()) return;
  995.                     break;
  996.                 // teleport
  997.                 case 1:
  998.                     if (process_teleport_menu()) return;
  999.                     break;
  1000.                 // fix player
  1001.                 case 2:
  1002.                     {
  1003.                         ENTITY::SET_ENTITY_HEALTH(playerPed, ENTITY::GET_ENTITY_MAX_HEALTH(playerPed));
  1004.                         PED::ADD_ARMOUR_TO_PED(playerPed, PLAYER::GET_PLAYER_MAX_ARMOUR(player) - PED::GET_PED_ARMOUR(playerPed));
  1005.                         if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  1006.                         {
  1007.                             Vehicle playerVeh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
  1008.                             if (ENTITY::DOES_ENTITY_EXIST(playerVeh) && !ENTITY::IS_ENTITY_DEAD(playerVeh))
  1009.                                 VEHICLE::SET_VEHICLE_FIXED(playerVeh);
  1010.                         }
  1011.                         set_status_text("player fixed");
  1012.                     }
  1013.                     break;
  1014.                 // reset model skin
  1015.                 case 3:
  1016.                     {
  1017.                         PED::SET_PED_DEFAULT_COMPONENT_VARIATION(playerPed);
  1018.                         set_status_text("using default model skin");
  1019.                     }
  1020.                     break;
  1021.                 // add cash
  1022.                 case 4:
  1023.                     for (int i = 0; i < 3; i++)
  1024.                     {
  1025.                         char statNameFull[32];
  1026.                         sprintf_s(statNameFull, "SP%d_TOTAL_CASH", i);
  1027.                         Hash hash = GAMEPLAY::GET_HASH_KEY(statNameFull);
  1028.                         int val;
  1029.                         STATS::STAT_GET_INT(hash, &val, -1);
  1030.                         val += 1000000;
  1031.                         STATS::STAT_SET_INT(hash, val, 1);
  1032.                     }
  1033.                     set_status_text("cash added");
  1034.                     break;
  1035.                 // wanted up
  1036.                 case 5:
  1037.                     if (bPlayerExists && PLAYER::GET_PLAYER_WANTED_LEVEL(player) < 5)
  1038.                     {
  1039.                         PLAYER::SET_PLAYER_WANTED_LEVEL(player, PLAYER::GET_PLAYER_WANTED_LEVEL(player) + 1, 0);
  1040.                         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, 0);
  1041.                         set_status_text("wanted up");
  1042.                     }
  1043.                     break;
  1044.                 // wanted down
  1045.                 case 6:
  1046.                     if (bPlayerExists && PLAYER::GET_PLAYER_WANTED_LEVEL(player) > 0)
  1047.                     {
  1048.                         PLAYER::SET_PLAYER_WANTED_LEVEL(player, PLAYER::GET_PLAYER_WANTED_LEVEL(player) - 1, 0);
  1049.                         PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(player, 0);
  1050.                         set_status_text("wanted down");
  1051.                     }
  1052.                     break;
  1053.                 // switchable features
  1054.                 default:
  1055.                     if (lines[activeLineIndexPlayer].pState)
  1056.                         *lines[activeLineIndexPlayer].pState = !(*lines[activeLineIndexPlayer].pState);
  1057.                     if (lines[activeLineIndexPlayer].pUpdated)
  1058.                         *lines[activeLineIndexPlayer].pUpdated = true;                 
  1059.             }
  1060.             waitTime = 200;
  1061.         } else
  1062.         if (bBack || trainer_switch_pressed())
  1063.         {
  1064.             menu_beep();
  1065.             break;
  1066.         } else
  1067.         if (bUp)
  1068.         {
  1069.             menu_beep();
  1070.             if (activeLineIndexPlayer == 0)
  1071.                 activeLineIndexPlayer = lineCount;
  1072.             activeLineIndexPlayer--;
  1073.             waitTime = 150;
  1074.         } else
  1075.         if (bDown)
  1076.         {
  1077.             menu_beep();
  1078.             activeLineIndexPlayer++;
  1079.             if (activeLineIndexPlayer == lineCount)
  1080.                 activeLineIndexPlayer = 0;         
  1081.             waitTime = 150;
  1082.         }
  1083.     }
  1084. }
  1085.  
  1086. int activeLineIndexWeapon = 0;
  1087.  
  1088. void process_weapon_menu()
  1089. {
  1090.     const float lineWidth = 250.0;
  1091.     const int lineCount = 6;
  1092.  
  1093.     std::string caption = "WEAPON  OPTIONS";
  1094.  
  1095.     static struct {
  1096.         LPCSTR      text;
  1097.         bool        *pState;
  1098.         bool        *pUpdated;
  1099.     } lines[lineCount] = {
  1100.         {"GET ALL WEAPON"NULL,                         NULL},
  1101.         {"NO RELOAD",       &featureWeaponNoReload,       NULL},
  1102.         {"FIRE AMMO",       &featureWeaponFireAmmo,       NULL},
  1103.         {"EXPLOSIVE AMMO",  &featureWeaponExplosiveAmmo,  NULL},
  1104.         {"EXPLOSIVE MELEE", &featureWeaponExplosiveMelee, NULL},
  1105.         {"VEHICLE ROCKETS", &featureWeaponVehRockets,     NULL}
  1106.     };
  1107.  
  1108.     static LPCSTR weaponNames[] = {
  1109.         "WEAPON_KNIFE", "WEAPON_NIGHTSTICK", "WEAPON_HAMMER", "WEAPON_BAT", "WEAPON_GOLFCLUB", "WEAPON_CROWBAR",
  1110.         "WEAPON_PISTOL", "WEAPON_COMBATPISTOL", "WEAPON_APPISTOL", "WEAPON_PISTOL50", "WEAPON_MICROSMG", "WEAPON_SMG",
  1111.         "WEAPON_ASSAULTSMG", "WEAPON_ASSAULTRIFLE", "WEAPON_CARBINERIFLE", "WEAPON_ADVANCEDRIFLE", "WEAPON_MG",
  1112.         "WEAPON_COMBATMG", "WEAPON_PUMPSHOTGUN", "WEAPON_SAWNOFFSHOTGUN", "WEAPON_ASSAULTSHOTGUN", "WEAPON_BULLPUPSHOTGUN",
  1113.         "WEAPON_STUNGUN", "WEAPON_SNIPERRIFLE", "WEAPON_HEAVYSNIPER", "WEAPON_GRENADELAUNCHER", "WEAPON_GRENADELAUNCHER_SMOKE",
  1114.         "WEAPON_RPG", "WEAPON_MINIGUN", "WEAPON_GRENADE", "WEAPON_STICKYBOMB", "WEAPON_SMOKEGRENADE", "WEAPON_BZGAS",
  1115.         "WEAPON_MOLOTOV", "WEAPON_FIREEXTINGUISHER", "WEAPON_PETROLCAN",
  1116.         "WEAPON_SNSPISTOL", "WEAPON_SPECIALCARBINE", "WEAPON_HEAVYPISTOL", "WEAPON_BULLPUPRIFLE", "WEAPON_HOMINGLAUNCHER",
  1117.         "WEAPON_PROXMINE", "WEAPON_SNOWBALL", "WEAPON_VINTAGEPISTOL", "WEAPON_DAGGER", "WEAPON_FIREWORK", "WEAPON_MUSKET",
  1118.         "WEAPON_MARKSMANRIFLE", "WEAPON_HEAVYSHOTGUN", "WEAPON_GUSENBERG", "WEAPON_HATCHET", "WEAPON_RAILGUN"
  1119.     };
  1120.  
  1121.     DWORD waitTime = 150;
  1122.     while (true)
  1123.     {
  1124.         // timed menu draw, used for pause after active line switch
  1125.         DWORD maxTickCount = GetTickCount() + waitTime;
  1126.         do
  1127.         {
  1128.             // draw menu
  1129.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1130.             for (int i = 0; i < lineCount; i++)
  1131.                 if (i != activeLineIndexWeapon)
  1132.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1133.                                    lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1134.             draw_menu_line(line_as_str(lines[activeLineIndexWeapon].text, lines[activeLineIndexWeapon].pState),
  1135.                            lineWidth + 1.0, 11.0, 56.0 + activeLineIndexWeapon * 36.0, 0.0, 7.0, true, false);
  1136.  
  1137.             update_features();
  1138.             WAIT(0);
  1139.         } while (GetTickCount() < maxTickCount);
  1140.         waitTime = 0;
  1141.  
  1142.         // process buttons
  1143.         bool bSelect, bBack, bUp, bDown;
  1144.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1145.         if (bSelect)
  1146.         {
  1147.             menu_beep();
  1148.  
  1149.             // common variables
  1150.             BOOL bPlayerExists = ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID());
  1151.             Player player = PLAYER::PLAYER_ID();
  1152.             Ped playerPed = PLAYER::PLAYER_PED_ID();
  1153.  
  1154.             switch (activeLineIndexWeapon)
  1155.             {
  1156.                 case 0:
  1157.                     for (int i = 0; i < sizeof(weaponNames) / sizeof(weaponNames[0]); i++)
  1158.                         WEAPON::GIVE_DELAYED_WEAPON_TO_PED(playerPed, GAMEPLAY::GET_HASH_KEY((char *)weaponNames[i]), 1000, 0);
  1159.                     set_status_text("all weapon added");
  1160.                     break;
  1161.                 // switchable features
  1162.                 default:
  1163.                     if (lines[activeLineIndexWeapon].pState)
  1164.                         *lines[activeLineIndexWeapon].pState = !(*lines[activeLineIndexWeapon].pState);
  1165.                     if (lines[activeLineIndexWeapon].pUpdated)
  1166.                         *lines[activeLineIndexWeapon].pUpdated = true;                 
  1167.             }
  1168.             waitTime = 200;
  1169.         } else
  1170.         if (bBack || trainer_switch_pressed())
  1171.         {
  1172.             menu_beep();
  1173.             break;
  1174.         } else
  1175.         if (bUp)
  1176.         {
  1177.             menu_beep();
  1178.             if (activeLineIndexWeapon == 0)
  1179.                 activeLineIndexWeapon = lineCount;
  1180.             activeLineIndexWeapon--;
  1181.             waitTime = 150;
  1182.         } else
  1183.         if (bDown)
  1184.         {
  1185.             menu_beep();
  1186.             activeLineIndexWeapon++;
  1187.             if (activeLineIndexWeapon == lineCount)
  1188.                 activeLineIndexWeapon = 0;         
  1189.             waitTime = 150;
  1190.         }
  1191.     }
  1192. }
  1193.  
  1194. LPCSTR vehicleModels[35][10] = {
  1195.     {"NINEF", "NINEF2", "BLISTA", "ASEA", "ASEA2", "BOATTRAILER", "BUS", "ARMYTANKER", "ARMYTRAILER", "ARMYTRAILER2"},
  1196.     {"SUNTRAP", "COACH", "AIRBUS", "ASTEROPE", "AIRTUG", "AMBULANCE", "BARRACKS", "BARRACKS2", "BALLER", "BALLER2"},
  1197.     {"BJXL", "BANSHEE", "BENSON", "BFINJECTION", "BIFF", "BLAZER", "BLAZER2", "BLAZER3", "BISON", "BISON2"},
  1198.     {"BISON3", "BOXVILLE", "BOXVILLE2", "BOXVILLE3", "BOBCATXL", "BODHI2", "BUCCANEER", "BUFFALO", "BUFFALO2", "BULLDOZER"},
  1199.     {"BULLET", "BLIMP", "BURRITO", "BURRITO2", "BURRITO3", "BURRITO4", "BURRITO5", "CAVALCADE", "CAVALCADE2", "POLICET"},
  1200.     {"GBURRITO", "CABLECAR", "CADDY", "CADDY2", "CAMPER", "CARBONIZZARE", "CHEETAH", "COMET2", "COGCABRIO", "COQUETTE"},
  1201.     {"CUTTER", "GRESLEY", "DILETTANTE", "DILETTANTE2", "DUNE", "DUNE2", "HOTKNIFE", "DLOADER", "DUBSTA", "DUBSTA2"},
  1202.     {"DUMP", "RUBBLE", "DOCKTUG", "DOMINATOR", "EMPEROR", "EMPEROR2", "EMPEROR3", "ENTITYXF", "EXEMPLAR", "ELEGY2"},
  1203.     {"F620", "FBI", "FBI2", "FELON", "FELON2", "FELTZER2", "FIRETRUK", "FLATBED", "FORKLIFT", "FQ2"},
  1204.     {"FUSILADE", "FUGITIVE", "FUTO", "GRANGER", "GAUNTLET", "HABANERO", "HAULER", "HANDLER", "INFERNUS", "INGOT"},
  1205.     {"INTRUDER", "ISSI2", "JACKAL", "JOURNEY", "JB700", "KHAMELION", "LANDSTALKER", "LGUARD", "MANANA", "MESA"},
  1206.     {"MESA2", "MESA3", "CRUSADER", "MINIVAN", "MIXER", "MIXER2", "MONROE", "MOWER", "MULE", "MULE2"},
  1207.     {"ORACLE", "ORACLE2", "PACKER", "PATRIOT", "PBUS", "PENUMBRA", "PEYOTE", "PHANTOM", "PHOENIX", "PICADOR"},
  1208.     {"POUNDER", "POLICE", "POLICE4", "POLICE2", "POLICE3", "POLICEOLD1", "POLICEOLD2", "PONY", "PONY2", "PRAIRIE"},
  1209.     {"PRANGER", "PREMIER", "PRIMO", "PROPTRAILER", "RANCHERXL", "RANCHERXL2", "RAPIDGT", "RAPIDGT2", "RADI", "RATLOADER"},
  1210.     {"REBEL", "REGINA", "REBEL2", "RENTALBUS", "RUINER", "RUMPO", "RUMPO2", "RHINO", "RIOT", "RIPLEY"},
  1211.     {"ROCOTO", "ROMERO", "SABREGT", "SADLER", "SADLER2", "SANDKING", "SANDKING2", "SCHAFTER2", "SCHWARZER", "SCRAP"},
  1212.     {"SEMINOLE", "SENTINEL", "SENTINEL2", "ZION", "ZION2", "SERRANO", "SHERIFF", "SHERIFF2", "SPEEDO", "SPEEDO2"},
  1213.     {"STANIER", "STINGER", "STINGERGT", "STOCKADE", "STOCKADE3", "STRATUM", "SULTAN", "SUPERD", "SURANO", "SURFER"},
  1214.     {"SURFER2", "SURGE", "TACO", "TAILGATER", "TAXI", "TRASH", "TRACTOR", "TRACTOR2", "TRACTOR3", "GRAINTRAILER"},
  1215.     {"BALETRAILER", "TIPTRUCK", "TIPTRUCK2", "TORNADO", "TORNADO2", "TORNADO3", "TORNADO4", "TOURBUS", "TOWTRUCK", "TOWTRUCK2"},
  1216.     {"UTILLITRUCK", "UTILLITRUCK2", "UTILLITRUCK3", "VOODOO2", "WASHINGTON", "STRETCH", "YOUGA", "ZTYPE", "SANCHEZ", "SANCHEZ2"},
  1217.     {"SCORCHER", "TRIBIKE", "TRIBIKE2", "TRIBIKE3", "FIXTER", "CRUISER", "BMX", "POLICEB", "AKUMA", "CARBONRS"},
  1218.     {"BAGGER", "BATI", "BATI2", "RUFFIAN", "DAEMON", "DOUBLE", "PCJ", "VADER", "VIGERO", "FAGGIO2"},
  1219.     {"HEXER", "ANNIHILATOR", "BUZZARD", "BUZZARD2", "CARGOBOB", "CARGOBOB2", "CARGOBOB3", "SKYLIFT", "POLMAV", "MAVERICK"},
  1220.     {"NEMESIS", "FROGGER", "FROGGER2", "CUBAN800", "DUSTER", "STUNT", "MAMMATUS", "JET", "SHAMAL", "LUXOR"},
  1221.     {"TITAN", "LAZER", "CARGOPLANE", "SQUALO", "MARQUIS", "DINGHY", "DINGHY2", "JETMAX", "PREDATOR", "TROPIC"},
  1222.     {"SEASHARK", "SEASHARK2", "SUBMERSIBLE", "TRAILERS", "TRAILERS2", "TRAILERS3", "TVTRAILER", "RAKETRAILER", "TANKER", "TRAILERLOGS"},
  1223.     {"TR2", "TR3", "TR4", "TRFLAT", "TRAILERSMALL", "VELUM", "ADDER", "VOLTIC", "VACCA", "BIFTA"},
  1224.     { "SPEEDER", "PARADISE", "KALAHARI", "JESTER", "TURISMOR", "VESTRA", "ALPHA", "HUNTLEY", "THRUST", "MASSACRO" },
  1225.     { "MASSACRO2", "ZENTORNO", "BLADE", "GLENDALE", "PANTO", "PIGALLE", "WARRENER", "RHAPSODY", "DUBSTA3", "MONSTER" },
  1226.     { "SOVEREIGN", "INNOVATION", "HAKUCHOU", "FUROREGT", "MILJET", "COQUETTE2", "BTYPE", "BUFFALO3", "DOMINATOR2", "GAUNTLET2" },
  1227.     { "MARSHALL", "DUKES", "DUKES2", "STALION", "STALION2", "BLISTA2", "BLISTA3", "DODO", "SUBMERSIBLE2", "HYDRA" },
  1228.     { "INSURGENT", "INSURGENT2", "TECHNICAL", "SAVAGE", "VALKYRIE", "KURUMA", "KURUMA2", "JESTER2", "CASCO", "VELUM2" },
  1229.     { "GUARDIAN", "ENDURO", "LECTRO", "SLAMVAN", "SLAMVAN2", "RATLOADER2", "", "", "", "" }
  1230. };
  1231.  
  1232. int carspawnActiveLineIndex = 0;
  1233. int carspawnActiveItemIndex = 0;
  1234.  
  1235. bool process_carspawn_menu()
  1236. {
  1237.     DWORD waitTime = 150;
  1238.     const int lineCount = 35;
  1239.     const int itemCount = 10;
  1240.     const int itemCountLastLine = 6;
  1241.     while (true)
  1242.     {
  1243.         // timed menu draw, used for pause after active line switch
  1244.         DWORD maxTickCount = GetTickCount() + waitTime;
  1245.         do
  1246.         {
  1247.             // draw menu
  1248.             char caption[32];
  1249.             sprintf_s(caption, "CAR SPAWNER   %d / %d", carspawnActiveLineIndex + 1, lineCount);
  1250.             draw_menu_line(caption, 350.0, 15.0, 18.0, 0.0, 5.0, false, true);
  1251.             for (int i = 0; i < itemCount; i++)
  1252.                 if (strlen(vehicleModels[carspawnActiveLineIndex][i]))
  1253.                     draw_menu_line(vehicleModels[carspawnActiveLineIndex][i], 100.0, 5.0, 200.0, 100.0 + i * 110.0, 5.0, i == carspawnActiveItemIndex, false, false);
  1254.            
  1255.             update_features();
  1256.             WAIT(0);
  1257.         } while (GetTickCount() < maxTickCount);
  1258.         waitTime = 0;
  1259.  
  1260.         bool bSelect, bBack, bUp, bDown, bLeft, bRight;
  1261.         get_button_state(&bSelect, &bBack, &bUp, &bDown, &bLeft, &bRight);
  1262.        
  1263.         if (bSelect)
  1264.         {
  1265.             menu_beep();
  1266.             LPCSTR modelName = vehicleModels[carspawnActiveLineIndex][carspawnActiveItemIndex];
  1267.             DWORD model = GAMEPLAY::GET_HASH_KEY((char *)modelName);
  1268.             if (STREAMING::IS_MODEL_IN_CDIMAGE(model) && STREAMING::IS_MODEL_A_VEHICLE(model))
  1269.             {
  1270.                 STREAMING::REQUEST_MODEL(model);               
  1271.                 while (!STREAMING::HAS_MODEL_LOADED(model)) WAIT(0);
  1272.                 Vector3 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER::PLAYER_PED_ID(), 0.0, 5.0, 0.0);
  1273.                 Vehicle veh = VEHICLE::CREATE_VEHICLE(model, coords.x, coords.y, coords.z, 0.0, 1, 1);
  1274.                 VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(veh);
  1275.  
  1276.                 if (featureVehWrapInSpawned)
  1277.                 {
  1278.                     ENTITY::SET_ENTITY_HEADING(veh, ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID()));
  1279.                     PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), veh, -1);
  1280.                 }
  1281.  
  1282.                 WAIT(0);
  1283.                 STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(model);
  1284.                 ENTITY::SET_VEHICLE_AS_NO_LONGER_NEEDED(&veh);
  1285.  
  1286.                 char statusText[32];
  1287.                 sprintf_s(statusText, "%s spawned", modelName);
  1288.                 set_status_text(statusText);
  1289.  
  1290.                 return true;
  1291.             }
  1292.         } else
  1293.         if (bBack)
  1294.         {
  1295.             menu_beep();
  1296.             break;
  1297.         } else
  1298.         if (bRight)
  1299.         {
  1300.             menu_beep();
  1301.             carspawnActiveItemIndex++;
  1302.             int itemsMax = (carspawnActiveLineIndex == (lineCount - 1)) ? itemCountLastLine : itemCount;
  1303.             if (carspawnActiveItemIndex == itemsMax)
  1304.                 carspawnActiveItemIndex = 0;           
  1305.             waitTime = 100;
  1306.         } else
  1307.         if (bLeft)
  1308.         {
  1309.             menu_beep();
  1310.             if (carspawnActiveItemIndex == 0)
  1311.                 carspawnActiveItemIndex = (carspawnActiveLineIndex == (lineCount - 1)) ? itemCountLastLine : itemCount;
  1312.             carspawnActiveItemIndex--;
  1313.             waitTime = 100;
  1314.         } else
  1315.         if (bUp)
  1316.         {
  1317.             menu_beep();
  1318.             if (carspawnActiveLineIndex == 0)
  1319.                 carspawnActiveLineIndex = lineCount;
  1320.             carspawnActiveLineIndex--;
  1321.             waitTime = 200;
  1322.         } else
  1323.         if (bDown)
  1324.         {
  1325.             menu_beep();
  1326.             carspawnActiveLineIndex++;
  1327.             if (carspawnActiveLineIndex == lineCount)
  1328.                 carspawnActiveLineIndex = 0;           
  1329.             waitTime = 200;
  1330.         }
  1331.         if (carspawnActiveLineIndex == (lineCount - 1))
  1332.             if (carspawnActiveItemIndex >= itemCountLastLine)
  1333.                 carspawnActiveItemIndex = 0;
  1334.     }
  1335.     return false;
  1336. }
  1337.  
  1338. int activeLineIndexVeh = 0;
  1339.  
  1340. void process_veh_menu()
  1341. {
  1342.     const float lineWidth = 250.0;
  1343.     const int lineCount = 6;
  1344.  
  1345.     std::string caption = "VEHICLE  OPTIONS";
  1346.  
  1347.     static struct {
  1348.         LPCSTR      text;
  1349.         bool        *pState;
  1350.         bool        *pUpdated;
  1351.     } lines[lineCount] = {
  1352.         {"CAR SPAWNER",     NULL, NULL},
  1353.         {"PAINT RANDOM",    NULL, NULL},
  1354.         {"FIX",             NULL, NULL},
  1355.         {"WRAP IN SPAWNED", &featureVehWrapInSpawned, NULL},
  1356.         {"INVINCIBLE",      &featureVehInvincible, &featureVehInvincibleUpdated},
  1357.         {"SPEED BOOST",     &featureVehSpeedBoost, NULL}       
  1358.     };
  1359.  
  1360.     DWORD waitTime = 150;
  1361.     while (true)
  1362.     {
  1363.         // timed menu draw, used for pause after active line switch
  1364.         DWORD maxTickCount = GetTickCount() + waitTime;
  1365.         do
  1366.         {
  1367.             // draw menu
  1368.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1369.             for (int i = 0; i < lineCount; i++)
  1370.                 if (i != activeLineIndexVeh)
  1371.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1372.                                    lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1373.             draw_menu_line(line_as_str(lines[activeLineIndexVeh].text, lines[activeLineIndexVeh].pState),
  1374.                            lineWidth + 1.0, 11.0, 56.0 + activeLineIndexVeh * 36.0, 0.0, 7.0, true, false);
  1375.  
  1376.             update_features();
  1377.             WAIT(0);
  1378.         } while (GetTickCount() < maxTickCount);
  1379.         waitTime = 0;
  1380.  
  1381.         // process buttons
  1382.         bool bSelect, bBack, bUp, bDown;
  1383.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1384.         if (bSelect)
  1385.         {
  1386.             menu_beep();
  1387.  
  1388.             // common variables
  1389.             BOOL bPlayerExists = ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID());
  1390.             Player player = PLAYER::PLAYER_ID();
  1391.             Ped playerPed = PLAYER::PLAYER_PED_ID();
  1392.  
  1393.             switch (activeLineIndexVeh)
  1394.             {
  1395.                 case 0:
  1396.                     if (process_carspawn_menu()) return;               
  1397.                     break;
  1398.                 case 1:
  1399.                     if (bPlayerExists)
  1400.                     {
  1401.                         if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  1402.                         {
  1403.                             Vehicle veh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
  1404.                             VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, rand() % 255, rand() % 255, rand() % 255);
  1405.                             if (VEHICLE::_DOES_VEHICLE_HAVE_SECONDARY_COLOUR(veh))
  1406.                                 VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh, rand() % 255, rand() % 255, rand() % 255);
  1407.                         } else
  1408.                         {
  1409.                             set_status_text("player isn't in a vehicle");
  1410.                         }
  1411.                     }
  1412.                     break;
  1413.                 case 2:
  1414.                     if (bPlayerExists)
  1415.                         if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
  1416.                             VEHICLE::SET_VEHICLE_FIXED(PED::GET_VEHICLE_PED_IS_USING(playerPed));
  1417.                         else
  1418.                             set_status_text("player isn't in a vehicle");
  1419.                     break;
  1420.                 // switchable features
  1421.                 default:
  1422.                     if (lines[activeLineIndexVeh].pState)
  1423.                         *lines[activeLineIndexVeh].pState = !(*lines[activeLineIndexVeh].pState);
  1424.                     if (lines[activeLineIndexVeh].pUpdated)
  1425.                         *lines[activeLineIndexVeh].pUpdated = true;                
  1426.             }
  1427.             waitTime = 200;
  1428.         } else
  1429.         if (bBack || trainer_switch_pressed())
  1430.         {
  1431.             menu_beep();
  1432.             break;
  1433.         } else
  1434.         if (bUp)
  1435.         {
  1436.             menu_beep();
  1437.             if (activeLineIndexVeh == 0)
  1438.                 activeLineIndexVeh = lineCount;
  1439.             activeLineIndexVeh--;
  1440.             waitTime = 150;
  1441.         } else
  1442.         if (bDown)
  1443.         {
  1444.             menu_beep();
  1445.             activeLineIndexVeh++;
  1446.             if (activeLineIndexVeh == lineCount)
  1447.                 activeLineIndexVeh = 0;        
  1448.             waitTime = 150;
  1449.         }
  1450.     }
  1451. }
  1452.  
  1453. int activeLineIndexWorld = 0;
  1454.  
  1455. void process_world_menu()
  1456. {
  1457.     const float lineWidth = 250.0;
  1458.     const int lineCount = 5;
  1459.  
  1460.     std::string caption = "WORLD  OPTIONS";
  1461.  
  1462.     static struct {
  1463.         LPCSTR      text;
  1464.         bool        *pState;
  1465.         bool        *pUpdated;
  1466.     } lines[lineCount] = {
  1467.         { "MOON GRAVITY", &featureWorldMoonGravity, NULL },
  1468.         { "RANDOM COPS", &featureWorldRandomCops, NULL },
  1469.         { "RANDOM TRAINS", &featureWorldRandomTrains, NULL },
  1470.         { "RANDOM BOATS", &featureWorldRandomBoats, NULL },
  1471.         { "GARBAGE TRUCKS", &featureWorldGarbageTrucks, NULL }
  1472.     };
  1473.  
  1474.     DWORD waitTime = 150;
  1475.     while (true)
  1476.     {
  1477.         // timed menu draw, used for pause after active line switch
  1478.         DWORD maxTickCount = GetTickCount() + waitTime;
  1479.         do
  1480.         {
  1481.             // draw menu
  1482.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1483.             for (int i = 0; i < lineCount; i++)
  1484.                 if (i != activeLineIndexWorld)
  1485.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1486.                     lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1487.             draw_menu_line(line_as_str(lines[activeLineIndexWorld].text, lines[activeLineIndexWorld].pState),
  1488.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexWorld * 36.0, 0.0, 7.0, true, false);
  1489.  
  1490.             update_features();
  1491.             WAIT(0);
  1492.         } while (GetTickCount() < maxTickCount);
  1493.         waitTime = 0;
  1494.  
  1495.         // process buttons
  1496.         bool bSelect, bBack, bUp, bDown;
  1497.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1498.         if (bSelect)
  1499.         {
  1500.             menu_beep();
  1501.             switch (activeLineIndexWorld)
  1502.             {
  1503.                 case 0:
  1504.                     featureWorldMoonGravity = !featureWorldMoonGravity;
  1505.                     GAMEPLAY::SET_GRAVITY_LEVEL(featureWorldMoonGravity);
  1506.                     break;
  1507.                 case 1:
  1508.                     // featureWorldRandomCops being set in update_features
  1509.                     PED::SET_CREATE_RANDOM_COPS(!featureWorldRandomCops);
  1510.                     break;
  1511.                 case 2:
  1512.                     featureWorldRandomTrains = !featureWorldRandomTrains;
  1513.                     VEHICLE::SET_RANDOM_TRAINS(featureWorldRandomTrains);
  1514.                     break;
  1515.                 case 3:
  1516.                     featureWorldRandomBoats = !featureWorldRandomBoats;
  1517.                     VEHICLE::SET_RANDOM_BOATS(featureWorldRandomBoats);
  1518.                     break;
  1519.                 case 4:
  1520.                     featureWorldGarbageTrucks = !featureWorldGarbageTrucks;
  1521.                     VEHICLE::SET_GARBAGE_TRUCKS(featureWorldGarbageTrucks);
  1522.                     break;
  1523.             }
  1524.             waitTime = 200;
  1525.         } else
  1526.         if (bBack || trainer_switch_pressed())
  1527.         {
  1528.             menu_beep();
  1529.             break;
  1530.         } else
  1531.         if (bUp)
  1532.         {
  1533.             menu_beep();
  1534.             if (activeLineIndexWorld == 0)
  1535.                 activeLineIndexWorld = lineCount;
  1536.             activeLineIndexWorld--;
  1537.             waitTime = 150;
  1538.         } else
  1539.         if (bDown)
  1540.         {
  1541.             menu_beep();
  1542.             activeLineIndexWorld++;
  1543.             if (activeLineIndexWorld == lineCount)
  1544.                 activeLineIndexWorld = 0;          
  1545.             waitTime = 150;
  1546.         }
  1547.     }
  1548. }
  1549.  
  1550. int activeLineIndexTime = 0;
  1551.  
  1552. void process_time_menu()
  1553. {
  1554.     const float lineWidth = 250.0;
  1555.     const int lineCount = 4;
  1556.  
  1557.     std::string caption = "TIME  OPTIONS";
  1558.  
  1559.     static struct {
  1560.         LPCSTR      text;
  1561.         bool        *pState;
  1562.         bool        *pUpdated;
  1563.     } lines[lineCount] = {
  1564.         {"HOUR FORWARD",     NULL,               NULL},
  1565.         {"HOUR BACKWARD",    NULL,               NULL},
  1566.         {"CLOCK PAUSED",     &featureTimePaused, &featureTimePausedUpdated},
  1567.         {"SYNC WITH SYSTEM", &featureTimeSynced, NULL}
  1568.     };
  1569.  
  1570.     DWORD waitTime = 150;
  1571.     while (true)
  1572.     {
  1573.         // timed menu draw, used for pause after active line switch
  1574.         DWORD maxTickCount = GetTickCount() + waitTime;
  1575.         do
  1576.         {
  1577.             // draw menu
  1578.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1579.             for (int i = 0; i < lineCount; i++)
  1580.                 if (i != activeLineIndexTime)
  1581.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1582.                     lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1583.             draw_menu_line(line_as_str(lines[activeLineIndexTime].text, lines[activeLineIndexTime].pState),
  1584.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexTime * 36.0, 0.0, 7.0, true, false);
  1585.  
  1586.             update_features();
  1587.             WAIT(0);
  1588.         } while (GetTickCount() < maxTickCount);
  1589.         waitTime = 0;
  1590.  
  1591.         // process buttons
  1592.         bool bSelect, bBack, bUp, bDown;
  1593.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1594.         if (bSelect)
  1595.         {
  1596.             menu_beep();
  1597.             switch (activeLineIndexTime)
  1598.             {
  1599.             // hour forward/backward
  1600.             case 0:
  1601.             case 1:
  1602.                 {
  1603.                     int h = TIME::GET_CLOCK_HOURS();
  1604.                     if (activeLineIndexTime == 0) h = (h == 23) ? 0 : h + 1; else h = (h == 0) ? 23 : h - 1;
  1605.                     int m = TIME::GET_CLOCK_MINUTES();
  1606.                     TIME::SET_CLOCK_TIME(h, m, 0);
  1607.                     char text[32];
  1608.                     sprintf_s(text, "time %d:%d", h, m);
  1609.                     set_status_text(text);
  1610.                 }
  1611.                 break;
  1612.             // switchable features
  1613.             default:
  1614.                 if (lines[activeLineIndexTime].pState)
  1615.                     *lines[activeLineIndexTime].pState = !(*lines[activeLineIndexTime].pState);
  1616.                 if (lines[activeLineIndexTime].pUpdated)
  1617.                     *lines[activeLineIndexTime].pUpdated = true;   
  1618.             }
  1619.             waitTime = 200;
  1620.         } else
  1621.         if (bBack || trainer_switch_pressed())
  1622.         {
  1623.             menu_beep();
  1624.             break;
  1625.         } else
  1626.         if (bUp)
  1627.         {
  1628.             menu_beep();
  1629.             if (activeLineIndexTime == 0)
  1630.                 activeLineIndexTime = lineCount;
  1631.             activeLineIndexTime--;
  1632.             waitTime = 150;
  1633.         } else
  1634.         if (bDown)
  1635.         {
  1636.             menu_beep();
  1637.             activeLineIndexTime++;
  1638.             if (activeLineIndexTime == lineCount)
  1639.                 activeLineIndexTime = 0;           
  1640.             waitTime = 150;
  1641.         }
  1642.     }
  1643. }
  1644.  
  1645. int activeLineIndexWeather = 0;
  1646.  
  1647. void process_weather_menu()
  1648. {
  1649.     const float lineWidth = 250.0;
  1650.     const int lineCount = 15;
  1651.  
  1652.     std::string caption = "WEATHER  OPTIONS";
  1653.  
  1654.     static struct {
  1655.         LPCSTR      text;
  1656.         bool        *pState;
  1657.         bool        *pUpdated;
  1658.     } lines[lineCount] = {
  1659.         {"WIND",        &featureWeatherWind,    NULL},
  1660.         {"EXTRASUNNY"NULL,                   NULL},
  1661.         {"CLEAR",       NULL,                   NULL},
  1662.         {"CLOUDS",      NULL,                   NULL},
  1663.         {"SMOG",        NULL,                   NULL},
  1664.         {"FOGGY",       NULL,                   NULL},
  1665.         {"OVERCAST",    NULL,                   NULL},
  1666.         {"RAIN",        NULL,                   NULL},
  1667.         {"THUNDER",     NULL,                   NULL},
  1668.         {"CLEARING",    NULL,                   NULL},
  1669.         {"NEUTRAL",     NULL,                   NULL},
  1670.         {"SNOW",        NULL,                   NULL},
  1671.         {"BLIZZARD",    NULL,                   NULL},
  1672.         {"SNOWLIGHT",   NULL,                   NULL},
  1673.         {"XMAS",        NULL,                   NULL}
  1674.     };
  1675.  
  1676.  
  1677.     DWORD waitTime = 150;
  1678.     while (true)
  1679.     {
  1680.         // timed menu draw, used for pause after active line switch
  1681.         DWORD maxTickCount = GetTickCount() + waitTime;
  1682.         do
  1683.         {
  1684.             // draw menu
  1685.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1686.             for (int i = 0; i < lineCount; i++)
  1687.                 if (i != activeLineIndexWeather)
  1688.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1689.                     lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1690.             draw_menu_line(line_as_str(lines[activeLineIndexWeather].text, lines[activeLineIndexWeather].pState),
  1691.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexWeather * 36.0, 0.0, 7.0, true, false);
  1692.  
  1693.             update_features();
  1694.             WAIT(0);
  1695.         } while (GetTickCount() < maxTickCount);
  1696.         waitTime = 0;
  1697.  
  1698.         // process buttons
  1699.         bool bSelect, bBack, bUp, bDown;
  1700.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1701.         if (bSelect)
  1702.         {
  1703.             menu_beep();
  1704.             switch (activeLineIndexWeather)
  1705.             {
  1706.             // wind
  1707.             case 0:
  1708.                 featureWeatherWind = !featureWeatherWind;
  1709.                 if (featureWeatherWind)
  1710.                 {
  1711.                     GAMEPLAY::SET_WIND(1.0);
  1712.                     GAMEPLAY::SET_WIND_SPEED(11.99);
  1713.                     GAMEPLAY::SET_WIND_DIRECTION(ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID()));
  1714.                 } else
  1715.                 {
  1716.                     GAMEPLAY::SET_WIND(0.0);
  1717.                     GAMEPLAY::SET_WIND_SPEED(0.0);
  1718.                 }
  1719.                 break;
  1720.             // set weather
  1721.             default:
  1722.                 GAMEPLAY::SET_WEATHER_TYPE_NOW_PERSIST((char *)lines[activeLineIndexWeather].text);
  1723.                 GAMEPLAY::CLEAR_WEATHER_TYPE_PERSIST();
  1724.                 set_status_text(lines[activeLineIndexWeather].text);
  1725.             }
  1726.             waitTime = 200;
  1727.         } else
  1728.         if (bBack || trainer_switch_pressed())
  1729.         {
  1730.             menu_beep();
  1731.             break;
  1732.         } else
  1733.         if (bUp)
  1734.         {
  1735.             menu_beep();
  1736.             if (activeLineIndexWeather == 0)
  1737.                 activeLineIndexWeather = lineCount;
  1738.             activeLineIndexWeather--;
  1739.             waitTime = 150;
  1740.         } else
  1741.         if (bDown)
  1742.         {
  1743.             menu_beep();
  1744.             activeLineIndexWeather++;
  1745.             if (activeLineIndexWeather == lineCount)
  1746.                 activeLineIndexWeather = 0;        
  1747.             waitTime = 150;
  1748.         }
  1749.     }
  1750. }
  1751.  
  1752. int activeLineIndexMisc = 0;
  1753.  
  1754. void process_misc_menu()
  1755. {
  1756.     const float lineWidth = 300.0;
  1757.     const int lineCount = 2;
  1758.  
  1759.     std::string caption = "MISC  OPTIONS";
  1760.  
  1761.     static struct {
  1762.         LPCSTR      text;
  1763.         bool        *pState;
  1764.         bool        *pUpdated;
  1765.     } lines[lineCount] = {
  1766.         { "NEXT RADIO TRACK", NULL, NULL },
  1767.         { "HIDE HUD", &featureMiscHideHud, NULL}       
  1768.     };
  1769.  
  1770.  
  1771.     DWORD waitTime = 150;
  1772.     while (true)
  1773.     {
  1774.         // timed menu draw, used for pause after active line switch
  1775.         DWORD maxTickCount = GetTickCount() + waitTime;
  1776.         do
  1777.         {
  1778.             // draw menu
  1779.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1780.             for (int i = 0; i < lineCount; i++)
  1781.                 if (i != activeLineIndexMisc)
  1782.                     draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1783.                     lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1784.             draw_menu_line(line_as_str(lines[activeLineIndexMisc].text, lines[activeLineIndexMisc].pState),
  1785.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexMisc * 36.0, 0.0, 7.0, true, false);
  1786.  
  1787.             update_features();
  1788.             WAIT(0);
  1789.         } while (GetTickCount() < maxTickCount);
  1790.         waitTime = 0;
  1791.  
  1792.         // process buttons
  1793.         bool bSelect, bBack, bUp, bDown;
  1794.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1795.         if (bSelect)
  1796.         {
  1797.             menu_beep();
  1798.             switch (activeLineIndexMisc)
  1799.             {
  1800.             // next radio track
  1801.             case 0:
  1802.                 if (ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID()) &&
  1803.                     PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID(), 0))
  1804.                         AUDIO::SKIP_RADIO_FORWARD();
  1805.                 break;
  1806.             // switchable features
  1807.             default:
  1808.                 if (lines[activeLineIndexMisc].pState)
  1809.                     *lines[activeLineIndexMisc].pState = !(*lines[activeLineIndexMisc].pState);
  1810.                 if (lines[activeLineIndexMisc].pUpdated)
  1811.                     *lines[activeLineIndexMisc].pUpdated = true;
  1812.             }
  1813.             waitTime = 200;
  1814.         } else
  1815.         if (bBack || trainer_switch_pressed())
  1816.         {
  1817.             menu_beep();
  1818.             break;
  1819.         } else
  1820.         if (bUp)
  1821.         {
  1822.             menu_beep();
  1823.             if (activeLineIndexMisc == 0)
  1824.                 activeLineIndexMisc = lineCount;
  1825.             activeLineIndexMisc--;
  1826.             waitTime = 150;
  1827.         } else
  1828.         if (bDown)
  1829.         {
  1830.             menu_beep();
  1831.             activeLineIndexMisc++;
  1832.             if (activeLineIndexMisc == lineCount)
  1833.                 activeLineIndexMisc = 0;           
  1834.             waitTime = 150;
  1835.         }
  1836.     }
  1837. }
  1838.  
  1839. int activeLineIndexGUChangePos = 0;
  1840. Vector3 savedCoords;
  1841. bool hasSavedCoords = false;
  1842.  
  1843. void process_gu_changepos_menu()
  1844. {
  1845.     const float lineWidth = 250.0;
  1846.     const int lineCount = 15;
  1847.  
  1848.     std::string caption = "CHANGE POS";
  1849.  
  1850.     static struct {
  1851.         LPCSTR  text;
  1852.         bool *pState;
  1853.         bool *pUpdated;
  1854.     } lines[lineCount] = {
  1855.         { "SAVE CURRENT POS", NULL, NULL },
  1856.         { "JUMP TO SAVED POS", NULL, NULL },
  1857.         { "POS +X (FORWARD) 1", NULL, NULL },
  1858.         { "POS +X (FORWARD) 5", NULL, NULL },
  1859.         { "POS -X (BACKWARD) 1", NULL, NULL },
  1860.         { "POS -X (BACKWARD) 5", NULL, NULL },
  1861.         { "POS -Y (LEFT) 1", NULL, NULL },
  1862.         { "POS -Y (LEFT) 5", NULL, NULL },
  1863.         { "POS +Y (RIGHT) 1", NULL, NULL },
  1864.         { "POS +Y (RIGHT) 5", NULL, NULL },
  1865.         { "POS +Z (UP) 1", NULL, NULL },
  1866.         { "POS +Z (UP) 5", NULL, NULL },
  1867.         { "POS -Z (DOWN) 1", NULL, NULL },
  1868.         { "POS -Z (DOWN) 5", NULL, NULL },
  1869.         { "HOLD POS", &featureChangePosHoldPos, NULL }
  1870.     };
  1871.  
  1872.     DWORD waitTime = 150;
  1873.     while (true)
  1874.     {
  1875.         // timed menu draw, used for pause after active line switch
  1876.         DWORD maxTickCount = GetTickCount() + waitTime;
  1877.         do
  1878.         {
  1879.             // draw menu
  1880.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  1881.             for (int i = 0; i < lineCount; i++)
  1882.             if (i != activeLineIndexGUChangePos)
  1883.                 draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  1884.                 lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  1885.             draw_menu_line(line_as_str(lines[activeLineIndexGUChangePos].text, lines[activeLineIndexGUChangePos].pState),
  1886.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexGUChangePos * 36.0, 0.0, 7.0, true, false);
  1887.  
  1888.             update_features();
  1889.             WAIT(0);
  1890.         } while (GetTickCount() < maxTickCount);
  1891.         waitTime = 0;
  1892.  
  1893.         // process buttons
  1894.         bool bSelect, bBack, bUp, bDown;
  1895.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  1896.         if (bSelect)
  1897.         {
  1898.             menu_beep();
  1899.  
  1900.             // get entity to change position
  1901.             Entity e = PLAYER::PLAYER_PED_ID();
  1902.             if (PED::IS_PED_IN_ANY_VEHICLE(e, 0))
  1903.                 e = PED::GET_VEHICLE_PED_IS_USING(e);
  1904.  
  1905.             // get coords
  1906.             Vector3 coords;
  1907.  
  1908.             bool success = false;
  1909.             if (activeLineIndexGUChangePos == 0) // save current pos
  1910.             {
  1911.                 savedCoords = ENTITY::GET_ENTITY_COORDS(e, TRUE);
  1912.                 hasSavedCoords = true;
  1913.  
  1914.                 set_status_text("Saved coordinates");
  1915.             }
  1916.             else if (activeLineIndexGUChangePos == 1) // jump to saved pos
  1917.             {
  1918.                 if (hasSavedCoords == true) {
  1919.                     coords = savedCoords;
  1920.                     success = true;
  1921.                 }
  1922.                 else {
  1923.                     set_status_text("No saved coordinates found");
  1924.                 }
  1925.             }
  1926.             else if (activeLineIndexGUChangePos == 2) // pos forward 1
  1927.             {
  1928.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, 1.0, 0.0);
  1929.                 success = true;
  1930.             }
  1931.             else if (activeLineIndexGUChangePos == 3) // pos forward 5
  1932.             {
  1933.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, 5.0, 0.0);
  1934.                 success = true;
  1935.             }
  1936.             else if (activeLineIndexGUChangePos == 4) // pos backward 1
  1937.             {
  1938.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, -1.0, 0.0);
  1939.                 success = true;
  1940.             }
  1941.             else if (activeLineIndexGUChangePos == 5) // pos backward 5
  1942.             {
  1943.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, -5.0, 0.0);
  1944.                 success = true;
  1945.             }
  1946.             else if (activeLineIndexGUChangePos == 6) // pos left 1
  1947.             {
  1948.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, -1.0, 0.0, 0.0);
  1949.                 success = true;
  1950.             }
  1951.             else if (activeLineIndexGUChangePos == 7) // pos left 5
  1952.             {
  1953.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, -5.0, 0.0, 0.0);
  1954.                 success = true;
  1955.             }
  1956.             else if (activeLineIndexGUChangePos == 8) // pos right 1
  1957.             {
  1958.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 1.0, 0.0, 0.0);
  1959.                 success = true;
  1960.             }
  1961.             else if (activeLineIndexGUChangePos == 9) // pos right 5
  1962.             {
  1963.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 5.0, 0.0, 0.0);
  1964.                 success = true;
  1965.             }
  1966.             else if (activeLineIndexGUChangePos == 10) // pos up 1
  1967.             {
  1968.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, 0.0, 1.0);
  1969.                 success = true;
  1970.             }
  1971.             else if (activeLineIndexGUChangePos == 11) // pos up 5
  1972.             {
  1973.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, 0.0, 5.0);
  1974.                 success = true;
  1975.             }
  1976.             else if (activeLineIndexGUChangePos == 12) // pos down 1
  1977.             {
  1978.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, 0.0, -1.0);
  1979.                 success = true;
  1980.             }
  1981.             else if (activeLineIndexGUChangePos == 13) // pos down 5
  1982.             {
  1983.                 coords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(e, 0.0, 0.0, -5.0);
  1984.                 success = true;
  1985.             }
  1986.             // set player pos
  1987.             if (success)
  1988.             {
  1989.                 ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, coords.x, coords.y, coords.z, 0, 0, 1);
  1990.                 WAIT(0);
  1991.  
  1992.                 set_status_text("Changed position");
  1993.                 //return true;
  1994.             }
  1995.  
  1996.             if (lines[activeLineIndexGUChangePos].pState)
  1997.                 *lines[activeLineIndexGUChangePos].pState = !(*lines[activeLineIndexGUChangePos].pState);
  1998.             if (lines[activeLineIndexGUChangePos].pUpdated)
  1999.                 *lines[activeLineIndexGUChangePos].pUpdated = true;
  2000.  
  2001.             waitTime = 200;
  2002.         }
  2003.         else
  2004.         if (bBack || trainer_switch_pressed())
  2005.         {
  2006.             menu_beep();
  2007.             break;
  2008.         }
  2009.         else
  2010.         if (bUp)
  2011.         {
  2012.             menu_beep();
  2013.             if (activeLineIndexGUChangePos == 0)
  2014.                 activeLineIndexGUChangePos = lineCount;
  2015.             activeLineIndexGUChangePos--;
  2016.             waitTime = 150;
  2017.         }
  2018.         else
  2019.         if (bDown)
  2020.         {
  2021.             menu_beep();
  2022.             activeLineIndexGUChangePos++;
  2023.             if (activeLineIndexGUChangePos == lineCount)
  2024.                 activeLineIndexGUChangePos = 0;
  2025.             waitTime = 150;
  2026.         }
  2027.     }
  2028. }
  2029.  
  2030. int activeLineIndexGUCustomTele = 0;
  2031. int activeItemIndexGUCustomTele = 0;
  2032.  
  2033. std::vector<std::string> vecCustomTeleName;
  2034. std::vector<float> vecCustomTeleX;
  2035. std::vector<float> vecCustomTeleY;
  2036. std::vector<float> vecCustomTeleZ;
  2037. int pCountCustomTele = 0;
  2038.  
  2039. void process_gu_customtele_menu()
  2040. {
  2041.     DWORD waitTime = 150;
  2042.     int lineCount = pCountCustomTele;
  2043.     int itemCount = 10;
  2044.     int itemCountLastLine = 10 - ((pCountCustomTele * 10) - (int)vecCustomTeleName.size());
  2045.     while (true)
  2046.     {
  2047.         // timed menu draw, used for pause after active line switch
  2048.         DWORD maxTickCount = GetTickCount() + waitTime;
  2049.         do
  2050.         {
  2051.             // draw menu
  2052.             char caption[32];
  2053.             sprintf_s(caption, "CUSTOM TELEPORT   %d / %d", activeLineIndexGUCustomTele + 1, lineCount);
  2054.             draw_menu_line(caption, 350.0, 15.0, 18.0, 0.0, 5.0, false, true);
  2055.             if (activeLineIndexGUCustomTele == (lineCount - 1)) {
  2056.                 for (int i = 0; i < itemCountLastLine; i++)
  2057.                 {
  2058.                     draw_menu_line(vecCustomTeleName[i + (activeLineIndexGUCustomTele * 10)], 100.0, 5.0, 200.0, 100.0 + i * 110.0, 5.0, i == activeItemIndexGUCustomTele, false, false);
  2059.                 }
  2060.             }
  2061.             else {
  2062.                 for (int i = 0; i < itemCount; i++)
  2063.                 {
  2064.                     draw_menu_line(vecCustomTeleName[i + (activeLineIndexGUCustomTele * 10)], 100.0, 5.0, 200.0, 100.0 + i * 110.0, 5.0, i == activeItemIndexGUCustomTele, false, false);
  2065.                 }
  2066.             }
  2067.  
  2068.  
  2069.             update_features();
  2070.             WAIT(0);
  2071.         } while (GetTickCount() < maxTickCount);
  2072.         waitTime = 0;
  2073.  
  2074.         bool bSelect, bBack, bUp, bDown, bLeft, bRight;
  2075.         get_button_state(&bSelect, &bBack, &bUp, &bDown, &bLeft, &bRight);
  2076.  
  2077.         // get entity to change position
  2078.         Entity e = PLAYER::PLAYER_PED_ID();
  2079.         if (PED::IS_PED_IN_ANY_VEHICLE(e, 0))
  2080.             e = PED::GET_VEHICLE_PED_IS_USING(e);
  2081.  
  2082.         // get coords
  2083.         Vector3 coords;
  2084.  
  2085.         if (bSelect)
  2086.         {
  2087.             menu_beep();
  2088.            
  2089.             coords.x = vecCustomTeleX[(activeLineIndexGUCustomTele * 10) + activeItemIndexGUCustomTele];
  2090.             coords.y = vecCustomTeleY[(activeLineIndexGUCustomTele * 10) + activeItemIndexGUCustomTele];
  2091.             coords.z = vecCustomTeleZ[(activeLineIndexGUCustomTele * 10) + activeItemIndexGUCustomTele];
  2092.  
  2093.             ENTITY::SET_ENTITY_COORDS_NO_OFFSET(e, coords.x, coords.y, coords.z, 0, 0, 1);
  2094.  
  2095.             set_status_text("Teleported to " + vecCustomTeleName[(activeLineIndexGUCustomTele * 10) + activeItemIndexGUCustomTele]);
  2096.  
  2097.             waitTime = 200;
  2098.         }
  2099.         else
  2100.         if (bBack)
  2101.         {
  2102.             menu_beep();
  2103.             break;
  2104.         }
  2105.         else
  2106.         if (bRight)
  2107.         {
  2108.             menu_beep();
  2109.             activeItemIndexGUCustomTele++;
  2110.             int itemsMax = (activeLineIndexGUCustomTele == (lineCount - 1)) ? itemCountLastLine : itemCount;
  2111.             if (activeItemIndexGUCustomTele == itemsMax)
  2112.                 activeItemIndexGUCustomTele = 0;
  2113.             waitTime = 100;
  2114.         }
  2115.         else
  2116.         if (bLeft)
  2117.         {
  2118.             menu_beep();
  2119.             if (activeItemIndexGUCustomTele == 0)
  2120.                 activeItemIndexGUCustomTele = (activeLineIndexGUCustomTele == (lineCount - 1)) ? itemCountLastLine : itemCount;
  2121.             activeItemIndexGUCustomTele--;
  2122.             waitTime = 100;
  2123.         }
  2124.         else
  2125.         if (bUp)
  2126.         {
  2127.             menu_beep();
  2128.             if (activeLineIndexGUCustomTele == 0)
  2129.                 activeLineIndexGUCustomTele = lineCount;
  2130.             activeLineIndexGUCustomTele--;
  2131.             waitTime = 200;
  2132.         }
  2133.         else
  2134.         if (bDown)
  2135.         {
  2136.             menu_beep();
  2137.             activeLineIndexGUCustomTele++;
  2138.             if (activeLineIndexGUCustomTele == lineCount)
  2139.                 activeLineIndexGUCustomTele = 0;
  2140.             waitTime = 200;
  2141.         }
  2142.         if (activeLineIndexGUCustomTele == (lineCount - 1))
  2143.         if (activeItemIndexGUCustomTele >= itemCountLastLine)
  2144.             activeItemIndexGUCustomTele = 0;
  2145.     }
  2146. }
  2147.  
  2148. int activeLineIndexGULoadArea = 0;
  2149.  
  2150. void process_gu_loadarea_menu()
  2151. {
  2152.     const float lineWidth = 300.0;
  2153.     const int lineCount = 1;
  2154.  
  2155.     std::string caption = "LOAD AREA";
  2156.  
  2157.     static struct {
  2158.         LPCSTR  text;
  2159.         bool *pState;
  2160.         bool *pUpdated;
  2161.     } lines[lineCount] = {
  2162.         { "NORTH YANKTON", NULL, NULL }
  2163.     };
  2164.  
  2165.     DWORD waitTime = 150;
  2166.     while (true)
  2167.     {
  2168.         // timed menu draw, used for pause after active line switch
  2169.         DWORD maxTickCount = GetTickCount() + waitTime;
  2170.         do
  2171.         {
  2172.             // draw menu
  2173.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  2174.             for (int i = 0; i < lineCount; i++)
  2175.             if (i != activeLineIndexGULoadArea)
  2176.                 draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  2177.                 lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  2178.             draw_menu_line(line_as_str(lines[activeLineIndexGULoadArea].text, lines[activeLineIndexGULoadArea].pState),
  2179.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexGULoadArea * 36.0, 0.0, 7.0, true, false);
  2180.  
  2181.             update_features();
  2182.             WAIT(0);
  2183.         } while (GetTickCount() < maxTickCount);
  2184.         waitTime = 0;
  2185.  
  2186.         // process buttons
  2187.         bool bSelect, bBack, bUp, bDown;
  2188.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  2189.         if (bSelect)
  2190.         {
  2191.             menu_beep();
  2192.  
  2193.             if (activeLineIndexGULoadArea == 0) // load north yankton
  2194.             {
  2195.                 if (ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID()))
  2196.                 {
  2197.                     STREAMING::REQUEST_IPL("plg_01");
  2198.                     STREAMING::REQUEST_IPL("prologue01");
  2199.                     STREAMING::REQUEST_IPL("prologue01_lod");
  2200.                     STREAMING::REQUEST_IPL("prologue01c");
  2201.                     STREAMING::REQUEST_IPL("prologue01c_lod");
  2202.                     STREAMING::REQUEST_IPL("prologue01d");
  2203.                     STREAMING::REQUEST_IPL("prologue01d_lod");
  2204.                     STREAMING::REQUEST_IPL("prologue01e");
  2205.                     STREAMING::REQUEST_IPL("prologue01e_lod");
  2206.                     STREAMING::REQUEST_IPL("prologue01f");
  2207.                     STREAMING::REQUEST_IPL("prologue01f_lod");
  2208.                     STREAMING::REQUEST_IPL("prologue01g");
  2209.                     STREAMING::REQUEST_IPL("prologue01h");
  2210.                     STREAMING::REQUEST_IPL("prologue01h_lod");
  2211.                     STREAMING::REQUEST_IPL("prologue01i");
  2212.                     STREAMING::REQUEST_IPL("prologue01i_lod");
  2213.                     STREAMING::REQUEST_IPL("prologue01j");
  2214.                     STREAMING::REQUEST_IPL("prologue01j_lod");
  2215.                     STREAMING::REQUEST_IPL("prologue01k");
  2216.                     STREAMING::REQUEST_IPL("prologue01k_lod");
  2217.                     STREAMING::REQUEST_IPL("prologue01z");
  2218.                     STREAMING::REQUEST_IPL("prologue01z_lod");
  2219.                     STREAMING::REQUEST_IPL("plg_02");
  2220.                     STREAMING::REQUEST_IPL("prologue02");
  2221.                     STREAMING::REQUEST_IPL("prologue02_lod");
  2222.                     STREAMING::REQUEST_IPL("plg_03");
  2223.                     STREAMING::REQUEST_IPL("prologue03");
  2224.                     STREAMING::REQUEST_IPL("prologue03_lod");
  2225.                     STREAMING::REQUEST_IPL("prologue03b");
  2226.                     STREAMING::REQUEST_IPL("prologue03b_lod");
  2227.                     //the commented code disables the 'Prologue' grave and
  2228.                     //enables the 'Bury the Hatchet' grave
  2229.                     //STREAMING::REQUEST_IPL("prologue03_grv_cov");
  2230.                     //STREAMING::REQUEST_IPL("prologue03_grv_cov_lod");
  2231.                     STREAMING::REQUEST_IPL("prologue03_grv_dug");
  2232.                     STREAMING::REQUEST_IPL("prologue03_grv_dug_lod");
  2233.                     //STREAMING::REQUEST_IPL("prologue03_grv_fun");
  2234.                     STREAMING::REQUEST_IPL("prologue_grv_torch");
  2235.                     STREAMING::REQUEST_IPL("plg_04");
  2236.                     STREAMING::REQUEST_IPL("prologue04");
  2237.                     STREAMING::REQUEST_IPL("prologue04_lod");
  2238.                     STREAMING::REQUEST_IPL("prologue04b");
  2239.                     STREAMING::REQUEST_IPL("prologue04b_lod");
  2240.                     STREAMING::REQUEST_IPL("prologue04_cover");
  2241.                     STREAMING::REQUEST_IPL("des_protree_end");
  2242.                     STREAMING::REQUEST_IPL("des_protree_start");
  2243.                     STREAMING::REQUEST_IPL("des_protree_start_lod");
  2244.                     STREAMING::REQUEST_IPL("plg_05");
  2245.                     STREAMING::REQUEST_IPL("prologue05");
  2246.                     STREAMING::REQUEST_IPL("prologue05_lod");
  2247.                     STREAMING::REQUEST_IPL("prologue05b");
  2248.                     STREAMING::REQUEST_IPL("prologue05b_lod");
  2249.                     STREAMING::REQUEST_IPL("plg_06");
  2250.                     STREAMING::REQUEST_IPL("prologue06");
  2251.                     STREAMING::REQUEST_IPL("prologue06_lod");
  2252.                     STREAMING::REQUEST_IPL("prologue06b");
  2253.                     STREAMING::REQUEST_IPL("prologue06b_lod");
  2254.                     STREAMING::REQUEST_IPL("prologue06_int");
  2255.                     STREAMING::REQUEST_IPL("prologue06_int_lod");
  2256.                     STREAMING::REQUEST_IPL("prologue06_pannel");
  2257.                     STREAMING::REQUEST_IPL("prologue06_pannel_lod");
  2258.                     STREAMING::REQUEST_IPL("prologue_m2_door");
  2259.                     STREAMING::REQUEST_IPL("prologue_m2_door_lod");
  2260.                     STREAMING::REQUEST_IPL("plg_occl_00");
  2261.                     STREAMING::REQUEST_IPL("prologue_occl");
  2262.                     STREAMING::REQUEST_IPL("plg_rd");
  2263.                     STREAMING::REQUEST_IPL("prologuerd");
  2264.                     STREAMING::REQUEST_IPL("prologuerdb");
  2265.                     STREAMING::REQUEST_IPL("prologuerd_lod");
  2266.  
  2267.                     set_status_text("North Yankton Loaded");
  2268.                 }
  2269.             }
  2270.  
  2271.             if (lines[activeLineIndexGULoadArea].pState)
  2272.                 *lines[activeLineIndexGULoadArea].pState = !(*lines[activeLineIndexGULoadArea].pState);
  2273.             if (lines[activeLineIndexGULoadArea].pUpdated)
  2274.                 *lines[activeLineIndexGULoadArea].pUpdated = true;
  2275.  
  2276.             waitTime = 200;
  2277.         }
  2278.         else
  2279.         if (bBack || trainer_switch_pressed())
  2280.         {
  2281.             menu_beep();
  2282.             break;
  2283.         }
  2284.         else
  2285.         if (bUp)
  2286.         {
  2287.             menu_beep();
  2288.             if (activeLineIndexGULoadArea == 0)
  2289.                 activeLineIndexGULoadArea = lineCount;
  2290.             activeLineIndexGULoadArea--;
  2291.             waitTime = 150;
  2292.         }
  2293.         else
  2294.         if (bDown)
  2295.         {
  2296.             menu_beep();
  2297.             activeLineIndexGULoadArea++;
  2298.             if (activeLineIndexGULoadArea == lineCount)
  2299.                 activeLineIndexGULoadArea = 0;
  2300.             waitTime = 150;
  2301.         }
  2302.     }
  2303. }
  2304.  
  2305. // GU Misc
  2306.  
  2307. int activeLineIndexGUMisc = 0;
  2308.  
  2309. void process_gu_misc_menu()
  2310. {
  2311.     const float lineWidth = 300.0;
  2312.     const int lineCount = 2;
  2313.  
  2314.     std::string caption = "GU MISC";
  2315.  
  2316.     static struct {
  2317.         LPCSTR      text;
  2318.         bool        *pState;
  2319.         bool        *pUpdated;
  2320.     } lines[lineCount] = {
  2321.         { "MOBILE PHONE RADIO", &featureMiscMobileRadio, NULL },
  2322.         { "MOBILE PHONE RADIO NEXT TRACK", NULL, NULL }
  2323.     };
  2324.  
  2325.  
  2326.     DWORD waitTime = 150;
  2327.     while (true)
  2328.     {
  2329.         // timed menu draw, used for pause after active line switch
  2330.         DWORD maxTickCount = GetTickCount() + waitTime;
  2331.         do
  2332.         {
  2333.             // draw menu
  2334.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  2335.             for (int i = 0; i < lineCount; i++)
  2336.             if (i != activeLineIndexGUMisc)
  2337.                 draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
  2338.                 lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  2339.             draw_menu_line(line_as_str(lines[activeLineIndexGUMisc].text, lines[activeLineIndexGUMisc].pState),
  2340.                 lineWidth + 1.0, 11.0, 56.0 + activeLineIndexGUMisc * 36.0, 0.0, 7.0, true, false);
  2341.  
  2342.             update_features();
  2343.             WAIT(0);
  2344.         } while (GetTickCount() < maxTickCount);
  2345.         waitTime = 0;
  2346.  
  2347.         // process buttons
  2348.         bool bSelect, bBack, bUp, bDown;
  2349.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  2350.         if (bSelect)
  2351.         {
  2352.             menu_beep();
  2353.             switch (activeLineIndexGUMisc)
  2354.             {
  2355.                 // mobile phone radio
  2356.                 case 0:
  2357.                     if (featureMiscMobileRadio == false)
  2358.                     {
  2359.                         int station = AUDIO::GET_PLAYER_RADIO_STATION_INDEX();
  2360.                         AUDIO::SET_MOBILE_PHONE_RADIO_STATE(true);
  2361.                         AUDIO::SET_MOBILE_RADIO_ENABLED_DURING_GAMEPLAY(true);
  2362.                         AUDIO::SET_FRONTEND_RADIO_ACTIVE(true);
  2363.                         AUDIO::SET_RADIO_TO_STATION_INDEX(station);
  2364.  
  2365.                         featureMiscMobileRadio = true;
  2366.                     }
  2367.                     else {
  2368.                         AUDIO::SET_MOBILE_PHONE_RADIO_STATE(false);
  2369.                         AUDIO::SET_MOBILE_RADIO_ENABLED_DURING_GAMEPLAY(false);
  2370.                         AUDIO::SET_FRONTEND_RADIO_ACTIVE(false);
  2371.  
  2372.                         featureMiscMobileRadio = false;
  2373.                     }
  2374.                     break;
  2375.                 // mobile phone radio next track
  2376.                 case 1:
  2377.                     if (ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID()) && featureMiscMobileRadio == true)
  2378.                         AUDIO::SKIP_RADIO_FORWARD();
  2379.                     break;
  2380.                 // switchable features
  2381.                 default:
  2382.                     if (lines[activeLineIndexGUMisc].pState)
  2383.                         *lines[activeLineIndexGUMisc].pState = !(*lines[activeLineIndexGUMisc].pState);
  2384.                     if (lines[activeLineIndexGUMisc].pUpdated)
  2385.                         *lines[activeLineIndexGUMisc].pUpdated = true;
  2386.             }
  2387.             waitTime = 200;
  2388.         }
  2389.         else
  2390.         if (bBack || trainer_switch_pressed())
  2391.         {
  2392.             menu_beep();
  2393.             break;
  2394.         }
  2395.         else
  2396.         if (bUp)
  2397.         {
  2398.             menu_beep();
  2399.             if (activeLineIndexGUMisc == 0)
  2400.                 activeLineIndexGUMisc = lineCount;
  2401.             activeLineIndexGUMisc--;
  2402.             waitTime = 150;
  2403.         }
  2404.         else
  2405.         if (bDown)
  2406.         {
  2407.             menu_beep();
  2408.             activeLineIndexGUMisc++;
  2409.             if (activeLineIndexGUMisc == lineCount)
  2410.                 activeLineIndexGUMisc = 0;
  2411.             waitTime = 150;
  2412.         }
  2413.     }
  2414. }
  2415.  
  2416. // GU Menu v1.1
  2417.  
  2418. int activeLineIndexGU = 0;
  2419.  
  2420. void process_gu_menu()
  2421. {
  2422.     const float lineWidth = 250.0;
  2423.     const int lineCount = 4;
  2424.  
  2425.     std::string caption = "GU MENU V1.1";
  2426.  
  2427.     static LPCSTR lineCaption[lineCount] = {
  2428.         "CHANGE POS",
  2429.         "CUSTOM TELEPORT",
  2430.         "LOAD AREA",
  2431.         "MISC"
  2432.     };
  2433.  
  2434.     DWORD waitTime = 150;
  2435.     while (true)
  2436.     {
  2437.         // timed menu draw, used for pause after active line switch
  2438.         DWORD maxTickCount = GetTickCount() + waitTime;
  2439.         do
  2440.         {
  2441.             // draw menu
  2442.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  2443.             for (int i = 0; i < lineCount; i++)
  2444.             if (i != activeLineIndexGU)
  2445.                 draw_menu_line(lineCaption[i], lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  2446.             draw_menu_line(lineCaption[activeLineIndexGU], lineWidth + 1.0, 11.0, 56.0 + activeLineIndexGU * 36.0, 0.0, 7.0, true, false);
  2447.  
  2448.             update_features();
  2449.             WAIT(0);
  2450.         } while (GetTickCount() < maxTickCount);
  2451.         waitTime = 0;
  2452.  
  2453.         // process buttons
  2454.         bool bSelect, bBack, bUp, bDown;
  2455.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  2456.         if (bSelect)
  2457.         {
  2458.             menu_beep();
  2459.             switch (activeLineIndexGU)
  2460.             {
  2461.                 case 0:
  2462.                 {
  2463.                     process_gu_changepos_menu();
  2464.                     break;
  2465.                 }
  2466.                 case 1:
  2467.                 {
  2468.                     std::ifstream inputFile("custom_teleport.txt");
  2469.                     std::string line;
  2470.  
  2471.                     if (inputFile.is_open())
  2472.                     {
  2473.                         vecCustomTeleName.clear();
  2474.                         vecCustomTeleX.clear();
  2475.                         vecCustomTeleY.clear();
  2476.                         vecCustomTeleZ.clear();
  2477.  
  2478.                         while (std::getline(inputFile, line))
  2479.                         {
  2480.                             std::string tmpName;
  2481.                             std::string tmploc_x;
  2482.                             std::string tmploc_y;
  2483.                             std::string tmploc_z;
  2484.  
  2485.                             std::stringstream linestream(line);
  2486.  
  2487.                             std::getline(linestream, tmpName, ',');
  2488.                             std::getline(linestream, tmploc_x, ',');
  2489.                             std::getline(linestream, tmploc_y, ',');
  2490.                             std::getline(linestream, tmploc_z, ',');
  2491.  
  2492.                             vecCustomTeleName.push_back(tmpName);
  2493.                             vecCustomTeleX.push_back(stof(tmploc_x));
  2494.                             vecCustomTeleY.push_back(stof(tmploc_y));
  2495.                             vecCustomTeleZ.push_back(stof(tmploc_z));
  2496.                         }
  2497.  
  2498.                         inputFile.close();
  2499.  
  2500.                         pCountCustomTele = ceil((double)vecCustomTeleName.size() / 10);
  2501.  
  2502.                         if (vecCustomTeleName.size() > 0)
  2503.                         {
  2504.                             process_gu_customtele_menu();
  2505.                         }
  2506.                         else {
  2507.                             set_status_text("Teleport list empty");
  2508.                         }
  2509.                     }
  2510.                     else {
  2511.                         set_status_text("Cannot open teleport list");
  2512.                     }
  2513.                     break;
  2514.                 }                  
  2515.                 case 2:
  2516.                 {
  2517.                     process_gu_loadarea_menu();
  2518.                     break;
  2519.                 }
  2520.                 case 3:
  2521.                 {
  2522.                     process_gu_misc_menu();
  2523.                     break;
  2524.                 }
  2525.             }
  2526.             waitTime = 200;
  2527.         }
  2528.         else
  2529.         if (bBack || trainer_switch_pressed())
  2530.         {
  2531.             menu_beep();
  2532.             break;
  2533.         }
  2534.         else
  2535.         if (bUp)
  2536.         {
  2537.             menu_beep();
  2538.             if (activeLineIndexGU == 0)
  2539.                 activeLineIndexGU = lineCount;
  2540.             activeLineIndexGU--;
  2541.             waitTime = 150;
  2542.         }
  2543.         else
  2544.         if (bDown)
  2545.         {
  2546.             menu_beep();
  2547.             activeLineIndexGU++;
  2548.             if (activeLineIndexGU == lineCount)
  2549.                 activeLineIndexGU = 0;
  2550.             waitTime = 150;
  2551.         }
  2552.     }
  2553. }
  2554.  
  2555. int activeLineIndexMain = 0;
  2556.  
  2557. void process_main_menu()
  2558. {
  2559.     const float lineWidth = 250.0;
  2560.     const int lineCount = 8;   
  2561.  
  2562.     std::string caption = "NATIVE  TRAINER  (AB)";
  2563.  
  2564.     static LPCSTR lineCaption[lineCount] = {
  2565.         "PLAYER",
  2566.         "WEAPON",
  2567.         "VEHICLE",
  2568.         "WORLD",
  2569.         "TIME",
  2570.         "WEATHER",
  2571.         "MISC",
  2572.         "GU MENU V1.1"
  2573.     };
  2574.  
  2575.     DWORD waitTime = 150;
  2576.     while (true)
  2577.     {
  2578.         // timed menu draw, used for pause after active line switch
  2579.         DWORD maxTickCount = GetTickCount() + waitTime;
  2580.         do
  2581.         {
  2582.             // draw menu
  2583.             draw_menu_line(caption, lineWidth, 15.0, 18.0, 0.0, 5.0, false, true);
  2584.             for (int i = 0; i < lineCount; i++)
  2585.                 if (i != activeLineIndexMain)
  2586.                     draw_menu_line(lineCaption[i], lineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, false, false);
  2587.             draw_menu_line(lineCaption[activeLineIndexMain], lineWidth + 1.0, 11.0, 56.0 + activeLineIndexMain * 36.0, 0.0, 7.0, true, false);
  2588.            
  2589.             update_features();
  2590.             WAIT(0);
  2591.         } while (GetTickCount() < maxTickCount);
  2592.         waitTime = 0;
  2593.  
  2594.         // process buttons
  2595.         bool bSelect, bBack, bUp, bDown;
  2596.         get_button_state(&bSelect, &bBack, &bUp, &bDown, NULL, NULL);
  2597.         if (bSelect)
  2598.         {
  2599.             menu_beep();
  2600.             switch (activeLineIndexMain)
  2601.             {
  2602.                 case 0:
  2603.                     process_player_menu();                 
  2604.                     break;
  2605.                 case 1:
  2606.                     process_weapon_menu();
  2607.                     break;
  2608.                 case 2:
  2609.                     process_veh_menu();
  2610.                     break;
  2611.                 case 3:
  2612.                     process_world_menu();
  2613.                     break;
  2614.                 case 4:
  2615.                     process_time_menu();
  2616.                     break;
  2617.                 case 5:
  2618.                     process_weather_menu();
  2619.                     break;
  2620.                 case 6:
  2621.                     process_misc_menu();
  2622.                     break;
  2623.                 case 7:
  2624.                     process_gu_menu();
  2625.                     break;
  2626.             }
  2627.             waitTime = 200;
  2628.         } else
  2629.         if (bBack || trainer_switch_pressed())
  2630.         {
  2631.             menu_beep();
  2632.             break;
  2633.         } else
  2634.         if (bUp)
  2635.         {
  2636.             menu_beep();
  2637.             if (activeLineIndexMain == 0)
  2638.                 activeLineIndexMain = lineCount;
  2639.             activeLineIndexMain--;
  2640.             waitTime = 150;
  2641.         } else
  2642.         if (bDown)
  2643.         {
  2644.             menu_beep();
  2645.             activeLineIndexMain++;
  2646.             if (activeLineIndexMain == lineCount)
  2647.                 activeLineIndexMain = 0;           
  2648.             waitTime = 150;
  2649.         }
  2650.     }
  2651. }
  2652.  
  2653. void reset_globals()
  2654. {
  2655.     activeLineIndexMain         =
  2656.     activeLineIndexPlayer       =
  2657.     skinchangerActiveLineIndex  =
  2658.     skinchangerActiveItemIndex  =
  2659.     teleportActiveLineIndex     =
  2660.     // GU activeLine
  2661.     activeLineIndexGUChangePos  =
  2662.     activeLineIndexGUCustomTele =
  2663.     activeLineIndexGULoadArea   =
  2664.     activeLineIndexGUMisc       =
  2665.     activeLineIndexGU           =
  2666.     // End
  2667.     activeLineIndexWeapon       =
  2668.     activeLineIndexVeh          =
  2669.     carspawnActiveLineIndex     =
  2670.     carspawnActiveItemIndex     =
  2671.     activeLineIndexWorld        =
  2672.     activeLineIndexWeather      =   0;
  2673.  
  2674.     featurePlayerInvincible         =
  2675.     featurePlayerInvincibleUpdated  =
  2676.     featurePlayerNeverWanted        =
  2677.     featurePlayerIgnored            =
  2678.     featurePlayerIgnoredUpdated     =
  2679.     featurePlayerUnlimitedAbility   =
  2680.     featurePlayerNoNoise            =
  2681.     featurePlayerNoNoiseUpdated     =
  2682.     featurePlayerFastSwim           =
  2683.     featurePlayerFastSwimUpdated    =
  2684.     featurePlayerFastRun            =
  2685.     featurePlayerFastRunUpdated     =
  2686.     featurePlayerSuperJump          =
  2687.     featureWeaponNoReload           =
  2688.     featureWeaponFireAmmo           =
  2689.     featureWeaponExplosiveAmmo      =
  2690.     featureWeaponExplosiveMelee     =
  2691.     featureWeaponVehRockets         =
  2692.     featureVehInvincible            =
  2693.     featureVehInvincibleUpdated     =
  2694.     featureVehSpeedBoost            =
  2695.     featureVehWrapInSpawned         =
  2696.     featureWorldMoonGravity         =
  2697.     featureTimePaused               =
  2698.     featureTimePausedUpdated        =
  2699.     featureTimeSynced               =
  2700.     featureWeatherWind              =
  2701.     featureMiscLockRadio            =
  2702.     // GU feature
  2703.     featureMiscMobileRadio          =
  2704.     featureChangePosHoldPos         =
  2705.     // End
  2706.     featureMiscHideHud              =   false;
  2707.  
  2708.     featureWorldRandomCops      =
  2709.     featureWorldRandomTrains    =
  2710.     featureWorldRandomBoats     =
  2711.     featureWorldGarbageTrucks   =   true;
  2712.  
  2713.     skinchanger_used            =   false;
  2714. }
  2715.  
  2716. void main()
  2717. {  
  2718.     reset_globals();
  2719.  
  2720.     while (true)
  2721.     {
  2722.         if (trainer_switch_pressed())
  2723.         {
  2724.             reset_trainer_switch();
  2725.             process_main_menu();
  2726.             DWORD time = GetTickCount() + 1000;
  2727.             while (GetTickCount() < time)
  2728.             {
  2729.                 update_features();
  2730.                 WAIT(0);
  2731.             }
  2732.             reset_trainer_switch();
  2733.         }
  2734.         update_features();
  2735.  
  2736.         WAIT(0);
  2737.     }
  2738. }
  2739.  
  2740. void ScriptMain()
  2741. {
  2742.     srand(GetTickCount());
  2743.     main();
  2744. }
RAW Paste Data