Advertisement
BadDragonKiko

dumb_menu.cpp | Перевести 3:13 17.11.2020

Nov 16th, 2020
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 145.06 KB | None | 0 0
  1. /*
  2.  
  3.     PROJECT:        mod_sa
  4.     LICENSE:        See LICENSE in the top level directory
  5.     COPYRIGHT:      Copyright we_sux, BlastHack
  6.  
  7.     mod_sa is available from https://github.com/BlastHackNet/mod_s0beit_sa/
  8.  
  9.     mod_sa is free software: you can redistribute it and/or modify
  10.     it under the terms of the GNU General Public License as published by
  11.     the Free Software Foundation, either version 3 of the License, or
  12.     (at your option) any later version.
  13.  
  14.     mod_sa is distributed in the hope that it will be useful,
  15.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.     GNU General Public License for more details.
  18.  
  19.     You should have received a copy of the GNU General Public License
  20.     along with mod_sa.  If not, see <http://www.gnu.org/licenses/>.
  21.  
  22. */
  23. #include "main.h"
  24.  
  25. #define ID_NONE                 - 1
  26.  
  27. #define ID_MENU_MAIN            0
  28. #define ID_MENU_CHEATS          1
  29. #define ID_MENU_CHEATS_INVULN   1
  30. #define ID_MENU_CHEATS_MONEY    2
  31. #define ID_MENU_CHEATS_MODS     135
  32. #define ID_MENU_CHEATS_WEATHER  5
  33. #define ID_MENU_CHEATS_TIME     6
  34. #define ID_MENU_CHEATS_HANDLING 111
  35. #define ID_MENU_PATCHES         7
  36. #define ID_MENU_WEAPONS         8
  37. #define ID_MENU_VEHICLES        9
  38. #define ID_MENU_TELEPORTS       11
  39. #define ID_MENU_MISC            12
  40. #define ID_MENU_DEBUG           13
  41. #define ID_MENU_PLAYERS         14
  42. #define ID_MENU_PLAYERS_WARP    100
  43. #define ID_MENU_PLAYERS_VEHWARP 101
  44. #define ID_MENU_PLAYERS_SPEC    102
  45. #define ID_MENU_PLAYERS_INFO    113
  46. #define ID_MENU_PLAYERS_MUTE    114
  47. #define ID_MENU_PLAYERS_VMUTE   115
  48. #define ID_MENU_SAMPPATCHES     20
  49. #define ID_MENU_SERVER_LIST     21
  50. #define ID_MENU_HUDINDICATORS   22
  51. #define ID_MENU_INTERIORS       23
  52.  
  53. #ifdef __CHEAT_VEHRECORDING_H__
  54. #define ID_MENU_ROUTES          26
  55. #define ID_MENU_ROUTES_LOAD     27
  56. #define ID_MENU_ROUTES_DROP     28
  57. #endif
  58.  
  59. #define ID_CHEAT_INVULN                     10
  60. #define ID_CHEAT_WEAPONS                    20
  61. #define ID_CHEAT_MONEY                      30
  62. #define ID_CHEAT_MODS                       40
  63. #define ID_CHEAT_PROT                       50
  64. #define ID_CHEAT_WARP_NEAR                  60
  65. #define ID_CHEAT_JETPACK                    70
  66. #define ID_CHEAT_UNLOCK                     80
  67. #define ID_CHEAT_WEATHER                    90
  68. #define ID_CHEAT_TIME                       100
  69. #define ID_CHEAT_HP                         110
  70. #define ID_CHEAT_ARMOR                      120
  71. #define ID_CHEAT_GRAVITY                    130
  72. #define ID_CHEAT_MAP                        140
  73. #define ID_CHEAT_TELETEXTS                  150
  74. #define ID_CHEAT_GAME_SPEED                 160
  75. #define ID_CHEAT_HANDLING                   170
  76. #define ID_CHEAT_KEEP_TRAILER               180
  77. #define ID_CHEAT_NOCOLS                     190
  78. #define ID_CHEAT_CHAMS                      200
  79. #define ID_CHEAT_CUSTOM_RUNSTYLE            210
  80. #define ID_CHEAT_FLY_SPEED                  220
  81. #define ID_CHEAT_DISABLE_WAVES              230
  82. #define ID_CHEAT_MAP_DRAW_LINES             231
  83. #define ID_CHEAT_SURF                       232
  84. #define ID_CHEAT_FREEZEROT                  233
  85.  
  86. #define ID_CHEAT_INVULN_ACTOR               0
  87. #define ID_CHEAT_INVULN_VEHICLE             1
  88. #define ID_CHEAT_INVULN_TIRES               2
  89. #define ID_CHEAT_INVULN_MIN_HP              3
  90. #define ID_CHEAT_INVULN_REGEN               5
  91. #define ID_CHEAT_INVULN_REGEN_ONFOOT        6
  92. #define ID_CHEAT_INVULN_DISABLE_EXTRA_INV   7
  93. #define ID_CHEAT_INVULN_ACT_EXPL_INV        8
  94. #define ID_CHEAT_INVULN_ACT_FALL_INV        9
  95. #define ID_CHEAT_INVULN_ACT_FIRE_INV        10
  96.  
  97. #define ID_CHEAT_MONEY_GIVE_500             0
  98. #define ID_CHEAT_MONEY_GIVE_1000            1
  99. #define ID_CHEAT_MONEY_GIVE_5000            2
  100. #define ID_CHEAT_MONEY_GIVE_10000           3
  101. #define ID_CHEAT_MONEY_GIVE_20000           4
  102. #define ID_CHEAT_MONEY_GIVE_99999999        5
  103. #define ID_CHEAT_MONEY_GIVE_CUSTOM          6
  104. #define ID_CHEAT_MONEY_MAX                  7
  105. #define ID_CHEAT_MONEY_RAND_MIN             8
  106. #define ID_CHEAT_MONEY_RAND_MAX             9
  107. #define ID_CHEAT_MONEY_IVAL_MIN             10
  108. #define ID_CHEAT_MONEY_IVAL_MAX             11
  109.  
  110. #define ID_CHEAT_MODS_COLOR1                10
  111. #define ID_CHEAT_MODS_COLOR2                20
  112. #define ID_CHEAT_MODS_PAINTJOB              30
  113.  
  114. #define ID_CHEAT_HANDLING_MASS              0
  115. #define ID_CHEAT_HANDLING_TURNMASS          1
  116. #define ID_CHEAT_HANDLING_DRAGCOEFF         2
  117. #define ID_CHEAT_HANDLING_TRACMULT          3
  118. #define ID_CHEAT_HANDLING_ENGNACCEL         4
  119. #define ID_CHEAT_HANDLING_MAXVEL            5
  120. #define ID_CHEAT_HANDLING_BRAKEDECEL        6
  121. #define ID_CHEAT_HANDLING_SUSPFORCELVL      7
  122. #define ID_CHEAT_HANDLING_COLDMGMULT        8
  123. #define ID_CHEAT_HANDLING_MULTIPLIER        9
  124. #define ID_CHEAT_HANDLING_TRACTIONLOSS      10
  125. #define ID_CHEAT_HANDLING_TRACTIONBIAS      11
  126. #define ID_CHEAT_HANDLING_SUSPANTIDIVEMULT  12
  127.  
  128. #define ID_WEAPON_ENABLE                    0
  129. #define ID_WEAPON_RANDOM                    1
  130. #define ID_WEAPON_ITEM                      2
  131.  
  132. #define ID_VEHICLES_IWARP                   0
  133. #define ID_VEHICLES_FREEZE                  1
  134. #define ID_MENU_VEHICLES_SUB                106
  135.  
  136. #define ID_MISC_COORDS                      0
  137. #define ID_MISC_RELOAD                      1
  138. #define ID_MISC_HUDTEXT                     2
  139. #define ID_MISC_BAD_WEAPONS                 3
  140. #define ID_MISC_TRAILERS                    4
  141. #define ID_MISC_FPSLIMIT                    5
  142. #define ID_MISC_TOGGLEWINDOWED              6
  143.  
  144. #define ID_DEBUG_ENABLE                     0
  145. #define ID_DEBUG_SELF_ACTOR                 1
  146. #define ID_DEBUG_SAMP_DLL                   2
  147. #define ID_DEBUG_SELF_VEHICLE               3
  148. #define ID_DEBUG_SAMP_INFO                  4
  149. #define ID_DEBUG_SAMP_PLAYER_LIST           5
  150. #define ID_DEBUG_SAMP_LOCAL_INFO            6
  151. #define ID_DEBUG_SAMP_CHAT_INFO             7
  152. #define ID_DEBUG_SAMP_CHAT_IPT_INFO         8
  153. #define ID_DEBUG_SAMP_KILL_INFO             9
  154. #define ID_DEBUG_SAMP_VEHICLE_LIST          10
  155. #define ID_DEBUG_SAMP_LOCAL_SAMPPED         11
  156.  
  157. #ifdef __CHEAT_VEHRECORDING_H__
  158. #define ID_ROUTES_ACTIVATED                 0
  159. #define ID_ROUTES_WRITE                     1
  160. #define ID_ROUTES_OPTIMIZE                  2
  161. #endif
  162.  
  163. #define ID_HUDIND_BAR                       0
  164. #define ID_HUDIND_TSHADOWS                  1
  165. #define ID_HUDIND_INV                       2
  166. #define ID_HUDIND_WEAPON                    3
  167. #define ID_HUDIND_MONEY                     4
  168. #define ID_HUDIND_FREEZE                    5
  169. #define ID_HUDIND_INVEH_AIRBRK              6
  170. #define ID_HUDIND_INVEH_STICK               7
  171. #define ID_HUDIND_INVEH_BRKDANCE            8
  172. #define ID_HUDIND_ONFOOT_AIRBRK             9
  173. #define ID_HUDIND_ONFOOT_STICK              10
  174. #define ID_HUDIND_ONFOOT_AIM                11
  175. #define ID_HUDIND_POS                       12
  176. #define ID_HUDIND_FPS                       13
  177. #define ID_HUDIND_LB_BARS                   14
  178. #define ID_HUDIND_INVEH_SPIDER              15
  179. #define ID_HUDIND_INVEH_FLY                 16
  180. #define ID_HUDIND_ONFOOT_FLY                17
  181. #define ID_HUDIND_SURF                      18
  182. #define ID_HUDIND_FREEZEROT                 19
  183.  
  184. #define ID_MENU_SAMPMISC                    0
  185. #define ID_MENU_SAMPMISC_VEHICLES_INSTANT   108
  186. #define ID_MENU_SAMPMISC_FAKE_KILL          105
  187. #define ID_MENU_SAMPMISC_SPOOF_WEAPON       3
  188. #define ID_MENU_SAMPMISC_SAMP_INFO_LIST     4
  189. #define ID_MENU_SAMPMISC_CHAT_TEXT          6
  190. #define ID_MENU_SAMPMISC_CHAT_TEXTLINES     7
  191. #define ID_MENU_SAMPMISC_GAMESTATE          9
  192. #define ID_MENU_SAMPMISC_SPECIALACTION      12
  193. #define ID_MENU_SAMPMISC_SAMP_DRUNK         13
  194. #define ID_MENU_SAMPMISC_TELEOBJECT         109
  195. #define ID_MENU_SAMPMISC_TELEPICKUP         110
  196. #define ID_MENU_SAMPMISC_RENDEROBJTXT       15
  197. #define ID_MENU_SAMPMISC_RENDERPCKTXT       16
  198. #define ID_MENU_SAMPMISC_M0DCOMMANDS        17
  199. #define ID_MENU_SAMPMISC_EXTRAGM            18
  200.  
  201. #define ID_MENU_SPECIAL_ACTION_NONE             0
  202. #define ID_MENU_SPECIAL_ACTION_USEJETPACK       2
  203. #define ID_MENU_SPECIAL_ACTION_DANCE1           5
  204. #define ID_MENU_SPECIAL_ACTION_DANCE2           6
  205. #define ID_MENU_SPECIAL_ACTION_DANCE3           7
  206. #define ID_MENU_SPECIAL_ACTION_DANCE4           8
  207. #define ID_MENU_SPECIAL_ACTION_HANDSUP          10
  208. #define ID_MENU_SPECIAL_ACTION_USECELLPHONE     11
  209. #define ID_MENU_SPECIAL_ACTION_STOPUSECELLPHONE 13
  210. #define ID_MENU_SPECIAL_ACTION_DRINK_BEER       20
  211. #define ID_MENU_SPECIAL_ACTION_SMOKE_CIGGY      21
  212. #define ID_MENU_SPECIAL_ACTION_DRINK_WINE       22
  213. #define ID_MENU_SPECIAL_ACTION_DRINK_SPRUNK     23
  214. #define ID_MENU_SPECIAL_ACTION_CUFFED           24
  215. #define ID_MENU_SPECIAL_ACTION_CARRY            25
  216. #define ID_MENU_SPECIAL_ACTION_URINATE          68
  217.  
  218. #define ID_MENU_NETPATCHES_INRPC                10024
  219. #define ID_MENU_NETPATCHES_OUTRPC               10025
  220. #define ID_MENU_NETPATCHES_INPACKET             10026
  221. #define ID_MENU_NETPATCHES_OUTPACKET            10027
  222. #define ID_MENU_NETPATCHES_TOGGLE_ALL           INI_NETPATCHES_MAX
  223.  
  224. struct menu* menu_active = NULL;
  225. int menu_init = 0, menu_mouseover = -1;
  226. extern int  iGTAPatchesCount, iSAMPPatchesCount, iNetPatchesCount, iServersCount;
  227. static struct menu* menu_new(struct menu* parent, int id, menu_callback callback)
  228. {
  229.     struct menu* menu = (struct menu*)calloc(1, sizeof(struct menu));
  230.  
  231.     if (menu == NULL)
  232.         return NULL;
  233.  
  234.     menu->id = id;
  235.     menu->parent = parent;
  236.     menu->callback = callback;
  237.  
  238.     return menu;
  239. }
  240.  
  241. static struct menu_item* menu_item_add(struct menu* menu, struct menu* submenu, const char* name, int id,
  242.     D3DCOLOR color, void* data, const char* description = "")
  243. {
  244.     struct menu_item* item;
  245.     int                 i;
  246.  
  247.     i = menu->count++;
  248.     menu->item = (struct menu_item*)realloc(menu->item, sizeof(struct menu_item) * menu->count);
  249.     item = &menu->item[i];
  250.  
  251.     memset(item, 0, sizeof(menu_item));
  252.     item->submenu = submenu;
  253.     item->menu = menu;
  254.     item->name = _strdup(name);
  255.     item->id = id;
  256.     item->color = color;
  257.     item->data = data;
  258.     item->description = description;
  259.  
  260.     return item;
  261. }
  262.  
  263. //void menu_item_function(struct menu *menu, struct menu *submenu, const char *name, int id,
  264. //  D3DCOLOR color, void *data)
  265. //{
  266. //  menu_item_add(menu, submenu, name, id, color, data);
  267. //}
  268.  
  269. void menu_item_name_set(struct menu_item* item, const char* fmt, ...)
  270. {
  271.     const char* name_new;
  272.     char        name[64];
  273.     va_list     ap;
  274.  
  275.     memset(name, 0, sizeof(name));
  276.     va_start(ap, fmt);
  277.     vsnprintf(name, sizeof(name) - 1, fmt, ap);
  278.     va_end(ap);
  279.  
  280.     if ((name_new = _strdup(name)) != NULL)
  281.     {
  282.         free((void*)item->name);
  283.         item->name = name_new;
  284.     }
  285. }
  286.  
  287. /////////////////////////////////////////////////////////////////////////////
  288. /////////////////////////////////////////////////////////////////////////////
  289.  
  290. //menu_callback_cheats_mods
  291. static void menu_cheats_mods_populate(struct menu* menu)
  292. {
  293.     // clear menu
  294.     menu_items_free(menu);
  295.  
  296.     // get vehicle_info
  297.     struct vehicle_info* vinfo = vehicle_info_get(VEHICLE_SELF, 0);
  298.     if (vinfo == NULL)
  299.         return;
  300.  
  301.     struct actor_info* ainfo = actor_info_get(ACTOR_SELF, 0);
  302.     if (vinfo->passengers[0] != ainfo)
  303.         return;
  304.  
  305.     // some variables
  306.     int     iModelID = vinfo->base.model_alt_id;
  307.     char    name[64];
  308.  
  309.     /* i... like... colors & paint
  310.     #define ID_CHEAT_MODS_COLOR1    10
  311.     #define ID_CHEAT_MODS_COLOR2    20
  312.     #define ID_CHEAT_MODS_PAINTJOB  30
  313.     */
  314.     snprintf(name, sizeof(name), "Color 1: %d", vinfo->color[0]);
  315.     menu_item_add(menu, NULL, name, ID_CHEAT_MODS_COLOR1, MENU_COLOR_DEFAULT, NULL);
  316.     snprintf(name, sizeof(name), "Color 2: %d", vinfo->color[1]);
  317.     menu_item_add(menu, NULL, name, ID_CHEAT_MODS_COLOR2, MENU_COLOR_DEFAULT, NULL);
  318.     snprintf(name, sizeof(name), "Paintjob: %d", vehicle_getPaintJob(vinfo));
  319.     menu_item_add(menu, NULL, name, ID_CHEAT_MODS_PAINTJOB, MENU_COLOR_DEFAULT, NULL);
  320.  
  321.     // No upgrades for these types
  322.     eClientVehicleType  vehicleType = GetVehicleType(iModelID);
  323.     if (vehicleType == CLIENTVEHICLE_BOAT
  324.         || vehicleType == CLIENTVEHICLE_TRAIN
  325.         || vehicleType == CLIENTVEHICLE_HELI
  326.         || vehicleType == CLIENTVEHICLE_PLANE
  327.         || vehicleType == CLIENTVEHICLE_BIKE
  328.         || vehicleType == CLIENTVEHICLE_BMX) return;
  329.  
  330.     for (int iUpgradeInfo = 0; iUpgradeInfo < VEHICLE_UPGRADES_COUNT; iUpgradeInfo++)
  331.     {
  332.         if (isUpgradeCompatible(cveh_upgrade_info[iUpgradeInfo].iModelID, vinfo))
  333.         {
  334.             snprintf(name, sizeof(name), "%s %s", cveh_upgrade_info[iUpgradeInfo].upgradeCategoryName,
  335.                 cveh_upgrade_info[iUpgradeInfo].upgradeName);
  336.             menu_item_add(menu, NULL, name, cveh_upgrade_info[iUpgradeInfo].iModelID, MENU_COLOR_DEFAULT, NULL);
  337.  
  338.             // skip matching sideskirt
  339.             if (!strcmp(cveh_upgrade_info[iUpgradeInfo].upgradeCategoryName, "Sideskirt")
  340.                 || !strcmp(cveh_upgrade_info[iUpgradeInfo].upgradeCategoryName, "Vents")) iUpgradeInfo++;
  341.         }
  342.     }
  343. }
  344.  
  345. static void menu_cheats_spoof_kill_populate(struct menu* menu)
  346. {
  347.     menu_items_free(menu);
  348.  
  349.     if (g_Players == NULL)
  350.         return;
  351.  
  352.     char    text[64];
  353.     int     i;
  354.  
  355.     for (i = 0; i < SAMP_MAX_PLAYERS; i++)
  356.     {
  357.         D3DCOLOR    color = MENU_COLOR_DEFAULT;
  358.  
  359.         if (g_Players->iIsListed[i] != 1)
  360.             continue;
  361.         if (g_Players->pRemotePlayer[i]->pPlayerData == NULL)
  362.             continue;
  363.         if (g_Players->pRemotePlayer[i]->pPlayerData->pSAMP_Actor == NULL)
  364.             continue;
  365.  
  366.         if (g_Players->pRemotePlayer[i] != NULL)
  367.             color = samp_color_get(i);
  368.  
  369.         snprintf(text, sizeof(text), "Fake killed by %s (ID: %d)", getPlayerName(i), i);
  370.  
  371.         menu_item_add(menu, NULL, text, ID_MENU_SAMPMISC_FAKE_KILL, color, (void*)(UINT_PTR)i);
  372.     }
  373. }
  374.  
  375. static void menu_vehicles_populate(struct menu* menu, int class_id)
  376. {
  377.     const struct actor_info* actor_self = actor_info_get(ACTOR_SELF, 0);
  378.     char                    name[64];
  379.     int                     i;
  380.  
  381.     menu_items_free(menu);
  382.  
  383.     if (pool_vehicle != NULL)
  384.     {
  385.         for (i = 0; i < pool_vehicle->size; i++)
  386.         {
  387.             static const struct vehicle_entry   unknown = { 0, VEHICLE_CLASS_CAR, "[Unknown vehicle]" };
  388.             const struct vehicle_info* info = vehicle_info_get(i, VEHICLE_ALIVE);
  389.             const struct vehicle_entry* vehicle;
  390.             float                               dist[3] = { 0.0f, 0.0f, 0.0f };
  391.  
  392.             if (info == NULL)
  393.                 continue;
  394.  
  395.             vehicle = gta_vehicle_get_by_id(info->base.model_alt_id);
  396.             if (vehicle == NULL)
  397.                 vehicle = &unknown;
  398.  
  399.             if (vehicle->class_id != class_id)
  400.                 continue;
  401.  
  402.             if (actor_self != NULL)
  403.                 vect3_vect3_sub(&info->base.matrix[4 * 3], &actor_self->base.matrix[4 * 3], dist);
  404.  
  405.             if (vect3_near_zero(&info->base.matrix[4 * 3]))
  406.                 continue;
  407.  
  408.             snprintf(name, sizeof(name), "%s (%.2fm%s)", vehicle->name, vect3_length(dist),
  409.                 (info->passengers[0] == NULL) ? "" : ", Occupied");
  410.  
  411.             menu_item_add(menu, NULL, name, i, MENU_COLOR_DEFAULT, NULL);
  412.         }
  413.     }
  414. }
  415.  
  416. static void menu_players_warp_populate(struct menu* menu)
  417. {
  418.     menu_items_free(menu);
  419.  
  420.     if (g_Players == NULL)
  421.         return;
  422.  
  423.     char    text[64];
  424.     int     i;
  425.     for (i = 0; i < SAMP_MAX_PLAYERS; i++)
  426.     {
  427.         D3DCOLOR    color = MENU_COLOR_DEFAULT;
  428.  
  429.         if (g_Players->iIsListed[i] != 1)
  430.             continue;
  431.         if (g_Players->pRemotePlayer[i] == NULL)
  432.             continue;
  433.  
  434.         // can obtain position data?
  435.         if (vect3_near_zero(g_stStreamedOutInfo.fPlayerPos[i])
  436.             && (g_Players->pRemotePlayer[i]->pPlayerData == NULL ||
  437.                 g_Players->pRemotePlayer[i]->pPlayerData->pSAMP_Actor == NULL))
  438.             continue;
  439.  
  440.         color = samp_color_get(i);
  441.         snprintf(text, sizeof(text), "%s (ID: %d)", getPlayerName(i), i);
  442.         menu_item_add(menu, NULL, text, i, color, NULL);
  443.     }
  444. }
  445.  
  446. static void menu_players_vehwarp_populate(struct menu* menu)
  447. {
  448.     menu_items_free(menu);
  449.  
  450.     if (g_Players == NULL)
  451.         return;
  452.  
  453.     char    text[64];
  454.     int     i;
  455.     for (i = 0; i < SAMP_MAX_PLAYERS; i++)
  456.     {
  457.         D3DCOLOR    color = MENU_COLOR_DEFAULT;
  458.  
  459.         if (g_Players->iIsListed[i] != 1)
  460.             continue;
  461.         if (g_Players->pRemotePlayer[i] == NULL)
  462.             continue;
  463.         if (g_Players->pRemotePlayer[i]->pPlayerData == NULL)
  464.             continue;
  465.         if (g_Players->pRemotePlayer[i]->pPlayerData->pSAMP_Actor == NULL)
  466.             continue;
  467.  
  468.         //if(vect3_near_zero(g_stStreamedOutInfo.fPlayerPos[i])) continue;
  469.         if (g_Players->pRemotePlayer[i]->pPlayerData->bytePlayerState != PLAYER_STATE_DRIVER
  470.             && g_Players->pRemotePlayer[i]->pPlayerData->bytePlayerState != PLAYER_STATE_PASSENGER) continue;
  471.  
  472.         if (g_Players->pRemotePlayer[i] != NULL)
  473.             color = samp_color_get(i);
  474.  
  475.         snprintf(text, sizeof(text), "%s (ID: %d)", getPlayerName(i), i);
  476.         menu_item_add(menu, NULL, text, i, color, NULL);
  477.     }
  478. }
  479.  
  480. static void menu_vehicles_instant_populate(struct menu* menu)
  481. {
  482.     menu_items_free(menu);
  483.  
  484.     if (g_Players == NULL && g_Vehicles == NULL)
  485.         return;
  486.  
  487.     const struct vehicle_entry* vehicle;
  488.     char                        text[64];
  489.     int                         v;
  490.     for (v = 0; v < SAMP_MAX_VEHICLES; v++)
  491.     {
  492.         if (g_Vehicles->iIsListed[v] != 1)
  493.             continue;
  494.         if (g_Vehicles->pSAMP_Vehicle[v] == NULL)
  495.             continue;
  496.         if (g_Vehicles->pSAMP_Vehicle[v]->pGTA_Vehicle == NULL)
  497.             continue;
  498.  
  499.         vehicle = gta_vehicle_get_by_id(g_Vehicles->pSAMP_Vehicle[v]->pGTA_Vehicle->base.model_alt_id);
  500.         snprintf(text, sizeof(text), "%s (ID: %d)", vehicle->name, v);
  501.         menu_item_add(menu, NULL, text, v, D3DCOLOR_XRGB(150, 150, 150), NULL);
  502.     }
  503. }
  504.  
  505. static void menu_players_spectator_mode_populate(struct menu* menu)
  506. {
  507.     menu_items_free(menu);
  508.  
  509.     if (g_Players == NULL)
  510.         return;
  511.  
  512.     menu_item_add(menu, NULL, "Disable", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  513.  
  514.     char    text[64];
  515.     int     i;
  516.     for (i = 0; i < SAMP_MAX_PLAYERS; i++)
  517.     {
  518.         D3DCOLOR    color = MENU_COLOR_DEFAULT;
  519.  
  520.         if (g_Players->iIsListed[i] != 1)
  521.             continue;
  522.         if (g_Players->pRemotePlayer[i] == NULL)
  523.             continue;
  524.         if (g_Players->pRemotePlayer[i]->pPlayerData == NULL)
  525.             continue;
  526.         if (g_Players->pRemotePlayer[i]->pPlayerData->pSAMP_Actor == NULL)
  527.             continue;
  528.  
  529.         color = samp_color_get((int)g_Players->pRemotePlayer[i]->pPlayerData->sPlayerID);
  530.  
  531.         snprintf(text, sizeof(text), "Spectate %s (ID: %d)", getPlayerName(i), i);
  532.         menu_item_add(menu, NULL, text, i, color, (void*)(UINT_PTR)i);
  533.     }
  534. }
  535.  
  536. static void menu_telepickup_populate(struct menu* menu)
  537. {
  538.     menu_items_free(menu);
  539.  
  540.     if (g_SAMP->pPools->pPickup == NULL)
  541.         return;
  542.  
  543.     char    text[64];
  544.     int     i;
  545.     for (i = 0; i < SAMP_MAX_PICKUPS; i++)
  546.     {
  547.         if (g_SAMP->pPools->pPickup->pickup[i].iModelID == 0)
  548.             continue;
  549.         if (g_SAMP->pPools->pPickup->pickup[i].iType == 0)
  550.             continue;
  551.  
  552.         D3DCOLOR    color = MENU_COLOR_DEFAULT;
  553.         snprintf(text, sizeof(text), "Pickup (%d, ModelID: %d)", i, g_SAMP->pPools->pPickup->pickup[i].iModelID);
  554.         menu_item_add(menu, NULL, text, i, color, NULL);
  555.     }
  556. }
  557.  
  558. static int menu_callback_telepickup(int op, struct menu_item* item)
  559. {
  560.     if (op == MENU_OP_SELECT)
  561.     {
  562.         int id = item->id;
  563.  
  564.         if (g_SAMP->pPools->pPickup == NULL)
  565.             return 0;
  566.         if (g_SAMP->pPools->pPickup->pickup[id].iType == 0)
  567.             return 0;
  568.         if (g_SAMP->pPools->pPickup->pickup[id].iModelID == 0)
  569.             return 0;
  570.         if (item->id == ID_NONE)
  571.             return 0;
  572.  
  573.         float   pos[3];
  574.  
  575.         vect3_copy(g_SAMP->pPools->pPickup->pickup[id].fPosition, pos);
  576.         pos[1] += 2.0f;
  577.         cheat_teleport(pos, 0);
  578.  
  579.         return 1;
  580.     }
  581.  
  582.     return 0;
  583. }
  584.  
  585. static void menu_teleobject_populate(struct menu* menu)
  586. {
  587.     menu_items_free(menu);
  588.  
  589.     if (g_SAMP->pPools->pObject == NULL)
  590.         return;
  591.  
  592.     char    text[64];
  593.     int     i;
  594.     for (i = 0; i < SAMP_MAX_OBJECTS; i++)
  595.     {
  596.         D3DCOLOR    color = MENU_COLOR_DEFAULT;
  597.  
  598.         if (g_SAMP->pPools->pObject->iIsListed[i] != 1)
  599.             continue;
  600.         if (g_SAMP->pPools->pObject->object[i] == NULL)
  601.             continue;
  602.         if (g_SAMP->pPools->pObject->object[i]->pGTAEntity == NULL)
  603.             continue;
  604.  
  605.         float   pos[3];
  606.         vect3_copy(&g_SAMP->pPools->pObject->object[i]->pGTAEntity->base.matrix[4 * 3], pos);
  607.         if (vect3_near_zero(pos))
  608.             continue;
  609.  
  610.         snprintf(text, sizeof(text), "Object (%d, ModelID %d)", i,
  611.             g_SAMP->pPools->pObject->object[i]->pGTAEntity->base.model_alt_id);
  612.         menu_item_add(menu, NULL, text, i, color, NULL);
  613.     }
  614. }
  615.  
  616. static int menu_callback_teleobject(int op, struct menu_item* item)
  617. {
  618.     if (op == MENU_OP_SELECT)
  619.     {
  620.         if (g_SAMP->pPools->pObject == NULL)
  621.             return 0;
  622.         if (item->id == ID_NONE)
  623.             return 0;
  624.  
  625.         int     id = item->id;
  626.         float   pos[3];
  627.  
  628.         if (g_SAMP->pPools->pObject->iIsListed[id] != 1)
  629.         {
  630.             addMessageToChatWindow("Object does not exist.");
  631.             return 0;
  632.         }
  633.  
  634.         if (g_SAMP->pPools->pObject->object[id]->pGTAEntity == NULL)
  635.         {
  636.             addMessageToChatWindow("Invalid object info.");
  637.             return 0;
  638.         }
  639.  
  640.         vect3_copy(&g_SAMP->pPools->pObject->object[id]->pGTAEntity->base.matrix[4 * 3], pos);
  641.         pos[2] += 2.0f;
  642.         cheat_teleport(pos, 0);
  643.  
  644.         return 1;
  645.     }
  646.  
  647.     return 0;
  648. }
  649.  
  650. static void menu_handling_populate(struct menu* menu)
  651. {
  652.     CVehicle* cveh = getSelfCVehicle();
  653.     if (cveh == NULL)
  654.         return;
  655.     if (cveh->GetHandlingData() == NULL)
  656.         return;
  657.  
  658.     traceLastFunc("menu_handling_populate()");
  659.  
  660.     char    text[64];
  661.  
  662.     menu_items_free(menu);
  663.  
  664.     snprintf(text, sizeof(text), "Multiplier: %0.2f", set.handling_multiplier);
  665.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_MULTIPLIER, MENU_COLOR_DEFAULT, NULL);
  666.  
  667.     menu_item_add(menu, NULL, "\tHandling", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  668.  
  669.     snprintf(text, sizeof(text), "Engine acceleration: %0.2f", cveh->GetHandlingData()->GetEngineAccelleration());
  670.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_ENGNACCEL, MENU_COLOR_DEFAULT, NULL);
  671.     snprintf(text, sizeof(text), "Brake decelleration: %0.2f", cveh->GetHandlingData()->GetBrakeDecelleration());
  672.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_BRAKEDECEL, MENU_COLOR_DEFAULT, NULL);
  673.     snprintf(text, sizeof(text), "Drag coefficient: %0.2f", cveh->GetHandlingData()->GetDragCoeff());
  674.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_DRAGCOEFF, MENU_COLOR_DEFAULT, NULL);
  675.  
  676.     snprintf(text, sizeof(text), "Max velocity: %0.2f", cveh->GetHandlingData()->GetMaxVelocity());
  677.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_MAXVEL, MENU_COLOR_DEFAULT, NULL);
  678.  
  679.     // these can't be used because they don't always show up right etc... possibly mapped wrong
  680.     snprintf(text, sizeof(text), "Traction multiplier: %0.2f", cveh->GetHandlingData()->GetTractionMultiplier());
  681.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_TRACMULT, MENU_COLOR_DEFAULT, NULL);
  682.     snprintf(text, sizeof(text), "Traction loss: %0.2f", cveh->GetHandlingData()->GetTractionLoss());
  683.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_TRACTIONLOSS, MENU_COLOR_DEFAULT, NULL);
  684.     snprintf(text, sizeof(text), "Traction bias: %0.2f", cveh->GetHandlingData()->GetTractionBias());
  685.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_TRACTIONBIAS, MENU_COLOR_DEFAULT, NULL);
  686.     snprintf(text, sizeof(text), "Suspension force level: %0.2f", cveh->GetHandlingData()->GetSuspensionForceLevel());
  687.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_SUSPFORCELVL, MENU_COLOR_DEFAULT, NULL);
  688.  
  689.     //snprintf( text, sizeof(text), "Suspension anti-dive multiplier: %0.2f", cveh->GetHandlingData()->GetSuspensionAntidiveMultiplier() );
  690.     //menu_item_add( menu, NULL, text, ID_CHEAT_HANDLING_SUSPANTIDIVEMULT, MENU_COLOR_DEFAULT, NULL );
  691.     snprintf(text, sizeof(text), "Mass: %0.2f", cveh->GetHandlingData()->GetMass());
  692.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_MASS, MENU_COLOR_DEFAULT, NULL);
  693.     snprintf(text, sizeof(text), "Turn mass: %0.2f", cveh->GetHandlingData()->GetTurnMass());
  694.     menu_item_add(menu, NULL, text, ID_CHEAT_HANDLING_TURNMASS, MENU_COLOR_DEFAULT, NULL);
  695.  
  696.     //snprintf( text, sizeof(text), "Collision damage multiplier: %0.2f",
  697.     //        cveh->GetHandlingData()->GetCollisionDamageMultiplier() );
  698.     //menu_item_add( menu, NULL, text, ID_CHEAT_HANDLING_COLDMGMULT, MENU_COLOR_DEFAULT, NULL );
  699. }
  700.  
  701. static void menu_playerinfo_populate(struct menu* menu)
  702. {
  703.     menu_items_free(menu);
  704.     if (g_Players == NULL)
  705.         return;
  706.  
  707.     menu_item_add(menu, NULL, "Disable", SAMP_MAX_PLAYERS + 1, MENU_COLOR_DEFAULT, NULL);
  708.  
  709.     menu_item_add(menu, NULL, "Local Player", -2, MENU_COLOR_DEFAULT, (void*)(UINT_PTR)-2);
  710.  
  711.     char    text[64];
  712.     int     i;
  713.     for (i = 0; i < SAMP_MAX_PLAYERS; i++)
  714.     {
  715.         if (g_Players->iIsListed[i] != 1)
  716.             continue;
  717.         if (g_Players->pRemotePlayer[i] == NULL)
  718.             continue;
  719.  
  720.         snprintf(text, sizeof(text), "View %s (ID: %d)", getPlayerName(i), i);
  721.         menu_item_add(menu, NULL, text, i, MENU_COLOR_DEFAULT, (void*)(UINT_PTR)i);
  722.     }
  723. }
  724.  
  725. static void menu_playermute_populate(struct menu* menu)
  726. {
  727.     menu_items_free(menu);
  728.     if (g_Players == NULL)
  729.         return;
  730.  
  731.     char    text[64];
  732.     int     i;
  733.     for (i = 0; i < SAMP_MAX_PLAYERS; i++)
  734.     {
  735.         if (g_Players->iIsListed[i] != 1 || g_Players->pRemotePlayer[i] == NULL)
  736.         {
  737.             g_bPlayerMuted[i] = false;
  738.             continue;
  739.         }
  740.  
  741.         snprintf(text, sizeof(text), "Mute %s (ID: %d)", getPlayerName(i), i);
  742.         menu_item_add(menu, NULL, text, i, MENU_COLOR_DEFAULT, (void*)(UINT_PTR)i);
  743.     }
  744. }
  745.  
  746. #ifdef __CHEAT_VEHRECORDING_H__
  747. static void menu_routes_drop_populate(struct menu* menu)
  748. {
  749.     menu_items_free(menu);
  750.  
  751.     // now get me some data from the database
  752.     char table_name_[64];
  753.     char* table_name;
  754.     int num_tables = rec_sqlite_getNumTables();
  755.  
  756.     if (num_tables <= 0)
  757.     {
  758.         menu_item_add(menu, NULL, (num_tables < 0) ? "Error Reading Database" : "No Saved Routes", ID_NONE,
  759.             MENU_COLOR_DEFAULT, NULL);
  760.         return;
  761.     }
  762.  
  763.     for (int i = 0; i < num_tables; i++)
  764.     {
  765.         table_name = rec_sqlite_getTableName(i);
  766.         if (table_name == NULL)
  767.             continue;
  768.  
  769.         // remember to change menu_callback_routes_drop, if you change the "Delete" text
  770.         _snprintf_s(table_name_, sizeof(table_name_) - 1, "Delete '%s'", table_name);
  771.         menu_item_add(menu, NULL, table_name_, i, MENU_COLOR_DEFAULT, NULL);
  772.     }
  773. }
  774.  
  775. static void menu_routes_load_populate(struct menu* menu)
  776. {
  777.     menu_items_free(menu);
  778.  
  779.     // now get me some data from the database
  780.     int num_tables = rec_sqlite_getNumTables();
  781.     char* table_name;
  782.  
  783.     if (num_tables <= 0)
  784.     {
  785.         menu_item_add(menu, NULL, (num_tables < 0) ? "Error Reading Database" : "No Saved Routes", ID_NONE,
  786.             MENU_COLOR_DEFAULT, NULL);
  787.         return;
  788.     }
  789.  
  790.     for (int i = 0; i < num_tables; i++)
  791.     {
  792.         table_name = rec_sqlite_getTableName(i);
  793.         if (table_name == NULL)
  794.             continue;
  795.         menu_item_add(menu, NULL, table_name, i, MENU_COLOR_DEFAULT, NULL);
  796.     }
  797. }
  798. #endif
  799.  
  800. // called when a menu is going to be displayed
  801. static void menu_event_activate(struct menu* menu)
  802. {
  803.     if (menu == NULL)
  804.         return;
  805.  
  806.     switch (menu->id)
  807.     {
  808.     case ID_MENU_CHEATS_MODS:
  809.         menu_cheats_mods_populate(menu);
  810.         break;
  811.  
  812.     case ID_MENU_PLAYERS_WARP:
  813.         menu_players_warp_populate(menu);
  814.         break;
  815.  
  816.  
  817.     case ID_MENU_PLAYERS_VEHWARP:
  818.         menu_players_vehwarp_populate(menu);
  819.         break;
  820.  
  821.     case ID_MENU_PLAYERS_SPEC:
  822.         menu_players_spectator_mode_populate(menu);
  823.         break;
  824.  
  825.     case ID_MENU_SAMPMISC_FAKE_KILL:
  826.         menu_cheats_spoof_kill_populate(menu);
  827.         break;
  828.  
  829.     case ID_MENU_VEHICLES_SUB:
  830.         menu_vehicles_populate(menu, (int)(UINT_PTR)menu->parent->item[menu->parent->pos].data);
  831.         break;
  832.  
  833.     case ID_MENU_SAMPMISC_VEHICLES_INSTANT:
  834.         menu_vehicles_instant_populate(menu);
  835.         break;
  836.  
  837.     case ID_MENU_SAMPMISC_TELEOBJECT:
  838.         menu_teleobject_populate(menu);
  839.         break;
  840.  
  841.     case ID_MENU_SAMPMISC_TELEPICKUP:
  842.         menu_telepickup_populate(menu);
  843.         break;
  844.  
  845.     case ID_MENU_CHEATS_HANDLING:
  846.         menu_handling_populate(menu);
  847.         break;
  848.  
  849.     case ID_MENU_PLAYERS_INFO:
  850.         menu_playerinfo_populate(menu);
  851.         break;
  852.  
  853.     case ID_MENU_PLAYERS_MUTE:
  854.         menu_playermute_populate(menu);
  855.         break;
  856.  
  857. #ifdef __CHEAT_VEHRECORDING_H__
  858.     case ID_MENU_ROUTES_DROP:
  859.         menu_routes_drop_populate(menu);
  860.         break;
  861.  
  862.     case ID_MENU_ROUTES_LOAD:
  863.         menu_routes_load_populate(menu);
  864.         break;
  865. #endif
  866.     }
  867. }
  868.  
  869. /* run every frame */
  870. void menu_run(void)
  871. {
  872.     struct menu_item* item;
  873.     static uint32_t     key_time_updown, key_time_incdec;
  874.     static bool bIsDefined = false;
  875.     if (menu_active == NULL)
  876.         return;
  877.  
  878.  
  879.     if (KEYCOMBO_PRESSED(set.key_menu))
  880.     {
  881.         menu_toggle((cheat_state->_generic.menu ^= 1) != 0);
  882.     }
  883.  
  884.     if (cheat_state->_generic.menu)
  885.     {
  886.  
  887.         if (&menu_active->item[menu_active->pos] != nullptr)
  888.         {
  889.             if (menu_active->item[menu_active->pos].name != nullptr)
  890.             {
  891.                 if (menu_active->item[menu_active->pos].name[0] == '\t')
  892.                 {
  893.                     menu_active->pos += menu_active->old_increase;
  894.                     if (menu_active->pos < 0)
  895.                         menu_active->pos = menu_active->count - 1;
  896.                     if (menu_active->pos >= menu_active->count)
  897.                         menu_active->pos = 0;
  898.  
  899.                     if (menu_active->pos >= (menu_active->top_pos + MENU_ROWS) - (MENU_ROWS / 2))
  900.                     {
  901.  
  902.                         menu_active->top_pos += menu_active->old_increase;
  903.  
  904.                         if (menu_active->count - menu_active->top_pos < MENU_ROWS)
  905.                             menu_active->top_pos = menu_active->count - MENU_ROWS;
  906.                     }
  907.                 }
  908.             }
  909.         }
  910.  
  911.         int increase = 1;
  912.         if (KEY_PRESSED(set.key_menu_up) || KEY_PRESSED(set.key_menu_down))
  913.         {
  914.             increase = KEY_PRESSED(set.key_menu_up) ? -1 : 1;
  915.             menu_active->pos += increase;
  916.             //if (menu_active->item[menu_active->pos].name != nullptr)
  917.             //{
  918.                 //if (menu_active->item[menu_active->pos].name[0] == '\t')
  919.                 //{
  920.                 //  menu_active->pos += increase;
  921.                 //}
  922.             //}
  923.             if (menu_active->pos >= (menu_active->top_pos + MENU_ROWS) - (MENU_ROWS / 2))
  924.             {
  925.  
  926.                 menu_active->top_pos += increase;
  927.  
  928.                 if (menu_active->count - menu_active->top_pos < MENU_ROWS)
  929.                     menu_active->top_pos = menu_active->count - MENU_ROWS;
  930.             }
  931.  
  932.             key_time_updown = time_get() + MSEC_TO_TIME(MENU_SCROLL_DELAY);
  933.         }
  934.  
  935.         if (KEY_DOWN(set.key_menu_up) || KEY_DOWN(set.key_menu_down))
  936.         {
  937.             if (time_get() > key_time_updown)
  938.             {
  939.                 int diff = time_get() - key_time_updown;
  940.                 int overruns = diff / MENU_SCROLL_TIME;
  941.                 increase = KEY_DOWN(set.key_menu_up) ? -1 : 1;
  942.                 menu_active->pos += increase * (overruns + 1);
  943.  
  944.                 menu_active->top_pos += increase;
  945.  
  946.                 if (menu_active->count - menu_active->top_pos < MENU_ROWS)
  947.                     menu_active->top_pos = menu_active->count - MENU_ROWS;
  948.  
  949.                 //if (menu_active->item[menu_active->pos].name != nullptr)
  950.                 //{
  951.                 //  if (menu_active->item[menu_active->pos].name[0] == '\t')
  952.                 //  {
  953.                 //      menu_active->pos += KEY_DOWN(set.key_menu_up) ? -1 : 1;
  954.                 //  }
  955.                 //}
  956.  
  957.                 key_time_updown = time_get() + MENU_SCROLL_TIME - (diff % MENU_SCROLL_TIME);
  958.             }
  959.         }
  960.         menu_active->old_increase = increase;
  961.  
  962.         if (menu_active->pos < 0)
  963.             menu_active->pos = menu_active->count - 1;
  964.         if (menu_active->pos >= menu_active->count)
  965.             menu_active->pos = 0;
  966.  
  967.         if (menu_active->count <= 0)
  968.             item = NULL;
  969.         else
  970.             item = &menu_active->item[menu_active->pos];
  971.  
  972.  
  973.  
  974.         if (KEY_PRESSED(set.key_menu_left))
  975.         {
  976.             /* pressing left in the main menu, exits the menu */
  977.             if (menu_active->parent == NULL)
  978.             {
  979.                 menu_toggle(false);
  980.                 return;
  981.             }
  982.  
  983.             menu_active = menu_active->parent;
  984.             menu_event_activate(menu_active);
  985.         }
  986.  
  987.         if (KEY_PRESSED(set.key_menu_right) || KEY_PRESSED(set.key_menu_select))
  988.         {
  989.             int was_selected = 0;
  990.  
  991.             if (KEY_PRESSED(set.key_menu_select) && menu_active->callback != NULL && item != NULL)
  992.             {
  993.                 if (menu_active->callback(MENU_OP_SELECT, item))
  994.                     was_selected = 1;
  995.             }
  996.  
  997.             if (!was_selected && item != NULL && item->submenu != NULL)
  998.             {
  999.                 menu_active = item->submenu;
  1000.                 menu_event_activate(menu_active);
  1001.             }
  1002.         }
  1003.  
  1004.         if (KEY_PRESSED(set.key_menu_dec) || KEY_PRESSED(set.key_menu_inc))
  1005.         {
  1006.             int op = KEY_PRESSED(set.key_menu_dec) ? MENU_OP_DEC : MENU_OP_INC;
  1007.             if (item != NULL)
  1008.                 menu_active->callback(op, item);
  1009.             key_time_incdec = time_get() + MSEC_TO_TIME(MENU_SCROLL_DELAY);
  1010.         }
  1011.  
  1012.         if (KEY_DOWN(set.key_menu_dec) || KEY_DOWN(set.key_menu_inc))
  1013.         {
  1014.             if (time_get() > key_time_incdec)
  1015.             {
  1016.                 int diff = time_get() - key_time_incdec;
  1017.                 int overruns = diff / MENU_SCROLL_TIME;
  1018.  
  1019.                 int op = KEY_DOWN(set.key_menu_dec) ? MENU_OP_DEC : MENU_OP_INC;
  1020.                 menu_active->callback(op, item);
  1021.  
  1022.                 key_time_incdec = time_get() + MENU_SCROLL_TIME - (diff % MENU_SCROLL_TIME);
  1023.             }
  1024.         }
  1025.  
  1026.         KEY_CONSUME(set.key_menu_up);
  1027.         KEY_CONSUME(set.key_menu_right);
  1028.         KEY_CONSUME(set.key_menu_down);
  1029.         KEY_CONSUME(set.key_menu_left);
  1030.         KEY_CONSUME(set.key_menu_select);
  1031.         KEY_CONSUME(set.key_menu_dec);
  1032.         KEY_CONSUME(set.key_menu_inc);
  1033.     }
  1034. }
  1035.  
  1036. bool menu_wndproc(UINT uMsg, WPARAM wParam, LPARAM lParam)
  1037. {
  1038.     static bool bPressed = false;
  1039.     switch (uMsg)
  1040.     {
  1041.     case WM_MOUSEMOVE:
  1042.     case WM_LBUTTONDOWN:
  1043.     case WM_RBUTTONDOWN:
  1044.     case WM_MOUSEWHEEL:
  1045.     {
  1046.         if (menu_active == NULL || !cheat_state->_generic.menu || !cheat_state->_generic.menu_mousecontrol)
  1047.             break;
  1048.  
  1049.  
  1050.         POINT               point = { LOWORD(lParam), HIWORD(lParam) };
  1051.         int                 ROW_HEIGHT = MenuSettings.iRowHeight;
  1052.         int                 MENU_HEIGHT = MenuSettings.iMenuHeight;
  1053.         int                 left = (int)MenuSettings.fMenuPos[0];
  1054.         int                 top = (int)MenuSettings.fMenuPos[1];
  1055.         int                 pos = 0;
  1056.  
  1057.  
  1058.  
  1059.         if (uMsg == WM_MOUSEWHEEL)
  1060.         {
  1061.  
  1062.             // WM_MOUSEWHEEL has global cursor coords
  1063.             ScreenToClient(pPresentParam.hDeviceWindow, &point);
  1064.  
  1065.             if (LOWORD(wParam) == MK_SHIFT)
  1066.             {
  1067.                 menu_item* item2 = nullptr;
  1068.                 if (menu_active->count > 0)
  1069.                     item2 = &menu_active->item[menu_active->pos];
  1070.  
  1071.                 int op = short(HIWORD(wParam)) > 0 ? MENU_OP_INC : MENU_OP_DEC;
  1072.                 menu_active->callback(op, item2);
  1073.             }
  1074.             else
  1075.             {
  1076.                 menu_item* item = &menu_active->item[menu_active->pos];
  1077.  
  1078.  
  1079.                 int dir = short(HIWORD(wParam)) > 0 ? -1 : 1;
  1080.                 menu_active->top_pos += dir;
  1081.  
  1082.                 menu_active->old_increase = dir;
  1083.  
  1084.                 if (menu_active->pos < 0)
  1085.                     menu_active->pos = menu_active->count - 1;
  1086.                 if (menu_active->pos >= menu_active->count)
  1087.                     menu_active->pos = 0;
  1088.  
  1089.                 if (menu_active->count - menu_active->top_pos < MENU_ROWS)
  1090.                     menu_active->top_pos = menu_active->count - MENU_ROWS;
  1091.  
  1092.                 if (menu_active->count <= 0)
  1093.                     item = NULL;
  1094.                 else
  1095.                     item = &menu_active->item[menu_active->pos];
  1096.  
  1097.             }
  1098.         }
  1099.  
  1100.         static int iOldPos[2];
  1101.         if ((point.x > left && point.x < left + MENU_WIDTH && point.y < top && point.y > top - MenuSettings.iLogoHeight)
  1102.             || (bPressed && KEY_DOWN(VK_LBUTTON)))
  1103.         {
  1104.             //if (uMsg == WM_LBUTTONDOWN)
  1105.             //{
  1106.             if (KEY_DOWN(VK_LBUTTON))
  1107.             {
  1108.                 if (!bPressed)
  1109.                 {
  1110.                     iOldPos[0] = point.x;
  1111.                     iOldPos[1] = point.y;
  1112.                 }
  1113.                 int iDist[2];
  1114.  
  1115.                 iDist[0] = point.x - iOldPos[0];
  1116.                 iDist[1] = point.y - iOldPos[1];
  1117.  
  1118.                 MenuSettings.fMenuPos[0] += (float)iDist[0];
  1119.                 MenuSettings.fMenuPos[1] += (float)iDist[1];
  1120.  
  1121.  
  1122.                 iOldPos[0] = point.x;
  1123.                 iOldPos[1] = point.y;
  1124.  
  1125.                 bPressed = true;
  1126.  
  1127.             }
  1128.         }
  1129.         else
  1130.         {
  1131.             bPressed = false;
  1132.         }
  1133.  
  1134.         if (point.x > left && point.x < left + MENU_WIDTH && point.y > top && point.y < top + MENU_HEIGHT)
  1135.         {
  1136.             if (!cheat_state->_generic.menu_mousecontrol)
  1137.                 return false;
  1138.  
  1139.             pos = (point.y - top) / ROW_HEIGHT;
  1140.             if (pos > menu_active->count - 1) pos = menu_active->count - 1;
  1141.             if (pos > MENU_ROWS - 1) pos = MENU_ROWS - 1;
  1142.             menu_mouseover = menu_active->top_pos + pos;
  1143.  
  1144.             if (menu_mouseover != -1)
  1145.                 menu_active->pos = menu_mouseover;
  1146.  
  1147.  
  1148.  
  1149.             if (uMsg == WM_LBUTTONDOWN)
  1150.             {
  1151.  
  1152.                 menu_item* item = nullptr;
  1153.                 if (menu_active->count > 0)
  1154.                     item = &menu_active->item[menu_active->pos];
  1155.  
  1156.                 if (item != nullptr && item->submenu != nullptr)
  1157.                 {
  1158.                     menu_active = item->submenu;
  1159.                     menu_event_activate(menu_active);
  1160.                 }
  1161.                 else if (menu_active->callback != nullptr && item != nullptr)
  1162.                 {
  1163.                     menu_active->callback(MENU_OP_SELECT, item);
  1164.                 }
  1165.             }
  1166.         }
  1167.         else
  1168.         {
  1169.             menu_mouseover = -1;
  1170.         }
  1171.  
  1172.         if (uMsg == WM_RBUTTONDOWN)
  1173.         {
  1174.             if (menu_active->parent == NULL)
  1175.             {
  1176.                 menu_toggle(false);
  1177.                 break;
  1178.             }
  1179.             menu_active = menu_active->parent;
  1180.             menu_event_activate(menu_active);
  1181.         }
  1182.         break;
  1183.     }
  1184.     default:
  1185.         bPressed = false;
  1186.         break;
  1187.     }
  1188.     return false;
  1189. }
  1190.  
  1191. void menu_toggle(bool toggle)
  1192. {
  1193.     cheat_state->_generic.menu = toggle;
  1194.     menu_mouseover = -1;
  1195.     if (toggle)
  1196.     {
  1197.         menu_event_activate(menu_active);
  1198.         if (g_SAMP)
  1199.         {
  1200.             if (KEYCOMBO_DOWN(set.key_menu_mousecontrol))
  1201.             {
  1202.                 toggleSAMPCursor(true);
  1203.                 cheat_state->_generic.menu_mousecontrol = true;
  1204.             }
  1205.             //toggleSAMPCursor(true);
  1206.         }
  1207.     }
  1208.     else if (cheat_state->_generic.menu_mousecontrol && g_SAMP)
  1209.     {
  1210.         toggleSAMPCursor(false);
  1211.     }
  1212. }
  1213.  
  1214. static int menu_callback_main(int op, struct menu_item* item)
  1215. {
  1216.     if (op == MENU_OP_SELECT && item->id == 1)
  1217.     {
  1218.         cheat_state->_generic.menu = 0;
  1219.         cheat_state->_generic.new_menu = 1;
  1220.     }
  1221.  
  1222.     return 0;
  1223. }
  1224.  
  1225. static int menu_callback_cheats_mods(int op, struct menu_item* item)
  1226. {
  1227.     struct vehicle_info* vinfo = vehicle_info_get(VEHICLE_SELF, 0);
  1228.     if (vinfo == NULL)
  1229.         return 0;
  1230.     switch (op)
  1231.     {
  1232.     case MENU_OP_DEC:
  1233.     case MENU_OP_INC:
  1234.         int mod, color_temp, paintjob_temp;
  1235.         switch (item->id)
  1236.         {
  1237.         case ID_CHEAT_MODS_COLOR1:
  1238.             color_temp = vehicle_getColor0(vinfo);
  1239.             mod = (op == MENU_OP_DEC) ? -1 : 1;
  1240.             if (mod > 0)
  1241.                 color_temp++;
  1242.             if (mod < 0)
  1243.                 color_temp--;
  1244.             if (color_temp < 0)
  1245.                 color_temp = 0;
  1246.             vehicle_setColor0(vinfo, color_temp);
  1247.             menu_item_name_set(item, "Color 1: %d", color_temp);
  1248.             return 1;
  1249.  
  1250.         case ID_CHEAT_MODS_COLOR2:
  1251.             color_temp = vehicle_getColor1(vinfo);
  1252.             mod = (op == MENU_OP_DEC) ? -1 : 1;
  1253.             if (mod > 0)
  1254.                 color_temp++;
  1255.             if (mod < 0)
  1256.                 color_temp--;
  1257.             if (color_temp < 0)
  1258.                 color_temp = 0;
  1259.             vehicle_setColor1(vinfo, color_temp);
  1260.             menu_item_name_set(item, "Color 2: %d", color_temp);
  1261.             return 1;
  1262.  
  1263.         case ID_CHEAT_MODS_PAINTJOB:
  1264.             paintjob_temp = vehicle_getPaintJob(vinfo);
  1265.             mod = (op == MENU_OP_DEC) ? -1 : 1;
  1266.             if (mod > 0)
  1267.                 paintjob_temp++;
  1268.             if (mod < 0)
  1269.                 paintjob_temp--;
  1270.             if (paintjob_temp < 0)
  1271.                 paintjob_temp = 0;
  1272.             if (paintjob_temp > 4)
  1273.                 paintjob_temp = 4;
  1274.             vehicle_setPaintJob(vinfo, paintjob_temp);
  1275.             menu_item_name_set(item, "Paintjob: %d", paintjob_temp);
  1276.             return 1;
  1277.         }
  1278.  
  1279.     case MENU_OP_SELECT:
  1280.         if (item->id >= 1000 && item->id <= 1193)
  1281.         {
  1282.             struct actor_info* ainfo = actor_info_get(ACTOR_SELF, 0);
  1283.             if (vinfo->passengers[0] != ainfo)
  1284.                 return 0;
  1285.  
  1286.             int                     iModelID = item->id;
  1287.             int                     iUpgradeInfoID;
  1288.             vehicle_upgrade_info    upgrade_info = get_cveh_upgrade_info(iModelID, iUpgradeInfoID);
  1289.             int                     iModelIDplusOne = cveh_upgrade_info[iUpgradeInfoID + 1].iModelID;
  1290.             if (upgrade_info.upgradeCategoryName == "Sideskirt" || upgrade_info.upgradeCategoryName == "Vents")
  1291.             {
  1292.                 loadSpecificModel(iModelID);
  1293.                 loadSpecificModel(iModelIDplusOne);
  1294.                 vehicle_addUpgrade(vinfo, iModelID);
  1295.                 vehicle_addUpgrade(vinfo, iModelIDplusOne);
  1296.             }
  1297.             else
  1298.             {
  1299.                 loadSpecificModel(iModelID);
  1300.                 vehicle_addUpgrade(vinfo, iModelID);
  1301.             }
  1302.  
  1303.             return 1;
  1304.         }
  1305.     }
  1306.  
  1307.     return 0;
  1308. }
  1309.  
  1310.  
  1311.  
  1312. static int menu_callback_cheats(int op, struct menu_item* item)
  1313. {
  1314.     struct actor_info* info;
  1315.     int                 mod;
  1316.  
  1317.     switch (op)
  1318.     {
  1319.     case MENU_OP_ENABLED:
  1320.         switch (item->id)
  1321.         {
  1322.         case ID_CHEAT_INVULN:
  1323.             return cheat_state->_generic.hp_cheat;
  1324.  
  1325.         case ID_CHEAT_WEAPONS:
  1326.             return 0;
  1327.  
  1328.         case ID_CHEAT_MONEY:
  1329.             return cheat_state->_generic.money;
  1330.  
  1331.         case ID_CHEAT_MODS:
  1332.             return 0;
  1333.  
  1334.         case ID_CHEAT_PROT:
  1335.             return cheat_state->vehicle.protection;
  1336.  
  1337.         case ID_CHEAT_WARP_NEAR:
  1338.             return 0;
  1339.  
  1340.         case ID_CHEAT_JETPACK:
  1341.             return 0;
  1342.  
  1343.         case ID_CHEAT_UNLOCK:
  1344.             return cheat_state->_generic.vehicles_unlock;
  1345.  
  1346.         case ID_CHEAT_WEATHER:
  1347.             return set.force_weather == (int)(UINT_PTR)item->data;
  1348.  
  1349.         case ID_CHEAT_TIME:
  1350.             return set.force_hour == (int)(UINT_PTR)item->data;
  1351.  
  1352.         case ID_CHEAT_HP:
  1353.             return 0;
  1354.  
  1355.         case ID_CHEAT_ARMOR:
  1356.             return 0;
  1357.  
  1358.         case ID_CHEAT_GRAVITY:
  1359.             return 0;
  1360.  
  1361.         case ID_CHEAT_MAP:
  1362.             return cheat_state->_generic.map;
  1363.  
  1364.         case ID_CHEAT_TELETEXTS:
  1365.             return cheat_state->_generic.teletext;
  1366.  
  1367.         case ID_CHEAT_GAME_SPEED:
  1368.             return 0;
  1369.  
  1370.         case ID_CHEAT_KEEP_TRAILER:
  1371.             return cheat_state->vehicle.keep_trailer_attached;
  1372.  
  1373.         case ID_CHEAT_NOCOLS:
  1374.             return cheat_state->_generic.nocols_enabled;
  1375.  
  1376.         case ID_CHEAT_CHAMS:
  1377.             return set.chams_on;
  1378.  
  1379.         case ID_CHEAT_CUSTOM_RUNSTYLE:
  1380.             return set.custom_runanimation_enabled;
  1381.  
  1382.         case ID_CHEAT_FLY_SPEED:
  1383.             return cheat_state->actor.fly_on;
  1384.  
  1385.         case ID_CHEAT_DISABLE_WAVES:
  1386.             return pGameInterface->GetWaterManager()->GetWaveLevel() == 0.0f;
  1387.  
  1388.         case ID_CHEAT_MAP_DRAW_LINES:
  1389.             return set.map_draw_lines;
  1390.  
  1391.         case ID_CHEAT_SURF:
  1392.             return cheat_state->actor.surf;
  1393.  
  1394.         case ID_CHEAT_FREEZEROT:
  1395.             return cheat_state->vehicle.freezerot;
  1396.         }
  1397.         break;
  1398.  
  1399.     case MENU_OP_SELECT:
  1400.         switch (item->id)
  1401.         {
  1402.         case ID_CHEAT_INVULN:
  1403.             cheat_state->_generic.hp_cheat ^= 1;
  1404.             if (!cheat_state->_generic.hp_cheat)
  1405.             {
  1406.                 struct actor_info* self = actor_info_get(ACTOR_SELF, 0);
  1407.                 self->flags &= ~ACTOR_FLAGS_INVULNERABLE;
  1408.             }
  1409.             break;
  1410.  
  1411.         case ID_CHEAT_MONEY:
  1412.             cheat_state->_generic.money ^= 1;
  1413.             break;
  1414.  
  1415.         case ID_CHEAT_PROT:
  1416.             cheat_state->vehicle.protection ^= 1;
  1417.             break;
  1418.  
  1419.         case ID_CHEAT_WARP_NEAR:
  1420.             cheat_teleport_nearest_car();
  1421.             break;
  1422.  
  1423.         case ID_CHEAT_JETPACK:
  1424.             gta_jetpack_give();
  1425.             break;
  1426.  
  1427.         case ID_CHEAT_UNLOCK:
  1428.             cheat_state->_generic.vehicles_unlock ^= 1;
  1429.             break;
  1430.  
  1431.         case ID_CHEAT_WEATHER:
  1432.             if (set.force_weather == (int)(UINT_PTR)item->data)
  1433.                 set.force_weather = -1;
  1434.             else
  1435.                 set.force_weather = (int)(UINT_PTR)item->data;
  1436.             break;
  1437.  
  1438.         case ID_CHEAT_TIME:
  1439.             if (set.force_hour == (int)(UINT_PTR)item->data)
  1440.                 set.force_hour = -1;
  1441.             else
  1442.                 set.force_hour = (int)(UINT_PTR)item->data;
  1443.             break;
  1444.  
  1445.         case ID_CHEAT_MAP:
  1446.             cheat_state->_generic.map ^= 1;
  1447.             break;
  1448.  
  1449.         case ID_CHEAT_TELETEXTS:
  1450.             cheat_state->_generic.teletext ^= 1;
  1451.             break;
  1452.  
  1453.         case ID_CHEAT_HP:
  1454.         case ID_CHEAT_ARMOR:
  1455.             if ((info = actor_info_get(ACTOR_SELF, ACTOR_ALIVE)) != NULL)
  1456.             {
  1457.                 if (item->id == ID_CHEAT_HP)
  1458.                     info->hitpoints = 100.0f;
  1459.                 else
  1460.                     info->armor = 100.0f;
  1461.             }
  1462.             break;
  1463.  
  1464.         case ID_CHEAT_KEEP_TRAILER:
  1465.             cheat_state->vehicle.keep_trailer_attached ^= 1;
  1466.             break;
  1467.  
  1468.         case ID_CHEAT_NOCOLS:
  1469.             cheat_state->_generic.nocols_enabled ^= 1;
  1470.             break;
  1471.  
  1472.         case ID_CHEAT_CHAMS:
  1473.             set.chams_on ^= 1;
  1474.             break;
  1475.  
  1476.         case ID_CHEAT_CUSTOM_RUNSTYLE:
  1477.             set.custom_runanimation_enabled ^= 1;
  1478.             break;
  1479.  
  1480.         case ID_CHEAT_FLY_SPEED:
  1481.             cheat_state->actor.fly_on ^= 1;
  1482.             break;
  1483.  
  1484.         case ID_CHEAT_DISABLE_WAVES:
  1485.             if (pGameInterface->GetWaterManager()->GetWaveLevel() == 0.0f)
  1486.                 pGameInterface->GetWaterManager()->SetWaveLevel(-1.0f);
  1487.             else
  1488.                 pGameInterface->GetWaterManager()->SetWaveLevel(0.0f);
  1489.             break;
  1490.  
  1491.         case ID_CHEAT_MAP_DRAW_LINES:
  1492.             set.map_draw_lines ^= 1;
  1493.             break;
  1494.  
  1495.         case ID_CHEAT_SURF:
  1496.             cheat_state->actor.surf ^= 1;
  1497.             break;
  1498.  
  1499.         case ID_CHEAT_FREEZEROT:
  1500.             cheat_state->vehicle.freezerot ^= 1;
  1501.             break;
  1502.  
  1503.         default:
  1504.             return 0;
  1505.         }
  1506.  
  1507.         return 1;
  1508.  
  1509.     case MENU_OP_DEC:
  1510.     case MENU_OP_INC:
  1511.         mod = (op == MENU_OP_DEC) ? -1 : 1;
  1512.         switch (item->id)
  1513.         {
  1514.         case ID_CHEAT_GRAVITY:
  1515.             if (mod > 0 && gta_gravity_get() < 0.1f)
  1516.                 gta_gravity_set(gta_gravity_get() + 0.001f);
  1517.             if (mod < 0 && gta_gravity_get() > -0.1f)
  1518.                 gta_gravity_set(gta_gravity_get() - 0.001f);
  1519.             menu_item_name_set(item, "Gravity: %.04f", gta_gravity_get());
  1520.             return 1;
  1521.  
  1522.         case ID_CHEAT_GAME_SPEED:
  1523.             cheat_state->game_speed += (float)mod * 0.05f;
  1524.             menu_item_name_set(item, "Game speed: %d%%", (int)roundf(cheat_state->game_speed * 100.0f));
  1525.             return 1;
  1526.  
  1527.         case ID_CHEAT_CUSTOM_RUNSTYLE:
  1528.             set.custom_runanimation_id += mod;
  1529.             if (set.custom_runanimation_id >= MOVE_ANIMATIONS_COUNT)
  1530.                 set.custom_runanimation_id = 0;
  1531.             else if (set.custom_runanimation_id < 0)
  1532.                 set.custom_runanimation_id = (MOVE_ANIMATIONS_COUNT - 1);
  1533.             menu_item_name_set(item, "Custom running style: %i, %s", set.custom_runanimation_id,
  1534.                 move_animations[set.custom_runanimation_id].moveStyleName);
  1535.             return 1;
  1536.  
  1537.         case ID_CHEAT_FLY_SPEED:
  1538.             if (set.fly_player_speed <= 4.95f)
  1539.             {
  1540.                 set.fly_player_speed += mod * 0.1f;
  1541.             }
  1542.             else if (set.fly_player_speed <= 5.05f
  1543.                 && mod < 0)
  1544.             {
  1545.                 set.fly_player_speed += mod * 0.1f;
  1546.             }
  1547.             else
  1548.             {
  1549.                 set.fly_player_speed += mod * 1.0f;
  1550.             }
  1551.             // don't allow it to go under 0.1f
  1552.             if (set.fly_player_speed < 0.1f)
  1553.             {
  1554.                 set.fly_player_speed = 0.1f;
  1555.             }
  1556.  
  1557.             menu_item_name_set(item, "Player Fly Speed: %0.01f", set.fly_player_speed);
  1558.             return 1;
  1559.  
  1560.         } // end of INC/DEC
  1561.     }
  1562.  
  1563.     return 0;
  1564. }
  1565.  
  1566. static int menu_callback_handling(int op, struct menu_item* item)
  1567. {
  1568.     CVehicle* cveh = getSelfCVehicle();
  1569.     if (cveh == NULL)
  1570.         return NULL;
  1571.  
  1572.     int     mod;
  1573.     float   hlng;
  1574.  
  1575.     switch (op)
  1576.     {
  1577.     case MENU_OP_DEC:
  1578.     case MENU_OP_INC:
  1579.         mod = (op == MENU_OP_DEC) ? -1 : 1;
  1580.  
  1581.         switch (item->id)
  1582.         {
  1583.         case ID_CHEAT_HANDLING_MULTIPLIER:
  1584.             if (mod > 0)
  1585.                 set.handling_multiplier += 0.050f;
  1586.             if (mod < 0)
  1587.                 set.handling_multiplier -= 0.050f;
  1588.             menu_item_name_set(item, "Multiplier: %0.2f", set.handling_multiplier);
  1589.             return 1;
  1590.  
  1591.         case ID_CHEAT_HANDLING_ENGNACCEL:
  1592.             hlng = cveh->GetHandlingData()->GetEngineAccelleration();
  1593.             if (mod > 0)
  1594.                 hlng += set.handling_multiplier;
  1595.             if (mod < 0)
  1596.                 hlng -= set.handling_multiplier;
  1597.             cveh->GetHandlingData()->SetEngineAccelleration(hlng);
  1598.  
  1599.             //cveh->GetHandlingData()->Recalculate();
  1600.             menu_item_name_set(item, "Engine acceleration: %0.2f", hlng);
  1601.             return 1;
  1602.  
  1603.         case ID_CHEAT_HANDLING_BRAKEDECEL:
  1604.             hlng = cveh->GetHandlingData()->GetBrakeDecelleration();
  1605.             if (mod > 0)
  1606.                 hlng += set.handling_multiplier;
  1607.             if (mod < 0)
  1608.                 hlng -= set.handling_multiplier;
  1609.             cveh->GetHandlingData()->SetBrakeDecelleration(hlng);
  1610.  
  1611.             //cveh->GetHandlingData()->Recalculate();
  1612.             menu_item_name_set(item, "Brake decelleration: %0.2f", hlng);
  1613.             return 1;
  1614.  
  1615.         case ID_CHEAT_HANDLING_MAXVEL:
  1616.             hlng = cveh->GetHandlingData()->GetMaxVelocity();
  1617.             if (mod > 0)
  1618.                 hlng += set.handling_multiplier;
  1619.             if (mod < 0)
  1620.                 hlng -= set.handling_multiplier;
  1621.             cveh->GetHandlingData()->SetMaxVelocity(hlng);
  1622.  
  1623.             //cveh->GetHandlingData()->Recalculate();
  1624.             menu_item_name_set(item, "Max velocity: %0.2f", hlng);
  1625.             return 1;
  1626.  
  1627.         case ID_CHEAT_HANDLING_TRACMULT:
  1628.             hlng = cveh->GetHandlingData()->GetTractionMultiplier();
  1629.             if (mod > 0)
  1630.                 hlng += set.handling_multiplier;
  1631.             if (mod < 0)
  1632.                 hlng -= set.handling_multiplier;
  1633.             cveh->GetHandlingData()->SetTractionMultiplier(hlng);
  1634.             menu_item_name_set(item, "Traction multiplier: %0.2f", hlng);
  1635.             return 1;
  1636.  
  1637.         case ID_CHEAT_HANDLING_TRACTIONLOSS:
  1638.             hlng = cveh->GetHandlingData()->GetTractionLoss();
  1639.             if (mod > 0)
  1640.                 hlng += set.handling_multiplier;
  1641.             if (mod < 0)
  1642.                 hlng -= set.handling_multiplier;
  1643.             cveh->GetHandlingData()->SetTractionLoss(hlng);
  1644.             menu_item_name_set(item, "Traction loss: %0.2f", hlng);
  1645.             return 1;
  1646.  
  1647.             /*case ID_CHEAT_HANDLING_TRACTIONBIAS:
  1648.                 if(mod > 0) info->pHandlingData->fTractionBias += set.handling_multiplier;
  1649.                 if(mod < 0) info->pHandlingData->fTractionBias -= set.handling_multiplier;
  1650.                 menu_item_name_set(item, "Traction bias: %0.2f", info->pHandlingData->fTractionBias);
  1651.                 return 1;*/
  1652.         case ID_CHEAT_HANDLING_TRACTIONBIAS:
  1653.             hlng = cveh->GetHandlingData()->GetTractionBias();
  1654.             if (mod > 0)
  1655.                 hlng += set.handling_multiplier;
  1656.             if (mod < 0)
  1657.                 hlng -= set.handling_multiplier;
  1658.             cveh->GetHandlingData()->SetTractionBias(hlng);
  1659.             menu_item_name_set(item, "Traction bias: %0.2f", hlng);
  1660.             return 1;
  1661.  
  1662.         case ID_CHEAT_HANDLING_SUSPFORCELVL:
  1663.             hlng = cveh->GetHandlingData()->GetSuspensionForceLevel();
  1664.             if (mod > 0)
  1665.                 hlng += set.handling_multiplier;
  1666.             if (mod < 0)
  1667.                 hlng -= set.handling_multiplier;
  1668.             cveh->GetHandlingData()->SetSuspensionForceLevel(hlng);
  1669.             menu_item_name_set(item, "Suspension force level: %0.2f", hlng);
  1670.             return 1;
  1671.  
  1672.             // this one really makes the vehicle go nuttahs with tilt
  1673.             // you might lose the wheels using it, lol
  1674.             /*case ID_CHEAT_HANDLING_SUSPANTIDIVEMULT:
  1675.                 if(mod > 0) info->pHandlingData->fSuspensionAntidiveMultiplier += set.handling_multiplier;
  1676.                 if(mod < 0) info->pHandlingData->fSuspensionAntidiveMultiplier -= set.handling_multiplier;
  1677.                 menu_item_name_set(item, "Suspension anti-dive multiplier: %0.2f", info->pHandlingData->fSuspensionAntidiveMultiplier);
  1678.                 return 1;*/
  1679.         case ID_CHEAT_HANDLING_MASS:
  1680.             hlng = cveh->GetHandlingData()->GetMass();
  1681.             if (mod > 0)
  1682.                 hlng += set.handling_multiplier;
  1683.             if (mod < 0)
  1684.                 hlng -= set.handling_multiplier;
  1685.             cveh->GetHandlingData()->SetMass(hlng);
  1686.             menu_item_name_set(item, "Mass: %0.2f", hlng);
  1687.             return 1;
  1688.  
  1689.         case ID_CHEAT_HANDLING_TURNMASS:
  1690.             hlng = cveh->GetHandlingData()->GetTurnMass();
  1691.             if (mod > 0)
  1692.                 hlng += set.handling_multiplier;
  1693.             if (mod < 0)
  1694.                 hlng -= set.handling_multiplier;
  1695.             cveh->GetHandlingData()->SetTurnMass(hlng);
  1696.             menu_item_name_set(item, "Turn mass: %0.2f", hlng);
  1697.             return 1;
  1698.  
  1699.         case ID_CHEAT_HANDLING_DRAGCOEFF:
  1700.             hlng = cveh->GetHandlingData()->GetDragCoeff();
  1701.             if (mod > 0)
  1702.                 hlng += set.handling_multiplier;
  1703.             if (mod < 0)
  1704.                 hlng -= set.handling_multiplier;
  1705.             cveh->GetHandlingData()->SetDragCoeff(hlng);
  1706.             menu_item_name_set(item, "Drag coeffiecient: %0.2f", hlng);
  1707.             return 1;
  1708.  
  1709.             /*case ID_CHEAT_HANDLING_COLDMGMULT:
  1710.             if(mod > 0) info->pHandlingData->fCollisionDamageMultiplier += set.handling_multiplier;
  1711.             if(mod < 0) info->pHandlingData->fCollisionDamageMultiplier -= set.handling_multiplier;
  1712.             menu_item_name_set(item, "Collision damage multiplier: %0.2f", info->pHandlingData->fCollisionDamageMultiplier);
  1713.             return 1;*/
  1714.         }
  1715.     }
  1716.  
  1717.     return 0;
  1718. }
  1719.  
  1720. static int menu_callback_cheats_invuln(int op, struct menu_item* item)
  1721. {
  1722.     int mod;
  1723.  
  1724.     switch (op)
  1725.     {
  1726.     case MENU_OP_ENABLED:
  1727.         switch (item->id)
  1728.         {
  1729.         case ID_CHEAT_INVULN_ACTOR:
  1730.             return cheat_state->actor.invulnerable;
  1731.  
  1732.         case ID_CHEAT_INVULN_VEHICLE:
  1733.             return cheat_state->vehicle.invulnerable;
  1734.  
  1735.         case ID_CHEAT_INVULN_TIRES:
  1736.             return cheat_state->vehicle.hp_tire_support;
  1737.  
  1738.         case ID_CHEAT_INVULN_MIN_HP:
  1739.             return cheat_state->vehicle.hp_minimum_on;
  1740.  
  1741.         case ID_CHEAT_INVULN_REGEN:
  1742.             return cheat_state->vehicle.hp_regen_on;
  1743.  
  1744.         case ID_CHEAT_INVULN_REGEN_ONFOOT:
  1745.             return cheat_state->actor.hp_regen_on;
  1746.  
  1747.         case ID_CHEAT_INVULN_DISABLE_EXTRA_INV:
  1748.             return set.hp_disable_inv_sp_enemies;
  1749.  
  1750.         case ID_CHEAT_INVULN_ACT_EXPL_INV:
  1751.             return set.hp_actor_explosion_inv;
  1752.  
  1753.         case ID_CHEAT_INVULN_ACT_FALL_INV:
  1754.             return set.hp_actor_fall_inv;
  1755.  
  1756.         case ID_CHEAT_INVULN_ACT_FIRE_INV:
  1757.             return set.hp_actor_fire_inv;
  1758.         }
  1759.         break;
  1760.  
  1761.     case MENU_OP_SELECT:
  1762.         switch (item->id)
  1763.         {
  1764.         case ID_CHEAT_INVULN_ACTOR:
  1765.             cheat_state->actor.invulnerable ^= 1;
  1766.             break;
  1767.  
  1768.         case ID_CHEAT_INVULN_VEHICLE:
  1769.             cheat_state->vehicle.invulnerable ^= 1;
  1770.             break;
  1771.  
  1772.         case ID_CHEAT_INVULN_TIRES:
  1773.             cheat_state->vehicle.hp_tire_support ^= 1;
  1774.             break;
  1775.  
  1776.         case ID_CHEAT_INVULN_MIN_HP:
  1777.             cheat_state->vehicle.hp_minimum_on ^= 1;
  1778.             break;
  1779.  
  1780.         case ID_CHEAT_INVULN_REGEN:
  1781.             cheat_state->vehicle.hp_regen_on ^= 1;
  1782.             break;
  1783.  
  1784.         case ID_CHEAT_INVULN_REGEN_ONFOOT:
  1785.             cheat_state->actor.hp_regen_on ^= 1;
  1786.             break;
  1787.  
  1788.         case ID_CHEAT_INVULN_DISABLE_EXTRA_INV:
  1789.             set.hp_disable_inv_sp_enemies ^= 1;
  1790.             break;
  1791.  
  1792.         case ID_CHEAT_INVULN_ACT_EXPL_INV:
  1793.             set.hp_actor_explosion_inv ^= 1;
  1794.             break;
  1795.  
  1796.         case ID_CHEAT_INVULN_ACT_FALL_INV:
  1797.             set.hp_actor_fall_inv ^= 1;
  1798.             break;
  1799.  
  1800.         case ID_CHEAT_INVULN_ACT_FIRE_INV:
  1801.             set.hp_actor_fire_inv ^= 1;
  1802.             break;
  1803.  
  1804.         default:
  1805.             return 0;
  1806.         }
  1807.  
  1808.         return 1;
  1809.         break;
  1810.  
  1811.     case MENU_OP_DEC:
  1812.     case MENU_OP_INC:
  1813.         mod = (op == MENU_OP_DEC) ? -1 : 1;
  1814.         switch (item->id)
  1815.         {
  1816.         case ID_CHEAT_INVULN_MIN_HP:
  1817.             if (set.hp_minimum > 1000.0f)
  1818.             {
  1819.                 set.hp_minimum = (mod == 1) ? (set.hp_minimum * 2.0f) : (set.hp_minimum / 2.0f);
  1820.                 if (set.hp_minimum < 1000.0f)
  1821.                     set.hp_minimum = 1000.0f;
  1822.             }
  1823.             else if (set.hp_minimum > 250.0f)
  1824.             {
  1825.                 set.hp_minimum += (float)mod * 50.0f;
  1826.             }
  1827.             else
  1828.             {
  1829.                 set.hp_minimum += (float)mod * 10.0f;
  1830.             }
  1831.  
  1832.             if (set.hp_minimum <= 0.0f)
  1833.                 set.hp_minimum = 0.0f;
  1834.             else if (set.hp_minimum > 1000000.0f)
  1835.                 set.hp_minimum = 1000000.0f;
  1836.             else
  1837.                 set.hp_minimum = roundf(set.hp_minimum);
  1838.  
  1839.             menu_item_name_set(item, "Vehicle minimum HP: %d", (int)set.hp_minimum);
  1840.             break;
  1841.  
  1842.         case ID_CHEAT_INVULN_REGEN:
  1843.             set.hp_regen += (float)mod;
  1844.             menu_item_name_set(item, "Vehicle HP regeneration: %dhp/sec", (int)set.hp_regen);
  1845.             break;
  1846.  
  1847.         case ID_CHEAT_INVULN_REGEN_ONFOOT:
  1848.             set.hp_regen_onfoot += (float)mod;
  1849.             menu_item_name_set(item, "Onfoot HP regeneration: %dhp/sec", (int)set.hp_regen_onfoot);
  1850.             break;
  1851.         }
  1852.         break;
  1853.     }
  1854.  
  1855.     return 0;
  1856. }
  1857.  
  1858. static int menu_callback_cheats_money(int op, struct menu_item* item)
  1859. {
  1860.     uint32_t    money;
  1861.     int         mod;
  1862.  
  1863.     switch (op)
  1864.     {
  1865.     case MENU_OP_SELECT:
  1866.         money = gta_money_get();
  1867.         switch (item->id)
  1868.         {
  1869.         case ID_CHEAT_MONEY_GIVE_500:
  1870.             money += 500;
  1871.             break;
  1872.  
  1873.         case ID_CHEAT_MONEY_GIVE_1000:
  1874.             money += 1000;
  1875.             break;
  1876.  
  1877.         case ID_CHEAT_MONEY_GIVE_5000:
  1878.             money += 5000;
  1879.             break;
  1880.  
  1881.         case ID_CHEAT_MONEY_GIVE_10000:
  1882.             money += 10000;
  1883.             break;
  1884.  
  1885.         case ID_CHEAT_MONEY_GIVE_20000:
  1886.             money += 20000;
  1887.             break;
  1888.  
  1889.         case ID_CHEAT_MONEY_GIVE_99999999:
  1890.             money += 99999999;
  1891.             break;
  1892.  
  1893.         case ID_CHEAT_MONEY_GIVE_CUSTOM:
  1894.             money += set.money_value;
  1895.             break;
  1896.         }
  1897.  
  1898.         gta_money_set(money);
  1899.         break;
  1900.  
  1901.     case MENU_OP_DEC:
  1902.     case MENU_OP_INC:
  1903.         mod = (op == MENU_OP_DEC) ? -1 : 1;
  1904.         switch (item->id)
  1905.         {
  1906.         case ID_CHEAT_MONEY_MAX:
  1907.             set.money_amount_max += 50000 * mod;
  1908.             break;
  1909.  
  1910.         case ID_CHEAT_MONEY_RAND_MIN:
  1911.             set.money_amount_rand_min += 500 * mod;
  1912.             break;
  1913.  
  1914.         case ID_CHEAT_MONEY_RAND_MAX:
  1915.             set.money_amount_rand_max += 500 * mod;
  1916.             break;
  1917.  
  1918.         case ID_CHEAT_MONEY_IVAL_MIN:
  1919.             set.money_interval_rand_min += 1 * mod;
  1920.             break;
  1921.  
  1922.         case ID_CHEAT_MONEY_IVAL_MAX:
  1923.             set.money_interval_rand_max += 1 * mod;
  1924.             break;
  1925.         }
  1926.  
  1927.         switch (item->id)
  1928.         {
  1929.         case ID_CHEAT_MONEY_MAX:
  1930.             menu_item_name_set(item, "Max money: %d", (int)set.money_amount_max);
  1931.             break;
  1932.  
  1933.         case ID_CHEAT_MONEY_RAND_MIN:
  1934.             menu_item_name_set(item, "Random min: %d", (int)set.money_amount_rand_min);
  1935.             break;
  1936.  
  1937.         case ID_CHEAT_MONEY_RAND_MAX:
  1938.             menu_item_name_set(item, "Random max: %d", (int)set.money_amount_rand_max);
  1939.             break;
  1940.  
  1941.         case ID_CHEAT_MONEY_IVAL_MIN:
  1942.             menu_item_name_set(item, "Interval min: %dsec", (int)set.money_interval_rand_min);
  1943.             break;
  1944.  
  1945.         case ID_CHEAT_MONEY_IVAL_MAX:
  1946.             menu_item_name_set(item, "Interval max: %dsec", (int)set.money_interval_rand_max);
  1947.             break;
  1948.  
  1949.         default:
  1950.             return 0;
  1951.         }
  1952.     }
  1953.  
  1954.     return 0;
  1955. }
  1956.  
  1957. int randammo, randammoclip;
  1958. static int menu_callback_weapons(int op, struct menu_item* item)
  1959. {
  1960.     struct weapon_entry* weapon = (struct weapon_entry*)item->data;
  1961.     struct actor_info* actor_info = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);
  1962.     if (actor_info == NULL)
  1963.         return 0;
  1964.  
  1965.     if (op == MENU_OP_ENABLED)
  1966.     {
  1967.         switch (item->id)
  1968.         {
  1969.         case ID_NONE:
  1970.             return 0;
  1971.  
  1972.         case ID_WEAPON_ENABLE:
  1973.             return cheat_state->_generic.weapon;
  1974.  
  1975.         case ID_WEAPON_RANDOM:
  1976.             return set.ammo_random;
  1977.         }
  1978.  
  1979.         if (weapon == NULL)
  1980.             return 0;
  1981.  
  1982.         if (set.weapon[weapon->slot] == weapon)
  1983.             return 1;
  1984.     }
  1985.     else if (op == MENU_OP_SELECT)
  1986.     {
  1987.         if (item->id == ID_WEAPON_ENABLE)
  1988.         {
  1989.             cheat_state->_generic.weapon ^= 1;
  1990.             return 1;
  1991.         }
  1992.  
  1993.         if (item->id == ID_WEAPON_RANDOM)
  1994.         {
  1995.             set.ammo_random ^= 1;
  1996.             return 1;
  1997.         }
  1998.  
  1999.         if (weapon == NULL)
  2000.             return 0;
  2001.  
  2002.         if (set.weapon[weapon->slot] == weapon)
  2003.         {
  2004.             set.weapon[weapon->slot] = NULL;
  2005.             return 1;
  2006.         }
  2007.  
  2008.         set.weapon[weapon->slot] = weapon;
  2009.  
  2010.         if (!cheat_state->_generic.weapon)
  2011.             return 1;
  2012.  
  2013.         randammo = (rand() % set.ammo) + 1;
  2014.         randammoclip = (rand() % set.ammo_clip) + 1;
  2015.         gta_weapon_set(actor_info, set.weapon[weapon->slot]->slot, set.weapon[weapon->slot]->id, randammo, randammoclip);
  2016.         return 1;
  2017.     }
  2018.  
  2019.     return 0;
  2020. }
  2021.  
  2022. static int menu_callback_patches(int op, struct menu_item* item)
  2023. {
  2024.     struct patch_set* patch = &set.patch[item->id];
  2025.  
  2026.     if (op == MENU_OP_ENABLED)
  2027.     {
  2028.         return patch->installed;
  2029.     }
  2030.     else if (op == MENU_OP_SELECT)
  2031.     {
  2032.         if (patch->installed || patch->failed)
  2033.             patcher_remove(patch);
  2034.         else
  2035.             patcher_install(patch);
  2036.  
  2037.         return 1;
  2038.     }
  2039.  
  2040.     return 0;
  2041. }
  2042.  
  2043. static int menu_callback_samppatches(int op, struct menu_item* item)
  2044. {
  2045.     if (item->id == ID_MENU_NETPATCHES_INPACKET || item->id == ID_MENU_NETPATCHES_INRPC ||
  2046.         item->id == ID_MENU_NETPATCHES_OUTPACKET || item->id == ID_MENU_NETPATCHES_OUTRPC)
  2047.         return 0;
  2048.  
  2049.     struct patch_set* patch = &set.sampPatch[item->id];
  2050.     if (op == MENU_OP_ENABLED)
  2051.     {
  2052.         return patch->installed;
  2053.     }
  2054.     else if (op == MENU_OP_SELECT)
  2055.     {
  2056.         if (patch->installed || patch->failed)
  2057.             patcher_remove(patch);
  2058.         else
  2059.             patcher_install(patch);
  2060.  
  2061.         return 1;
  2062.     }
  2063.  
  2064.     return 0;
  2065. }
  2066.  
  2067. static int menu_callback_vehicles(int op, struct menu_item* item)
  2068. {
  2069.     if (op == MENU_OP_ENABLED)
  2070.     {
  2071.         switch (item->id)
  2072.         {
  2073.         case ID_VEHICLES_IWARP:
  2074.             return cheat_state->_generic.vehicles_warp_invert;
  2075.  
  2076.         case ID_VEHICLES_FREEZE:
  2077.             return cheat_state->_generic.vehicles_freeze;
  2078.         }
  2079.     }
  2080.     else if (op == MENU_OP_SELECT)
  2081.     {
  2082.         switch (item->id)
  2083.         {
  2084.         case ID_VEHICLES_IWARP:
  2085.             cheat_state->_generic.vehicles_warp_invert ^= 1;
  2086.             break;
  2087.  
  2088.         case ID_VEHICLES_FREEZE:
  2089.             cheat_state->_generic.vehicles_freeze ^= 1;
  2090.             break;
  2091.  
  2092.         default:
  2093.             return 0;
  2094.         }
  2095.  
  2096.         return 1;
  2097.     }
  2098.  
  2099.     return 0;
  2100. }
  2101.  
  2102. static int menu_callback_vehicles_sub(int op, struct menu_item* item)
  2103. {
  2104.     if (op == MENU_OP_SELECT && item->id != ID_NONE)
  2105.     {
  2106.         struct actor_info* self = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);
  2107.         struct vehicle_info* info = vehicle_info_get(item->id, VEHICLE_ALIVE | ((cheat_state->_generic.vehicles_freeze || !cheat_state->_generic.vehicles_warp_invert) ? 0 : VEHICLE_EMPTY));
  2108.         float               pos[3];
  2109.  
  2110.         if (vect3_near_zero(&info->base.matrix[4 * 3]))
  2111.         {
  2112.             cheat_state_text("Vehicle does not exist.");
  2113.             return 1;
  2114.         }
  2115.  
  2116.  
  2117.         if (info != NULL && self != NULL)
  2118.         {
  2119.             if (cheat_state->_generic.vehicles_warp_invert)
  2120.             {
  2121.                 vect3_copy(&self->base.matrix[4 * 3], pos);
  2122.                 pos[0] += sinf(-self->fCurrentRotation) * 5.0f;
  2123.                 pos[1] += cosf(-self->fCurrentRotation) * 5.0f;
  2124.                 pos[2] += 0.5f;
  2125.                 cheat_vehicle_teleport(info, pos, gta_interior_id_get());
  2126.  
  2127.                 matrix_identity(info->base.matrix);
  2128.                 vect3_copy(pos, &info->base.matrix[4 * 3]);
  2129.                 vect3_mult(info->speed, 0.0f, info->speed);
  2130.                 info->speed[2] = 0.05f;
  2131.                 vect3_mult(info->spin, 0.0f, info->spin);
  2132.             }
  2133.             else
  2134.             {
  2135.                 vect3_copy(&info->base.matrix[4 * 3], pos);
  2136.                 pos[2] += 1.5f;
  2137.                 cheat_teleport(pos, info->base.interior_id);
  2138.             }
  2139.         }
  2140.         else
  2141.         {
  2142.             if (self == NULL)
  2143.             {
  2144.                 cheat_state_text("You are dead.");
  2145.             }
  2146.             else
  2147.             {
  2148.                 if (vehicle_info_get(item->id, 0) == NULL)
  2149.                     cheat_state_text("Vehicle not found.");
  2150.                 else if (vehicle_info_get(item->id, VEHICLE_ALIVE) == NULL)
  2151.                     cheat_state_text("Vehicle is destroyed.");
  2152.             }
  2153.         }
  2154.  
  2155.         return 1;
  2156.     }
  2157.  
  2158.     return 0;
  2159. }
  2160.  
  2161. static int menu_callback_misc(int op, struct menu_item* item)
  2162. {
  2163.     int mod;
  2164.  
  2165.     if (op == MENU_OP_ENABLED)
  2166.     {
  2167.         switch (item->id)
  2168.         {
  2169.         case ID_MISC_HUDTEXT:
  2170.             return set.d3dtext_hud;
  2171.  
  2172.         case ID_MISC_BAD_WEAPONS:
  2173.             return cheat_state->_generic.weapon_disable;
  2174.  
  2175.         case ID_MISC_TRAILERS:
  2176.             return set.trailer_support;
  2177.  
  2178.         case ID_MISC_FPSLIMIT:
  2179.             return 0;
  2180.  
  2181.         case ID_MISC_TOGGLEWINDOWED:
  2182.             return set.window_mode;
  2183.         }
  2184.     }
  2185.     else if (op == MENU_OP_SELECT)
  2186.     {
  2187.         switch (item->id)
  2188.         {
  2189.         case ID_MISC_COORDS:
  2190.         {
  2191.             float* pos =
  2192.                 (cheat_state->state == CHEAT_STATE_VEHICLE)
  2193.                 ? cheat_state->vehicle.coords : cheat_state->actor.coords;
  2194.             Log("static_teleport_name[] = \"\"");
  2195.             Log("static_teleport_pos[] = %.2f %.2f %.2f   %d", pos[0], pos[1], pos[2], gta_interior_id_get());
  2196.             cheat_state_text("Current coordinates written to log file.");
  2197.         }
  2198.         break;
  2199.  
  2200.         case ID_MISC_RELOAD:
  2201.             ini_reload();
  2202.             break;
  2203.  
  2204.         case ID_MISC_HUDTEXT:
  2205.             set.d3dtext_hud ^= 1;
  2206.             break;
  2207.  
  2208.         case ID_MISC_BAD_WEAPONS:
  2209.             cheat_state->_generic.weapon_disable ^= 1;
  2210.             break;
  2211.  
  2212.         case ID_MISC_TRAILERS:
  2213.             set.trailer_support ^= 1;
  2214.             break;
  2215.  
  2216.         case ID_MISC_TOGGLEWINDOWED:
  2217.             toggleWindowedMode();
  2218.             break;
  2219.  
  2220.         default:
  2221.             return 0;
  2222.         }
  2223.  
  2224.         return 1;
  2225.     }
  2226.     else if (op == MENU_OP_DEC || MENU_OP_INC)
  2227.     {
  2228.         mod = (op == MENU_OP_DEC) ? -1 : 1;
  2229.         if (item->id == ID_MISC_FPSLIMIT)
  2230.         {
  2231.             set.fps_limit += (int)mod;
  2232.             menu_item_name_set(item, "FPS Limit: %d", set.fps_limit);
  2233.         }
  2234.     }
  2235.  
  2236.     return 0;
  2237. }
  2238.  
  2239. #ifdef __CHEAT_VEHRECORDING_H__
  2240. static int menu_callback_routes_drop(int op, struct menu_item* item)
  2241. {
  2242.     if (op == MENU_OP_SELECT)
  2243.     {
  2244.         if (item->id == ID_NONE)
  2245.             return 1;
  2246.  
  2247.         // > 9, because "Delete '.'"
  2248.         if (item->name != NULL && strlen(item->name) > 9)
  2249.         {
  2250.             // Remove "Delete '%s'"
  2251.             char tableName[64];
  2252.             _snprintf_s(tableName, sizeof(tableName) - 1, "%s", (item->name + 8));
  2253.             tableName[(strlen(item->name) - 9)] = NULL; // remove the last '
  2254.             rec_sqlite_dropTable(tableName);
  2255.  
  2256.             // reload menu
  2257.             if (item->menu != NULL)
  2258.                 menu_routes_drop_populate(item->menu);
  2259.             return 1;
  2260.         }
  2261.     }
  2262.     return 0;
  2263. }
  2264.  
  2265. static int menu_callback_routes_load(int op, struct menu_item* item)
  2266. {
  2267.     if (op == MENU_OP_SELECT)
  2268.     {
  2269.         if (item->id == ID_NONE)
  2270.             return 1;
  2271.  
  2272.         if (item->name != NULL && strlen(item->name) > 0)
  2273.         {
  2274.             rec_sqlite_loadTable((char*)item->name);
  2275.             return 1;
  2276.         }
  2277.     }
  2278.     return 0;
  2279. }
  2280.  
  2281. static int menu_callback_routes(int op, struct menu_item* item)
  2282. {
  2283.     if (op == MENU_OP_ENABLED)
  2284.     {
  2285.         if (item->id == ID_ROUTES_ACTIVATED)
  2286.             return set.recording_activated;
  2287.         return 0;
  2288.     }
  2289.     if (op == MENU_OP_SELECT)
  2290.     {
  2291.         switch (item->id)
  2292.         {
  2293.         case ID_ROUTES_ACTIVATED:
  2294.             set.recording_activated ^= 1;
  2295.             break;
  2296.         case ID_ROUTES_WRITE:
  2297.             rec_sqlite_writeTable();
  2298.             break;
  2299.         case ID_ROUTES_OPTIMIZE:
  2300.             rec_sqlite_optimizeDatabase();
  2301.             break;
  2302.         default:
  2303.             return 0;
  2304.         }
  2305.         return 1;
  2306.     }
  2307.     return 0;
  2308. }
  2309. #endif
  2310.  
  2311. static int menu_callback_sampmisc(int op, struct menu_item* item)
  2312. {
  2313.     if (g_SAMP == NULL)
  2314.         return 0;
  2315.  
  2316.     int mod;
  2317.  
  2318.     switch (op)
  2319.     {
  2320.     case MENU_OP_ENABLED:
  2321.     {
  2322.         switch (item->id)
  2323.         {
  2324.         case ID_MENU_SAMPMISC_FAKE_KILL:
  2325.             return 0;
  2326.  
  2327.         case ID_MENU_SAMPMISC_SPOOF_WEAPON:
  2328.             return cheat_state->_generic.spoof_weapon == (int)(UINT_PTR)item->data;
  2329.  
  2330.         case ID_MENU_SAMPMISC_SAMP_INFO_LIST:
  2331.             return cheat_state->player_info_list;
  2332.  
  2333.         case ID_MENU_SAMPMISC_CHAT_TEXT:
  2334.             return (g_Chat == NULL) ? 0 : !g_Chat->iChatWindowMode;
  2335.  
  2336.         case ID_MENU_SAMPMISC_CHAT_TEXTLINES:
  2337.             return 0;
  2338.  
  2339.         case ID_MENU_SAMPMISC_SAMP_DRUNK:
  2340.             return (g_Players != NULL && g_Players->pLocalPlayer != NULL &&
  2341.                 g_Players->pLocalPlayer->pSAMP_Actor != NULL &&
  2342.                 g_Players->pLocalPlayer->pSAMP_Actor->drunkLevel > 2300) ? 1 : 0;
  2343.  
  2344.         case ID_MENU_SAMPMISC_RENDEROBJTXT:
  2345.             return cheat_state->_generic.objecttexts;
  2346.  
  2347.         case ID_MENU_SAMPMISC_RENDERPCKTXT:
  2348.             return cheat_state->_generic.pickuptexts;
  2349.  
  2350.         case ID_MENU_SAMPMISC_M0DCOMMANDS:
  2351.             return g_m0dCommands;
  2352.  
  2353.         case ID_MENU_SAMPMISC_EXTRAGM:
  2354.             return set.enable_extra_godmode;
  2355.         }
  2356.     }
  2357.  
  2358.     case MENU_OP_SELECT:
  2359.     {
  2360.         switch (item->id)
  2361.         {
  2362.         case ID_MENU_SAMPMISC_SAMP_INFO_LIST:
  2363.             cheat_state->player_info_list ^= 1;
  2364.             break;
  2365.  
  2366.         case ID_MENU_SAMPMISC_CHAT_TEXT:
  2367.             if (g_Chat != NULL)
  2368.                 g_Chat->iChatWindowMode ^= 1;
  2369.             break;
  2370.  
  2371.         case ID_MENU_SAMPMISC_SAMP_DRUNK:
  2372.             if (g_Players != NULL && g_Players->pLocalPlayer != NULL &&
  2373.                 g_Players->pLocalPlayer->pSAMP_Actor != NULL)
  2374.             {
  2375.                 if (g_Players->pLocalPlayer->pSAMP_Actor->drunkLevel > 0)
  2376.                     g_Players->pLocalPlayer->pSAMP_Actor->drunkLevel = 0;
  2377.                 else
  2378.                     g_Players->pLocalPlayer->pSAMP_Actor->drunkLevel = 30000 + (rand() % 2000);
  2379.             }
  2380.             break;
  2381.  
  2382.         case ID_MENU_SAMPMISC_SPOOF_WEAPON:
  2383.             if (cheat_state->_generic.spoof_weapon == (int)(UINT_PTR)item->data)
  2384.                 cheat_state->_generic.spoof_weapon = -1;
  2385.             else
  2386.                 cheat_state->_generic.spoof_weapon = (int)(UINT_PTR)item->data;
  2387.             break;
  2388.  
  2389.         case ID_MENU_SAMPMISC_FAKE_KILL:
  2390.         {
  2391.             struct actor_info* info = getGTAPedFromSAMPPlayerID((int)(UINT_PTR)item->data);
  2392.             struct actor_info* self = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);
  2393.             const char* errmsg = NULL;
  2394.  
  2395.             if (g_Players == NULL)
  2396.                 return 0;
  2397.             if (g_Players->pRemotePlayer[(int)(UINT_PTR)item->data] == NULL)
  2398.                 return 0;
  2399.  
  2400.             if (info == NULL)
  2401.                 errmsg = "Player does not exist.";
  2402.             else if (ACTOR_IS_DEAD(info))
  2403.                 errmsg = "The player is dead.";
  2404.             if (self == NULL)
  2405.                 errmsg = "You are dead.";
  2406.             if (g_iSpectateEnabled == 1)
  2407.                 errmsg = "You are spectating";
  2408.  
  2409.             if (errmsg == NULL)
  2410.             {
  2411.                 if (cheat_state->_generic.spoof_weapon == -1)
  2412.                 {
  2413.                     self->weapon_hit_type = info->weapon[info->weapon_slot].id;
  2414.                 }
  2415.                 else
  2416.                 {
  2417.                     self->weapon_hit_type = cheat_state->_generic.spoof_weapon;
  2418.                 }
  2419.                 self->weapon_hit_by = info;
  2420.                 // self->hitpoints = 0.0f;
  2421.                 sendDeath();
  2422.             }
  2423.             else
  2424.             {
  2425.                 addMessageToChatWindow(errmsg);
  2426.             }
  2427.         }
  2428.         break;
  2429.  
  2430.         case ID_MENU_SAMPMISC_RENDEROBJTXT:
  2431.             cheat_state->_generic.objecttexts ^= 1;
  2432.             break;
  2433.  
  2434.         case ID_MENU_SAMPMISC_RENDERPCKTXT:
  2435.             cheat_state->_generic.pickuptexts ^= 1;
  2436.             break;
  2437.  
  2438.         case ID_MENU_SAMPMISC_M0DCOMMANDS:
  2439.             initChatCmds();
  2440.             break;
  2441.  
  2442.         case ID_MENU_SAMPMISC_EXTRAGM:
  2443.             set.enable_extra_godmode ^= 1;
  2444.             break;
  2445.         }
  2446.     }
  2447.  
  2448.     case MENU_OP_DEC:
  2449.     case MENU_OP_INC:
  2450.         mod = (op == MENU_OP_DEC) ? -1 : 1;
  2451.         switch (item->id)
  2452.         {
  2453.         case ID_MENU_SAMPMISC_CHAT_TEXTLINES:
  2454.             set.d3dtext_chat_lines += mod;
  2455.             menu_item_name_set(item, "Display chat lines: %d", set.d3dtext_chat_lines);
  2456.             break;
  2457.         }
  2458.         break;
  2459.     }
  2460.  
  2461.     /*
  2462.     return 1;
  2463. }*/
  2464.     return 0;
  2465. }
  2466.  
  2467. static int menu_callback_players(int op, struct menu_item* item)
  2468. {
  2469.     if (op == MENU_OP_ENABLED)
  2470.     {
  2471.         if (item->id == ID_MENU_PLAYERS_MUTE)
  2472.             return set.anti_spam;
  2473.     }
  2474.     else if (op == MENU_OP_SELECT)
  2475.     {
  2476.         if (item->id == ID_MENU_PLAYERS_MUTE)
  2477.         {
  2478.             set.anti_spam ^= 1;
  2479.             // don't open submenu via select button
  2480.             return 1;
  2481.         }
  2482.     }
  2483.     return 0;
  2484. }
  2485.  
  2486. static int menu_callback_players_warp(int op, struct menu_item* item)
  2487. {
  2488.     if (op == MENU_OP_SELECT)
  2489.     {
  2490.         struct actor_info* actor = NULL;
  2491.         int                 id = item->id;
  2492.         float               pos[3];
  2493.  
  2494.         if (g_Players == NULL)
  2495.             return 0;
  2496.  
  2497.         if (id == ID_NONE)
  2498.             return 0;
  2499.  
  2500.         if (g_Players->iIsListed[id] != 1)
  2501.         {
  2502.             addMessageToChatWindow("Player does not exist.");
  2503.             return 0;
  2504.         }
  2505.  
  2506.         if (g_Players->pRemotePlayer[id]->pPlayerData == NULL
  2507.             || g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Actor == NULL)
  2508.         {
  2509.             if (vect3_near_zero(g_stStreamedOutInfo.fPlayerPos[id]))
  2510.             {
  2511.                 addMessageToChatWindow("Player is not streamed in.");
  2512.                 return 0;
  2513.             }
  2514.  
  2515.             g_stStreamedOutInfo.fPlayerPos[id][1] += 1.0f;
  2516.             cheat_teleport(g_stStreamedOutInfo.fPlayerPos[id], 0);
  2517.             return 0;
  2518.         }
  2519.  
  2520.         if (!getPlayerPos(id, pos))
  2521.         {
  2522.             addMessageToChatWindow("Bad player info.");
  2523.             return 0;
  2524.         }
  2525.  
  2526.         if (g_Players->pRemotePlayer[id]->pPlayerData != NULL
  2527.             && g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Actor != NULL)
  2528.             actor = g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Actor->pGTA_Ped;
  2529.  
  2530.         if (actor != NULL && ACTOR_IS_DEAD(actor))
  2531.         {
  2532.             addMessageToChatWindow("Player is dead.");
  2533.             return 0;
  2534.         }
  2535.  
  2536.         pos[1] += 1.0f;
  2537.         cheat_teleport(pos, actor->base.interior_id);
  2538.  
  2539.         return 1;
  2540.     }
  2541.  
  2542.     return 0;
  2543. }
  2544.  
  2545. static int menu_callback_players_vehwarp(int op, struct menu_item* item)
  2546. {
  2547.     if (op == MENU_OP_SELECT)
  2548.     {
  2549.         struct actor_info* actor = NULL;
  2550.         int                 id = item->id;
  2551.  
  2552.         // safety checking
  2553.         if (g_Players == NULL)
  2554.             return 0;
  2555.         if (id == ID_NONE)
  2556.             return 0;
  2557.  
  2558.         if (g_Players->pRemotePlayer[id]->pPlayerData != NULL
  2559.             && g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Actor != NULL)
  2560.             actor = g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Actor->pGTA_Ped;
  2561.         if (actor == NULL)
  2562.             return 0;
  2563.         if (actor->vehicle == NULL)
  2564.             return 0;
  2565.  
  2566.         if (g_Players->iIsListed[id] != 1)
  2567.         {
  2568.             addMessageToChatWindow("Player does not exist.");
  2569.             return 0;
  2570.         }
  2571.  
  2572.         if (g_Players->pRemotePlayer[id]->pPlayerData == NULL
  2573.             || g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Actor == NULL)
  2574.         {
  2575.             addMessageToChatWindow("Player is not streamed in.");
  2576.             return 0;
  2577.         }
  2578.  
  2579.         if (actor->vehicle->hitpoints == 0.0f)
  2580.         {
  2581.             addMessageToChatWindow("Vehicle is destroyed");
  2582.             return 0;
  2583.         }
  2584.  
  2585.         if (cheat_state->actor.air_brake)
  2586.         {
  2587.             addMessageToChatWindow("On foot airbrake must be disabled");
  2588.             return 0;
  2589.         }
  2590.  
  2591.         // if they are in a vehicle, let's GOOOO
  2592.         if (g_Players->pRemotePlayer[id]->pPlayerData->bytePlayerState == PLAYER_STATE_DRIVER
  2593.             || g_Players->pRemotePlayer[id]->pPlayerData->bytePlayerState == PLAYER_STATE_PASSENGER)
  2594.         {
  2595.             //need car id in memory for vehicleJumper
  2596.             if (g_Players->pRemotePlayer[id] != NULL
  2597.                 && g_Players->pRemotePlayer[id]->pPlayerData != NULL
  2598.                 && g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Vehicle != NULL
  2599.                 && g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Vehicle->pGTA_Vehicle != NULL)
  2600.             {
  2601.                 vehicleJumper((int)(((DWORD)g_Players->pRemotePlayer[id]->pPlayerData->pSAMP_Vehicle->pGTA_Vehicle) -
  2602.                     (DWORD)pool_vehicle->start) / 2584);
  2603.             }
  2604.         }
  2605.         else
  2606.         {
  2607.             addMessageToChatWindow("The player is not in a vehicle");
  2608.             return 0;
  2609.         }
  2610.  
  2611.         return 1;
  2612.     }
  2613.  
  2614.     return 0;
  2615. }
  2616.  
  2617. static int menu_callback_vehicles_instant(int op, struct menu_item* item)
  2618. {
  2619.     if (op == MENU_OP_SELECT)
  2620.     {
  2621.         int id = item->id;
  2622.  
  2623.         if (g_Vehicles == NULL)
  2624.             return 0;
  2625.  
  2626.         if (id == ID_NONE)
  2627.             return 0;
  2628.  
  2629.         if (g_Vehicles->iIsListed[id] != 1)
  2630.         {
  2631.             addMessageToChatWindow("Vehicle does not exist.");
  2632.             return 0;
  2633.         }
  2634.  
  2635.         if (g_Vehicles->pGTA_Vehicle[id] == NULL)
  2636.         {
  2637.             addMessageToChatWindow("Vehicle is unstreamed");
  2638.             return 0;
  2639.         }
  2640.  
  2641.         if (g_Vehicles->pGTA_Vehicle[id]->hitpoints == 0.0f)
  2642.         {
  2643.             addMessageToChatWindow("Vehicle is destroyed");
  2644.             return 0;
  2645.         }
  2646.  
  2647.         if (cheat_state->actor.stick)
  2648.         {
  2649.             addMessageToChatWindow("On foot stick must be disabled");
  2650.             return 0;
  2651.         }
  2652.  
  2653.         if (cheat_state->actor.air_brake)
  2654.         {
  2655.             addMessageToChatWindow("On foot airbrake must be disabled");
  2656.             return 0;
  2657.         }
  2658.  
  2659.         int jump_id = (int)(((DWORD)g_Vehicles->pGTA_Vehicle[id]) - (DWORD)pool_vehicle->start) / 2584;
  2660.         vehicleJumper(jump_id);
  2661.  
  2662.         return 1;
  2663.     }
  2664.  
  2665.     return 0;
  2666. }
  2667.  
  2668. static int menu_callback_teleports(int op, struct menu_item* item)
  2669. {
  2670.     if (op == MENU_OP_SELECT)
  2671.     {
  2672.         cheat_teleport_history_save();
  2673.         cheat_state_text("Teleported to: %s.", set.static_teleport_name[item->id]);
  2674.         cheat_teleport(set.static_teleport[item->id].pos, set.static_teleport[item->id].interior_id);
  2675.         return 1;
  2676.     }
  2677.  
  2678.     return 0;
  2679. }
  2680.  
  2681. static int menu_callback_interiors(int op, struct menu_item* item)
  2682. {
  2683.     if (op == MENU_OP_SELECT)
  2684.     {
  2685.         if (g_SAMP != NULL)
  2686.         {
  2687.             sampPatchDisableInteriorUpdate(1);
  2688.             sendSetInterior(interiors_list[item->id].interior_id);
  2689.         }
  2690.  
  2691.         cheat_state_text("Teleported to: %s.", interiors_list[item->id].interior_name);
  2692.         cheat_teleport(interiors_list[item->id].pos, interiors_list[item->id].interior_id);
  2693.         if (g_SAMP != NULL)
  2694.             sampPatchDisableInteriorUpdate(0);
  2695.         return 1;
  2696.     }
  2697.  
  2698.     return 0;
  2699. }
  2700.  
  2701. static int menu_callback_specialaction(int op, struct menu_item* item)
  2702. {
  2703.     if (g_Players->pLocalPlayer == NULL)
  2704.         return 0;
  2705.  
  2706.     int     id = item->id;
  2707.     uint8_t specialaction = g_Players->pLocalPlayer->onFootData.byteSpecialAction;
  2708.  
  2709.     if (op == MENU_OP_ENABLED)
  2710.     {
  2711.         switch (id)
  2712.         {
  2713.         case ID_MENU_SPECIAL_ACTION_NONE:
  2714.             if (specialaction == ID_MENU_SPECIAL_ACTION_NONE)
  2715.                 return 1;
  2716.             break;
  2717.  
  2718.         case ID_MENU_SPECIAL_ACTION_USEJETPACK:
  2719.             if (specialaction == ID_MENU_SPECIAL_ACTION_USEJETPACK)
  2720.                 return 1;
  2721.             break;
  2722.  
  2723.         case ID_MENU_SPECIAL_ACTION_DANCE1:
  2724.             if (specialaction == ID_MENU_SPECIAL_ACTION_DANCE1)
  2725.                 return 1;
  2726.             break;
  2727.  
  2728.         case ID_MENU_SPECIAL_ACTION_DANCE2:
  2729.             if (specialaction == ID_MENU_SPECIAL_ACTION_DANCE2)
  2730.                 return 1;
  2731.             break;
  2732.  
  2733.         case ID_MENU_SPECIAL_ACTION_DANCE3:
  2734.             if (specialaction == ID_MENU_SPECIAL_ACTION_DANCE3)
  2735.                 return 1;
  2736.             break;
  2737.  
  2738.         case ID_MENU_SPECIAL_ACTION_DANCE4:
  2739.             if (specialaction == ID_MENU_SPECIAL_ACTION_DANCE4)
  2740.                 return 1;
  2741.             break;
  2742.  
  2743.         case ID_MENU_SPECIAL_ACTION_HANDSUP:
  2744.             if (specialaction == ID_MENU_SPECIAL_ACTION_HANDSUP)
  2745.                 return 1;
  2746.             break;
  2747.  
  2748.         case ID_MENU_SPECIAL_ACTION_USECELLPHONE:
  2749.             if (specialaction == ID_MENU_SPECIAL_ACTION_USECELLPHONE)
  2750.                 return 1;
  2751.             break;
  2752.  
  2753.         case ID_MENU_SPECIAL_ACTION_STOPUSECELLPHONE:
  2754.             if (specialaction == ID_MENU_SPECIAL_ACTION_STOPUSECELLPHONE)
  2755.                 return 1;
  2756.             break;
  2757.  
  2758.         case ID_MENU_SPECIAL_ACTION_DRINK_BEER:
  2759.             if (specialaction == ID_MENU_SPECIAL_ACTION_DRINK_BEER)
  2760.                 return 1;
  2761.             break;
  2762.  
  2763.         case ID_MENU_SPECIAL_ACTION_SMOKE_CIGGY:
  2764.             if (specialaction == ID_MENU_SPECIAL_ACTION_SMOKE_CIGGY)
  2765.                 return 1;
  2766.             break;
  2767.  
  2768.         case ID_MENU_SPECIAL_ACTION_DRINK_WINE:
  2769.             if (specialaction == ID_MENU_SPECIAL_ACTION_DRINK_WINE)
  2770.                 return 1;
  2771.             break;
  2772.  
  2773.         case ID_MENU_SPECIAL_ACTION_DRINK_SPRUNK:
  2774.             if (specialaction == ID_MENU_SPECIAL_ACTION_DRINK_SPRUNK)
  2775.                 return 1;
  2776.             break;
  2777.  
  2778.         case ID_MENU_SPECIAL_ACTION_CUFFED:
  2779.             if (specialaction == ID_MENU_SPECIAL_ACTION_CUFFED)
  2780.                 return 1;
  2781.             break;
  2782.  
  2783.         case ID_MENU_SPECIAL_ACTION_CARRY:
  2784.             if (specialaction == ID_MENU_SPECIAL_ACTION_CARRY)
  2785.                 return 1;
  2786.             break;
  2787.  
  2788.         case ID_MENU_SPECIAL_ACTION_URINATE:
  2789.             if (specialaction == ID_MENU_SPECIAL_ACTION_URINATE)
  2790.                 return 1;
  2791.             break;
  2792.         }
  2793.  
  2794.         return 0;
  2795.     }
  2796.  
  2797.     if (op == MENU_OP_SELECT)
  2798.     {
  2799.         setSpecialAction(id);
  2800.         return 1;
  2801.     }
  2802.  
  2803.     return 0;
  2804. }
  2805.  
  2806. static int menu_callback_debug(int op, struct menu_item* item)
  2807. {
  2808.     if (op == MENU_OP_ENABLED)
  2809.     {
  2810.         if (item->id == ID_DEBUG_ENABLE)
  2811.             return cheat_state->debug_enabled;
  2812.         return 0;
  2813.     }
  2814.  
  2815.     if (op == MENU_OP_SELECT)
  2816.     {
  2817.         switch (item->id)
  2818.         {
  2819.         case ID_DEBUG_ENABLE:
  2820.             cheat_state->debug_enabled ^= 1;
  2821.             break;
  2822.  
  2823.         case ID_DEBUG_SELF_ACTOR:
  2824.             setDebugPointer((void*)actor_info_get(ACTOR_SELF, 0));
  2825.             break;
  2826.  
  2827.         case ID_DEBUG_SELF_VEHICLE:
  2828.             setDebugPointer((void*)vehicle_info_get(VEHICLE_SELF, 0));
  2829.             break;
  2830.  
  2831.         case ID_DEBUG_SAMP_DLL:
  2832.             setDebugPointer((void*)g_dwSAMP_Addr);
  2833.             break;
  2834.  
  2835.         case ID_DEBUG_SAMP_INFO:
  2836.             setDebugPointer((void*)g_SAMP);
  2837.             break;
  2838.  
  2839.         case ID_DEBUG_SAMP_PLAYER_LIST:
  2840.             setDebugPointer((void*)g_Players);
  2841.             break;
  2842.  
  2843.         case ID_DEBUG_SAMP_LOCAL_INFO:
  2844.             setDebugPointer((void*)g_Players->pLocalPlayer);
  2845.             break;
  2846.  
  2847.         case ID_DEBUG_SAMP_CHAT_INFO:
  2848.             setDebugPointer((void*)g_Chat);
  2849.             break;
  2850.  
  2851.         case ID_DEBUG_SAMP_CHAT_IPT_INFO:
  2852.             setDebugPointer((void*)g_Input);
  2853.             break;
  2854.  
  2855.         case ID_DEBUG_SAMP_KILL_INFO:
  2856.             setDebugPointer((void*)g_DeathList);
  2857.             break;
  2858.  
  2859.         case ID_DEBUG_SAMP_VEHICLE_LIST:
  2860.             setDebugPointer((void*)g_Vehicles);
  2861.             break;
  2862.  
  2863.         case ID_DEBUG_SAMP_LOCAL_SAMPPED:
  2864.             setDebugPointer((void*)g_Players->pLocalPlayer->pSAMP_Actor);
  2865.             break;
  2866.  
  2867.         default:
  2868.             return 0;
  2869.         }
  2870.  
  2871.         return 1;
  2872.     }
  2873.  
  2874.     return 0;
  2875. }
  2876.  
  2877. static int menu_callback_hudindicators(int op, struct menu_item* item)
  2878. {
  2879.     if (op == MENU_OP_ENABLED)
  2880.     {
  2881.         switch (item->id)
  2882.         {
  2883.         case ID_HUDIND_BAR:
  2884.             return set.hud_draw_bar;
  2885.  
  2886.         case ID_HUDIND_TSHADOWS:
  2887.             return set.render_text_shadows;
  2888.  
  2889.         case ID_HUDIND_INV:
  2890.             return set.hud_indicator_inv;
  2891.  
  2892.         case ID_HUDIND_WEAPON:
  2893.             return set.hud_indicator_weapon;
  2894.  
  2895.         case ID_HUDIND_MONEY:
  2896.             return set.hud_indicator_money;
  2897.  
  2898.         case ID_HUDIND_FREEZE:
  2899.             return set.hud_indicator_freeze;
  2900.  
  2901.         case ID_HUDIND_INVEH_AIRBRK:
  2902.             return set.hud_indicator_inveh_airbrk;
  2903.  
  2904.         case ID_HUDIND_INVEH_STICK:
  2905.             return set.hud_indicator_inveh_stick;
  2906.  
  2907.         case ID_HUDIND_INVEH_BRKDANCE:
  2908.             return set.hud_indicator_inveh_brkdance;
  2909.  
  2910.         case ID_HUDIND_INVEH_SPIDER:
  2911.             return set.hud_indicator_inveh_spider;
  2912.  
  2913.         case ID_HUDIND_ONFOOT_FLY:
  2914.             return set.hud_indicator_onfoot_fly;
  2915.  
  2916.         case ID_HUDIND_INVEH_FLY:
  2917.             return set.hud_indicator_inveh_fly;
  2918.  
  2919.         case ID_HUDIND_ONFOOT_AIRBRK:
  2920.             return set.hud_indicator_onfoot_airbrk;
  2921.  
  2922.         case ID_HUDIND_ONFOOT_STICK:
  2923.             return set.hud_indicator_onfoot_stick;
  2924.  
  2925.         case ID_HUDIND_ONFOOT_AIM:
  2926.             return set.hud_indicator_onfoot_aim;
  2927.  
  2928.         case ID_HUDIND_POS:
  2929.             return set.hud_indicator_pos;
  2930.  
  2931.         case ID_HUDIND_FPS:
  2932.             return set.hud_fps_draw;
  2933.  
  2934.         case ID_HUDIND_LB_BARS:
  2935.             return set.left_bottom_bars_enable;
  2936.  
  2937.         case ID_HUDIND_SURF:
  2938.             return set.hud_indicator_surf;
  2939.  
  2940.         case ID_HUDIND_FREEZEROT:
  2941.             return set.hud_indicator_freezerot;
  2942.         }
  2943.  
  2944.         return 0;
  2945.     }
  2946.  
  2947.     if (op == MENU_OP_SELECT)
  2948.     {
  2949.         switch (item->id)
  2950.         {
  2951.         case ID_HUDIND_BAR:
  2952.             set.hud_draw_bar ^= 1;
  2953.             break;
  2954.  
  2955.         case ID_HUDIND_TSHADOWS:
  2956.             set.render_text_shadows ^= 1;
  2957.             break;
  2958.  
  2959.         case ID_HUDIND_INV:
  2960.             set.hud_indicator_inv ^= 1;
  2961.             break;
  2962.  
  2963.         case ID_HUDIND_WEAPON:
  2964.             set.hud_indicator_weapon ^= 1;
  2965.             break;
  2966.  
  2967.         case ID_HUDIND_MONEY:
  2968.             set.hud_indicator_money ^= 1;
  2969.             break;
  2970.  
  2971.         case ID_HUDIND_FREEZE:
  2972.             set.hud_indicator_freeze ^= 1;
  2973.             break;
  2974.  
  2975.         case ID_HUDIND_INVEH_AIRBRK:
  2976.             set.hud_indicator_inveh_airbrk ^= 1;
  2977.             break;
  2978.  
  2979.         case ID_HUDIND_INVEH_STICK:
  2980.             set.hud_indicator_inveh_stick ^= 1;
  2981.             break;
  2982.  
  2983.         case ID_HUDIND_INVEH_BRKDANCE:
  2984.             set.hud_indicator_inveh_brkdance ^= 1;
  2985.             break;
  2986.  
  2987.         case ID_HUDIND_INVEH_SPIDER:
  2988.             set.hud_indicator_inveh_spider ^= 1;
  2989.             break;
  2990.  
  2991.         case ID_HUDIND_ONFOOT_FLY:
  2992.             set.hud_indicator_onfoot_fly ^= 1;
  2993.             break;
  2994.  
  2995.         case ID_HUDIND_INVEH_FLY:
  2996.             set.hud_indicator_inveh_fly ^= 1;
  2997.             break;
  2998.  
  2999.         case ID_HUDIND_ONFOOT_AIRBRK:
  3000.             set.hud_indicator_onfoot_airbrk ^= 1;
  3001.             break;
  3002.  
  3003.         case ID_HUDIND_ONFOOT_STICK:
  3004.             set.hud_indicator_onfoot_stick ^= 1;
  3005.             break;
  3006.  
  3007.         case ID_HUDIND_ONFOOT_AIM:
  3008.             set.hud_indicator_onfoot_aim ^= 1;
  3009.             break;
  3010.  
  3011.         case ID_HUDIND_POS:
  3012.             set.hud_indicator_pos ^= 1;
  3013.             break;
  3014.  
  3015.         case ID_HUDIND_FPS:
  3016.             set.hud_fps_draw ^= 1;
  3017.             break;
  3018.  
  3019.         case ID_HUDIND_LB_BARS:
  3020.             set.left_bottom_bars_enable ^= 1;
  3021.             break;
  3022.  
  3023.         case ID_HUDIND_SURF:
  3024.             set.hud_indicator_surf ^= 1;
  3025.             break;
  3026.  
  3027.         case ID_HUDIND_FREEZEROT:
  3028.             set.hud_indicator_freezerot ^= 1;
  3029.             break;
  3030.  
  3031.         default:
  3032.             return 0;
  3033.         }
  3034.  
  3035.         return 1;
  3036.     }
  3037.  
  3038.     return 0;
  3039. }
  3040.  
  3041. static int menu_callback_spec(int op, struct menu_item* item)
  3042. {
  3043.     struct actor_info* self = actor_info_get(ACTOR_SELF, ACTOR_ALIVE);
  3044.     if (g_Players == NULL)
  3045.         return 0;
  3046.     if (self == NULL)
  3047.         return 0;
  3048.  
  3049.     if (op == MENU_OP_SELECT)
  3050.     {
  3051.         int id = item->id;
  3052.         if (self == NULL)
  3053.         {
  3054.             addMessageToChatWindow("You are dead.");
  3055.             return 1;
  3056.         }
  3057.         if (id == -1)
  3058.         {
  3059.             spectatePlayer(id);
  3060.             return 1;
  3061.         }
  3062.  
  3063.         if (g_Players->pRemotePlayer[id] == NULL)
  3064.         {
  3065.             addMessageToChatWindow("Player doesn't exist.");
  3066.             return 1;
  3067.         }
  3068.  
  3069.         if (g_Players->pRemotePlayer[id]->pPlayerData->bytePlayerState == PLAYER_STATE_WASTED
  3070.             || (g_Players->pRemotePlayer[id]->pPlayerData->bytePlayerState == PLAYER_STATE_NONE))
  3071.         {
  3072.             addMessageToChatWindow("Could not spectate player");
  3073.             return 1;
  3074.         }
  3075.  
  3076.         spectatePlayer(id);
  3077.  
  3078.         return 1;
  3079.     }
  3080.  
  3081.     return 0;
  3082. }
  3083.  
  3084. //void  renderPlayerPoolStructure ( int iPlayerID );
  3085. int     iViewingInfoPlayer = -1;
  3086. static int menu_callback_playerinfo(int op, struct menu_item* item)
  3087. {
  3088.     if (g_Players == NULL)
  3089.         return 0;
  3090.  
  3091.     int id = item->id;
  3092.     if (op == MENU_OP_SELECT)
  3093.     {
  3094.         if (id == SAMP_MAX_PLAYERS + 1)
  3095.         {
  3096.             iViewingInfoPlayer = -1;
  3097.             return 1;
  3098.         }
  3099.  
  3100.         iViewingInfoPlayer = id;
  3101.  
  3102.         return 1;
  3103.     }
  3104.  
  3105.     return 0;
  3106. }
  3107.  
  3108. static int menu_callback_playermute(int op, struct menu_item* item)
  3109. {
  3110.     if (g_Players == NULL)
  3111.         return 0;
  3112.  
  3113.     int id = item->id;
  3114.     if (op == MENU_OP_ENABLED)
  3115.     {
  3116.         if (id < SAMP_MAX_PLAYERS && id >= 0)
  3117.             return g_bPlayerMuted[id];
  3118.         return 0;
  3119.     }
  3120.     else if (op == MENU_OP_SELECT)
  3121.     {
  3122.         if (id < SAMP_MAX_PLAYERS && id >= 0)
  3123.         {
  3124.             if (g_bPlayerMuted[id])
  3125.                 g_iNumPlayersMuted--;
  3126.             else
  3127.                 g_iNumPlayersMuted++;
  3128.  
  3129.             g_bPlayerMuted[id] ^= 1;
  3130.             return 1;
  3131.         }
  3132.  
  3133.         return 1;
  3134.     }
  3135.  
  3136.     return 0;
  3137. }
  3138.  
  3139. static int menu_callback_server_list(int op, struct menu_item* item)
  3140. {
  3141.     if (g_SAMP == NULL && g_Players == NULL)
  3142.         return 0;
  3143.  
  3144.     struct fav_server* server = &set.server[item->id];
  3145.  
  3146.     if (op == MENU_OP_ENABLED)
  3147.     {
  3148.         if (item->id == INI_SERVERS_MAX + 1)
  3149.             return set.use_current_name;
  3150.         return 0;
  3151.     }
  3152.     else if (op == MENU_OP_SELECT)
  3153.     {
  3154.         if (item->id == ID_NONE)
  3155.             return 1;
  3156.  
  3157.         if (item->id == INI_SERVERS_MAX + 1)
  3158.         {
  3159.             set.use_current_name ^= 1;
  3160.             return 1;
  3161.         }
  3162.         else
  3163.         {
  3164.             if (!set.use_current_name)
  3165.                 setLocalPlayerName(server->nickname);
  3166.             changeServer(server->ip, server->port, server->password);
  3167.         }
  3168.  
  3169.         return 1;
  3170.     }
  3171.  
  3172.     return 0;
  3173. }
  3174.  
  3175. static int menu_callback_gamestate(int op, struct menu_item* item)
  3176. {
  3177.     if (g_SAMP == NULL)
  3178.         return 0;
  3179.  
  3180.     if (op == MENU_OP_SELECT)
  3181.     {
  3182.         switch (item->id)
  3183.         {
  3184.         case GAMESTATE_CONNECTING:
  3185.             g_SAMP->iGameState = GAMESTATE_CONNECTING;
  3186.             break;
  3187.  
  3188.         case GAMESTATE_CONNECTED:
  3189.             g_SAMP->iGameState = GAMESTATE_CONNECTED;
  3190.             break;
  3191.  
  3192.         case GAMESTATE_AWAIT_JOIN:
  3193.             g_SAMP->iGameState = GAMESTATE_AWAIT_JOIN;
  3194.             break;
  3195.  
  3196.         case GAMESTATE_RESTARTING:
  3197.             g_SAMP->iGameState = GAMESTATE_RESTARTING;
  3198.             break;
  3199.  
  3200.         case GAMESTATE_WAIT_CONNECT:
  3201.             g_SAMP->iGameState = GAMESTATE_WAIT_CONNECT;
  3202.             break;
  3203.         }
  3204.  
  3205.         return 1;
  3206.     }
  3207.  
  3208.     if (op == MENU_OP_ENABLED)
  3209.     {
  3210.         switch (item->id)
  3211.         {
  3212.         case GAMESTATE_CONNECTING:
  3213.             return g_SAMP->iGameState == GAMESTATE_CONNECTING;
  3214.  
  3215.         case GAMESTATE_CONNECTED:
  3216.             return g_SAMP->iGameState == GAMESTATE_CONNECTED;
  3217.  
  3218.         case GAMESTATE_AWAIT_JOIN:
  3219.             return g_SAMP->iGameState == GAMESTATE_AWAIT_JOIN;
  3220.  
  3221.         case GAMESTATE_RESTARTING:
  3222.             return g_SAMP->iGameState == GAMESTATE_RESTARTING;
  3223.  
  3224.         case GAMESTATE_WAIT_CONNECT:
  3225.             return g_SAMP->iGameState == GAMESTATE_WAIT_CONNECT;
  3226.         }
  3227.     }
  3228.  
  3229.     return 0;
  3230. }
  3231.  
  3232. static int menu_callback_netpatches(int op, struct menu_item* item)
  3233. {
  3234.     if (g_SAMP == NULL)
  3235.         return 0;
  3236.  
  3237.     if (op == MENU_OP_SELECT)
  3238.     {
  3239.         if (item->id == ID_MENU_NETPATCHES_TOGGLE_ALL)
  3240.         {
  3241.             if (item->menu->count > 1)
  3242.             {
  3243.                 // hacky method to get patch type of this menu
  3244.                 NetPatchType type = set.netPatch[item->menu->item[1].id].type; // omg omg omg
  3245.  
  3246.                 // count enabled and disabled patches
  3247.                 int enabled = 0, disabled = 0;
  3248.                 for (int i = 0; i < iNetPatchesCount; ++i)
  3249.                 {
  3250.                     if (set.netPatch[i].type != type) continue;
  3251.                     if (set.netPatch[i].enabled) ++enabled;
  3252.                     else ++disabled;
  3253.                 }
  3254.  
  3255.                 for (int i = 0; i < iNetPatchesCount; ++i)
  3256.                 {
  3257.                     if (set.netPatch[i].type != type) continue;
  3258.                     set.netPatch[i].enabled = disabled > enabled ? true : false;
  3259.                 }
  3260.             }
  3261.         }
  3262.         else
  3263.         {
  3264.             set.netPatch[item->id].enabled ^= true;
  3265.         }
  3266.     }
  3267.     if (op == MENU_OP_ENABLED)
  3268.     {
  3269.         if (item->id != ID_MENU_NETPATCHES_TOGGLE_ALL)
  3270.         {
  3271.             return set.netPatch[item->id].enabled;
  3272.         }
  3273.     }
  3274.     return 0;
  3275. }
  3276.  
  3277.  
  3278.  
  3279.  
  3280. /////////////////////////////////////////////////////////////////////////////
  3281. ////////////////////////////// FUNCTIONS DONE ///////////////////////////////
  3282. /////////////////////////////////////////////////////////////////////////////
  3283. ///////////////////////////// START MENU LAYOUT /////////////////////////////
  3284. /////////////////////////////////////////////////////////////////////////////
  3285. void menu_maybe_init(void)
  3286. {
  3287.     traceLastFunc("menu_maybe_init()");
  3288.     if (menu_init)
  3289.         return;
  3290.  
  3291.     struct menu* menu_main, * menu_cheats, * menu_cheats_mods, * menu_cheats_inv, * menu_cheats_money, *
  3292.         menu_cheats_weather, * menu_cheats_time, * menu_weapons, * menu_vehicles, * menu_teleports, * menu_interiors, *
  3293.         menu_misc, * menu_debug, * menu_hudindicators, * menu_patches, * menu_players, * menu_servers, *
  3294.         menu_players_warp, * menu_players_vehwarp, * menu_players_spec,
  3295. #ifdef __CHEAT_VEHRECORDING_H__
  3296.         * menu_routes, * menu_routes_load, * menu_routes_drop,
  3297. #endif
  3298.  
  3299.         //*menu_cheats_handling,
  3300.         * menu_player_info, * menu_players_mute, * menu_sampmisc, * menu_spoof_weapon, * menu_fake_kill, * menu_vehicles_instant,
  3301.         * menu_gamestate, * menu_specialaction, * menu_teleobject, * menu_telepickup, * menu_samppatches,
  3302.         * menu_netpatches_inrpc, * menu_netpatches_outrpc, * menu_netpatches_inpacket, * menu_netpatches_outpacket;
  3303.  
  3304.     char        name[128];
  3305.     int         i, slot;
  3306.  
  3307.     menu_init = 1;
  3308.  
  3309.     /* main menu */
  3310.     menu_main = menu_new(NULL, ID_MENU_MAIN, menu_callback_main);
  3311.     menu_cheats = menu_new(menu_main, ID_MENU_CHEATS, menu_callback_cheats);
  3312.     menu_patches = menu_new(menu_main, ID_MENU_PATCHES, menu_callback_patches);
  3313.     menu_weapons = menu_new(menu_main, ID_MENU_WEAPONS, menu_callback_weapons);
  3314.     menu_vehicles = menu_new(menu_main, ID_MENU_VEHICLES, menu_callback_vehicles);
  3315.     menu_teleports = menu_new(menu_main, ID_MENU_TELEPORTS, menu_callback_teleports);
  3316.     menu_misc = menu_new(menu_main, ID_MENU_MISC, menu_callback_misc);
  3317.  
  3318.  
  3319.  
  3320.     /* main menu -> cheats */
  3321.     menu_cheats_inv = menu_new(menu_cheats, ID_MENU_CHEATS_INVULN, menu_callback_cheats_invuln);
  3322.     menu_cheats_money = menu_new(menu_cheats, ID_MENU_CHEATS_MONEY, menu_callback_cheats_money);
  3323.     menu_cheats_mods = menu_new(menu_cheats, ID_MENU_CHEATS_MODS, menu_callback_cheats_mods);
  3324.     menu_cheats_weather = menu_new(menu_cheats, ID_MENU_CHEATS_WEATHER, menu_callback_cheats);
  3325.     // disabled for now until we/mta rework CHandlingEntrySA
  3326.     //menu_cheats_handling = menu_new( menu_cheats, ID_MENU_CHEATS_HANDLING, menu_callback_handling );
  3327.     menu_cheats_time = menu_new(menu_cheats, ID_MENU_CHEATS_TIME, menu_callback_cheats);
  3328.  
  3329.     /* main menu -> teleports */
  3330.     menu_interiors = menu_new(menu_teleports, ID_MENU_INTERIORS, menu_callback_interiors);
  3331.  
  3332.     /* main menu -> misc */
  3333.     menu_debug = menu_new(menu_misc, ID_MENU_DEBUG, menu_callback_debug);
  3334.     menu_hudindicators = menu_new(menu_misc, ID_MENU_HUDINDICATORS, menu_callback_hudindicators);
  3335. #ifdef __CHEAT_VEHRECORDING_H__
  3336.     menu_routes = menu_new(menu_misc, ID_MENU_ROUTES, menu_callback_routes);
  3337.  
  3338.     /* main menu -> misc -> routes */
  3339.     menu_routes_load = menu_new(menu_routes, ID_MENU_ROUTES_LOAD, menu_callback_routes_load);
  3340.     menu_routes_drop = menu_new(menu_routes, ID_MENU_ROUTES_DROP, menu_callback_routes_drop);
  3341. #endif
  3342.  
  3343.     /* samp specific */
  3344.     if (g_dwSAMP_Addr != NULL)
  3345.     {
  3346.         // main menu
  3347.         menu_players = menu_new(menu_main, ID_MENU_PLAYERS, menu_callback_players);
  3348.  
  3349.         menu_servers = menu_new(menu_main, ID_MENU_SERVER_LIST, menu_callback_server_list);
  3350.         menu_sampmisc = menu_new(menu_main, ID_MENU_SAMPMISC, menu_callback_sampmisc);
  3351.         menu_samppatches = menu_new(menu_main, ID_MENU_SAMPPATCHES, menu_callback_samppatches);
  3352.         // main menu -> players
  3353.         menu_players_warp = menu_new(menu_players, ID_MENU_PLAYERS_WARP, menu_callback_players_warp);
  3354.         menu_players_vehwarp = menu_new(menu_players, ID_MENU_PLAYERS_VEHWARP, menu_callback_players_vehwarp);
  3355.         menu_players_spec = menu_new(menu_players, ID_MENU_PLAYERS_SPEC, menu_callback_spec);
  3356.         menu_player_info = menu_new(menu_players, ID_MENU_PLAYERS_INFO, menu_callback_playerinfo);
  3357.         menu_players_mute = menu_new(menu_players, ID_MENU_PLAYERS_MUTE, menu_callback_playermute);
  3358.         // main menu -> sampmisc
  3359.         menu_spoof_weapon = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_SPOOF_WEAPON, menu_callback_sampmisc);
  3360.         menu_fake_kill = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_FAKE_KILL, menu_callback_sampmisc);
  3361.         menu_vehicles_instant = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_VEHICLES_INSTANT, menu_callback_vehicles_instant);
  3362.         menu_gamestate = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_GAMESTATE, menu_callback_gamestate);
  3363.         menu_specialaction = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_SPECIALACTION, menu_callback_specialaction);
  3364.         menu_teleobject = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_TELEOBJECT, menu_callback_teleobject);
  3365.         menu_telepickup = menu_new(menu_sampmisc, ID_MENU_SAMPMISC_TELEPICKUP, menu_callback_telepickup);
  3366.         // main menu -> samp patches
  3367.         menu_netpatches_inrpc = menu_new(menu_samppatches, ID_MENU_NETPATCHES_INRPC, menu_callback_netpatches);
  3368.         menu_netpatches_outrpc = menu_new(menu_samppatches, ID_MENU_NETPATCHES_OUTRPC, menu_callback_netpatches);
  3369.         menu_netpatches_inpacket = menu_new(menu_samppatches, ID_MENU_NETPATCHES_INPACKET, menu_callback_netpatches);
  3370.         menu_netpatches_outpacket = menu_new(menu_samppatches, ID_MENU_NETPATCHES_OUTPACKET, menu_callback_netpatches);
  3371.     }
  3372.  
  3373.     /** Menu Items **/
  3374.     /* main menu */
  3375.  
  3376.     menu_item_add(menu_main, NULL, "\tOverLight v4", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3377.     struct menu* OverLight_CarFunctions_Menu;
  3378.     OverLight_CarFunctions_Menu = menu_new(menu_main, 0, OverLight_CarFunctions_Callback);
  3379.  
  3380.     menu_item_add(menu_main, OverLight_CarFunctions_Menu, "Функции транспорта", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3381.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tФункции транспорта", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3382.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Машины в одну точку", ID_CAR_STREAMED_GRABBER, MENU_COLOR_DEFAULT, NULL, "Спавнит машины из зоны стрима в одну точку, из-за чего лагает игра у других игроков.");
  3383.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Все машины в одну точку", ID_CAR_MAP_GRABBER, MENU_COLOR_DEFAULT, NULL, "Спавнит машины всего сервера в одну точку.");
  3384.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Прицепы в одну точку", ID_TRAILER_GRABBER, MENU_COLOR_DEFAULT, NULL, "Спавнит машины в одну точку, из-за чего лагает игра у других игроков.");
  3385.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Стрельба машинами", ID_CAR_SHOOTER, MENU_COLOR_DEFAULT, NULL, "Обычная стрельба машинами.");
  3386.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Стрельба одной машиной", ID_SHOOTER_ONCE, MENU_COLOR_DEFAULT, NULL, "Выпускает только одну машину за один клик.");
  3387.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Стрельба машинами стрима", ID_FUS_RO_DAH, MENU_COLOR_DEFAULT, NULL, "Выпускает все машины стрима за один клик.");
  3388.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Взять машину", ID_PICK_CAR, MENU_COLOR_DEFAULT, NULL, "Перемещайте машину с помощью вашего прицела");
  3389.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Вихрь дверей", ID_DOOR_STORM, MENU_COLOR_DEFAULT, NULL, "Нужно сидеть в машине, закручивает машину и постоянно выбрасывает двери.");
  3390.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Баг транспорта", ID_VEHICLE_BUGGER, MENU_COLOR_DEFAULT, NULL, "Машины падают под карту или просто становятся нерабочими.");
  3391.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tКЕК Штуки", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3392.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Невидимый/Лагающий Байк", ID_INVISIBLE_BIKE, MENU_COLOR_DEFAULT, NULL, "Делает вас и байк невидимыми, вас видно только на миникарте, давите людей с наслаждением.");
  3393.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Невидимый/Лагающий Байк 2", ID_INVISIBLE_BIKE_2, MENU_COLOR_DEFAULT, NULL, "Делает вас и байк невидимыми, вас видно только на миникарте, давите людей с наслаждением v2.");
  3394.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Починка огня", ID_FIX_INVISIBLE_FIRE, MENU_COLOR_DEFAULT, NULL, "Убирает огонь когда ваше тело невидимое");
  3395.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tТроллинг игроков транспортом", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3396.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Взять ближайшего игрока", ID_USE_NEAREST_TARGET, MENU_COLOR_DEFAULT, NULL);
  3397.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\aИгрок: //", ID_SELECT_PLAYER_TARGET, MENU_COLOR_DEFAULT, NULL, "Отключите \"Взять ближайшего игрока.\" чтобы выбрать определенного игрока.");
  3398.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Облако машин", ID_FANTOZZI_CLOUD, MENU_COLOR_DEFAULT, NULL, "Создает облако машин которое обрушивается на игрока.");
  3399.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Подставная стрельба т/с", ID_FAKE_CAR_SHOOTER, MENU_COLOR_DEFAULT, NULL, "Стрельба машинами от лица другого игрока.");
  3400.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Лифт машинами (вверх)", ID_VEHICLE_ELEVATOR, MENU_COLOR_DEFAULT, NULL, "Поднимает игрока вверх за счет машин.");
  3401.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Лифт машинами (вниз)", ID_VEHICLE_ELEVATOR_DOWN, MENU_COLOR_DEFAULT, NULL, "Утаскивает игрока вниз за счет машин.");
  3402.  
  3403.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tФункции с пассажиром", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3404.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\aПассажир: //", ID_SELECT_PASSENGER_TARGET, MENU_COLOR_DEFAULT, NULL);
  3405.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Выпихнуть пассажира", ID_KICK_PASSENGER, MENU_COLOR_DEFAULT, NULL, "Вытолкнуть пассажриа из т/с.");
  3406.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Украсть место", ID_STEAL_PASSENGER, MENU_COLOR_DEFAULT, NULL, "Украсть место пассажира.");
  3407.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tСтарые крашеры", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3408.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Vortex Крашер", ID_VORTEX_CRASHER, MENU_COLOR_DEFAULT, NULL, "Устаревший крашер благодаря транспорту -Vortex-.");
  3409.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Крашер Самолетом", ID_PLANE_CRASHER, MENU_COLOR_DEFAULT, NULL, "Устаревший крашер самолетом.");
  3410.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tСинхронизация движения", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3411.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Нормальная", ID_SYNC_INCAR_MENU, MENU_COLOR_DEFAULT, NULL, "Работает лучше, но является самым обнаруживаемым.");
  3412.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Вторичная", ID_SYNC_UNOCCUPIED_MENU, MENU_COLOR_DEFAULT, NULL, "Необнаруживаемая синхронизация.");
  3413.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Нормальная + НОП", ID_SYNC_INCAR_RPC_MENU, MENU_COLOR_DEFAULT, NULL, "Такой же, но немного необнаруживаемый.");
  3414.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tТемп для функций транспорта", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3415.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\aТемп: // ", ID_CAR_SEND_RATE, MENU_COLOR_DEFAULT, NULL, "Увеличивает темп транспортных функций, чем меньше значение тем быстрее.");
  3416.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "\tДрузья", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3417.     menu_item_add(OverLight_CarFunctions_Menu, NULL, "Друзья - цели", ID_USE_FRIEND_TARGET, MENU_COLOR_DEFAULT, NULL, "Дает возможноссть выбрать вашего друга в качестве цели.");
  3418.  
  3419.     struct menu* OverLight_PlayerFunctions_Menu;
  3420.     OverLight_PlayerFunctions_Menu = menu_new(menu_main, 0, OverLight_PlayerFunctions_Callback);
  3421.     menu_item_add(menu_main, OverLight_PlayerFunctions_Menu, "Функции игрока", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3422.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "\tИскривление", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3423.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Вверх ногами", ID_INVERT_WALK, MENU_COLOR_DEFAULT, NULL, "У других игроков вы ходите на голове.");
  3424.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Лунная походка", ID_INVERT_WALK_2, MENU_COLOR_DEFAULT, NULL, "О, да вы Майкл Джексон, у дургих игроков вы ходите задом вперед.");
  3425.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Колобок", ID_WHEEL_WALK, MENU_COLOR_DEFAULT, NULL, "У других игроков вы становитесь скрюченый как колобок.");
  3426.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Голограмма", ID_PLAYER_HOLOGRAM_MODE, MENU_COLOR_DEFAULT, NULL, "Работает редко, режим неведимки, только ваша модель остается на одном месте");
  3427.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Коллизия т/с", ID_CAR_HOLOGRAM_MODE, MENU_COLOR_DEFAULT, NULL, "Убирает коллизию у транспорта.");
  3428.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Сбив падения", ID_NOFALL, MENU_COLOR_DEFAULT, NULL, "Сбивает анимацию падения, тем самым не нанося урон.");
  3429.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Баг при прицеле", ID_INVALID_AIMZ, MENU_COLOR_DEFAULT, NULL, "Убирает ваш ник и часть тела когда вы прицеливаетесь.");
  3430.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "\tТроллинг игроков", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3431.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Взять ближайшего игрока", ID_USE_NEAREST_PLAYER, MENU_COLOR_DEFAULT, NULL);
  3432.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "\aИгрок: //", ID_SELECT_PLAYER_TARGET_2, MENU_COLOR_DEFAULT, NULL, "Отключите \"Взять ближайшего игрока.\" чтобы выбрать определенного игрока");
  3433.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Слаппер", ID_SLAPPER, MENU_COLOR_DEFAULT, NULL, "Разбарсывает игрока(ов) во все стороны.");
  3434.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Лифт", ID_ELEVATOR, MENU_COLOR_DEFAULT, NULL, "Поднимает игрока вверх за счет вашего персонажа.");
  3435.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Лифт с джетпаком", ID_JETPACK_ELEVATOR, MENU_COLOR_DEFAULT, NULL, "Поднимает игрока вверх за счет вашего персонажа с джетпаком.");
  3436.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "\tДрузья", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3437.     menu_item_add(OverLight_PlayerFunctions_Menu, NULL, "Друзья - цели", ID_USE_FRIEND_TARGET2, MENU_COLOR_DEFAULT, NULL, "Дает возможноссть выбрать вашего друга в качестве цели.");
  3438.  
  3439.     struct menu* OverLight_DM_Stuff_Menu;
  3440.     struct menu* OverLight_Chams_Advanced;
  3441.     struct menu* OverLight_Silent_Advanced;
  3442.     OverLight_DM_Stuff_Menu = menu_new(menu_main, 0, OverLight_DM_Stuff_Callback);
  3443.     menu_item_add(menu_main, OverLight_DM_Stuff_Menu, "Функции с оружием", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3444.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\tАимбот - Lagcomp ON/OFF", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3445.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Аим", ID_SILENT_AIM, MENU_COLOR_DEFAULT, NULL);
  3446.     OverLight_Silent_Advanced = menu_new(OverLight_DM_Stuff_Menu, 0, OverLight_Silent_Aim_Stuff_Callback);
  3447.     menu_item_add(OverLight_DM_Stuff_Menu, OverLight_Silent_Advanced, "Настройки аима", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3448.  
  3449.     menu_item_add(OverLight_Silent_Advanced, NULL, "\tНастройки аима", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3450.     menu_item_add(OverLight_Silent_Advanced, NULL, "\aСмещение прицела: //", ID_INACCURATE_AIM, MENU_COLOR_DEFAULT, NULL, "Decrease to get more accurate aim but more detectable.");
  3451.     menu_item_add(OverLight_Silent_Advanced, NULL, "\tЦелиться только в:", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3452.     menu_item_add(OverLight_Silent_Advanced, NULL, "Не в друзей", ID_FILTER_FRIEND, MENU_COLOR_DEFAULT, NULL);
  3453.     menu_item_add(OverLight_Silent_Advanced, NULL, "Не в мою команду", ID_FILTER_TEAM, MENU_COLOR_DEFAULT, NULL);
  3454.     menu_item_add(OverLight_Silent_Advanced, NULL, "Не в цвет моего ника", ID_FILTER_COLOR, MENU_COLOR_DEFAULT, NULL);
  3455.     menu_item_add(OverLight_Silent_Advanced, NULL, "Не в игрока с моим скином", ID_FILTER_SKIN, MENU_COLOR_DEFAULT, NULL);
  3456.     menu_item_add(OverLight_Silent_Advanced, NULL, "Не выходящего за пределы", ID_NOT_OUT_OF_RANGE, MENU_COLOR_DEFAULT, NULL);
  3457.     menu_item_add(OverLight_Silent_Advanced, NULL, "Игрока с видимым скином", ID_FILTER_VISIBLE, MENU_COLOR_DEFAULT, NULL);
  3458.     menu_item_add(OverLight_Silent_Advanced, NULL, "Игрока не в АФК", ID_FILTER_AFK, MENU_COLOR_DEFAULT, NULL);
  3459.     menu_item_add(OverLight_Silent_Advanced, NULL, "Живого игрока", ID_FILTER_ALIVE, MENU_COLOR_DEFAULT, NULL);
  3460.  
  3461.  
  3462.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Стрельба через стены", ID_SHOT_WALL, MENU_COLOR_DEFAULT, NULL);
  3463.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Возможный обход анти-чита", ID_BYPASS_ANTICHEAT, MENU_COLOR_DEFAULT, NULL, "Используйте это если вас кикает анти-чит за аим.");
  3464.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Возможный обход анти-чита 2", ID_BYPASS_ANTICHEAT_2, MENU_COLOR_DEFAULT, NULL, "Используйте это если вас кикает анти-чит за аим и не сработал первый обход.");
  3465.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Авто +С", ID_AUTO_C_BUG, MENU_COLOR_DEFAULT, NULL);
  3466.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Авто перезарядка", ID_AUTO_SCROLL, MENU_COLOR_DEFAULT, NULL);
  3467.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Стерлять если враг в прицеле", ID_AUTOSHOT, MENU_COLOR_DEFAULT, NULL, "Автоматически стреляет при наведении прицелом на врага.");
  3468.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Стрельба без отдачи", ID_NOSPREAD, MENU_COLOR_DEFAULT, NULL);
  3469.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Анти анимация от попадания", ID_ANTISTUN, MENU_COLOR_DEFAULT, NULL);
  3470.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Чувствительность", ID_SLOWSENSAIM, MENU_COLOR_DEFAULT, NULL);
  3471.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\aСила чувствительности: //", ID_SLOWINC, MENU_COLOR_DEFAULT, NULL);
  3472.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\tРассинхрон персонажа", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3473.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Включить рассинхрон", ID_FAKE_LAG_SYNC, MENU_COLOR_DEFAULT, NULL);
  3474.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\aВремя синхронизации: // ms", ID_FAKE_LAG_TIME_SYNC, MENU_COLOR_DEFAULT, NULL);
  3475.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\aВремя рассинхрона (АФК): // ms", ID_FAKE_LAG_TIME_DESYNC, MENU_COLOR_DEFAULT, NULL);
  3476.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Синхрон при прицеливании", ID_SYNC_WHEN_AIM, MENU_COLOR_DEFAULT, NULL);
  3477.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\tРассинхрон ходьбы", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3478.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Включить рассинхрон", ID_FAKE_LAG_SPEED, MENU_COLOR_DEFAULT, NULL);
  3479.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\aРассинхрон при скорости: //", ID_SPEED_MULTIPLIER, MENU_COLOR_DEFAULT, NULL);
  3480.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "\tУтилиты", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3481.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Повторитель выстрелов", ID_SHOT_REPEATER, MENU_COLOR_DEFAULT, NULL, "Отправьте назад пулю, которую вы получили. У вас должно быть оружие в руках.");
  3482.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Draw Finder (Поиск рисунков)", ID_DRAW_FINDER, MENU_COLOR_DEFAULT, NULL);
  3483.     menu_item_add(OverLight_DM_Stuff_Menu, NULL, "Пользовательский ВХ", ID_CHAMS, MENU_COLOR_DEFAULT, NULL);
  3484.     OverLight_Chams_Advanced = menu_new(OverLight_DM_Stuff_Menu, 0, OverLight_Chams_Callback);
  3485.     menu_item_add(OverLight_DM_Stuff_Menu, OverLight_Chams_Advanced, "Настройки ВХ", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3486.  
  3487.  
  3488.     menu_item_add(OverLight_Chams_Advanced, NULL, "\tСкрытый цвет", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3489.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aПрозрачность: //", ID_BEHIND_ALPHA, MENU_COLOR_DEFAULT, NULL);
  3490.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aКрасный: //", ID_BEHIND_RED, MENU_COLOR_DEFAULT, NULL);
  3491.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aЗеленый: //", ID_BEHIND_GREEN, MENU_COLOR_DEFAULT, NULL);
  3492.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aСиний: //", ID_BEHIND_BLUE, MENU_COLOR_DEFAULT, NULL);
  3493.     menu_item_add(OverLight_Chams_Advanced, NULL, "Цельный", ID_BEHIND_SOLID, MENU_COLOR_DEFAULT, NULL);
  3494.     menu_item_add(OverLight_Chams_Advanced, NULL, "Каркас", ID_BEHIND_WIREFRAME, MENU_COLOR_DEFAULT, NULL);
  3495.     menu_item_add(OverLight_Chams_Advanced, NULL, "Точка", ID_BEHIND_POINT, MENU_COLOR_DEFAULT, NULL);
  3496.     menu_item_add(OverLight_Chams_Advanced, NULL, "\tОтображаемый цвет", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3497.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aПрозрачность: //", ID_INFRONT_ALPHA, MENU_COLOR_DEFAULT, NULL);
  3498.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aКрасный: //", ID_INFRONT_RED, MENU_COLOR_DEFAULT, NULL);
  3499.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aЗеленый: //", ID_INFRONT_GREEN, MENU_COLOR_DEFAULT, NULL);
  3500.     menu_item_add(OverLight_Chams_Advanced, NULL, "\aСиний: //", ID_INFRONT_BLUE, MENU_COLOR_DEFAULT, NULL);
  3501.     menu_item_add(OverLight_Chams_Advanced, NULL, "Цельный", ID_INFRONT_SOLID, MENU_COLOR_DEFAULT, NULL);
  3502.     menu_item_add(OverLight_Chams_Advanced, NULL, "Каркас", ID_INFRONT_WIREFRAME, MENU_COLOR_DEFAULT, NULL);
  3503.     menu_item_add(OverLight_Chams_Advanced, NULL, "Точка", ID_INFRONT_POINT, MENU_COLOR_DEFAULT, NULL);
  3504.  
  3505.     struct menu* OverLight_Bot_Stuff_Menu;
  3506.     struct menu* OverLight_Bot_Follow_Advanced;
  3507.     struct menu* OverLight_Bot_Connect_Advanced;
  3508.     struct menu* OverLight_Bot_Pick_Control_Advanced;
  3509.     OverLight_Bot_Stuff_Menu = menu_new(menu_main, 0, OverLight_Bot_Stuff_Callback);
  3510.     menu_item_add(menu_main, OverLight_Bot_Stuff_Menu, "Функции ботов", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3511.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\tРабота с ботами", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3512.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Подключить бота", ID_CONNECT_BOT, MENU_COLOR_DEFAULT, NULL, "Подключите бота для использования функций ниже.");
  3513.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Подключить n бота(ов)", ID_N_CONNECT_BOT, MENU_COLOR_DEFAULT, NULL);
  3514.     //menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aN Bots: 5", ID_N_BOT, MENU_COLOR_DEFAULT, NULL);
  3515.     OverLight_Bot_Connect_Advanced = menu_new(OverLight_Bot_Stuff_Menu, 0, OverLight_Bot_Connect_Callback);
  3516.     menu_item_add(OverLight_Bot_Stuff_Menu, OverLight_Bot_Connect_Advanced, "Дополнительные настройки", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3517.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "\tНастройки имени и др", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3518.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "Использовать ваш никнейм", ID_MENU_NICK_LOCAL, MENU_COLOR_DEFAULT, NULL);
  3519.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "Рандомное имя", ID_MENU_NICK_REALISTIC, MENU_COLOR_DEFAULT, NULL);
  3520.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "Имя в двоичной СИ", ID_MENU_NICK_BINARY, MENU_COLOR_DEFAULT, NULL);
  3521.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "\aID Класса: //", ID_BOT_CLASS_ID, MENU_COLOR_DEFAULT, NULL);
  3522.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "Заспавнить с этим классом", ID_BOT_SPAWN2, MENU_COLOR_DEFAULT, NULL);
  3523.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "\tДругие игроки", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3524.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "\aИгроки: //", ID_BOT_PLAYER, MENU_COLOR_DEFAULT, NULL);
  3525.     menu_item_add(OverLight_Bot_Connect_Advanced, NULL, "Взять ник игрока для бота", ID_BOT_STEAL_NICK, MENU_COLOR_DEFAULT, NULL);
  3526.  
  3527.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Заспавнить", ID_BOT_SPAWN, MENU_COLOR_DEFAULT, NULL, "Попробуйте заспавнить бота заново, если у вас не работают функции ниже или бот не появился.");
  3528.  
  3529.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Удалить бота", ID_DELETE_BOT, MENU_COLOR_DEFAULT, NULL);
  3530.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Удалить всех ботов", ID_DELETE_ALL_BOT, MENU_COLOR_DEFAULT, NULL);
  3531.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\tФункции ботов", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3532.  
  3533.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Идти за игроком", ID_BOT_FOLLOW, MENU_COLOR_DEFAULT, NULL);
  3534.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aРасстояние от игрока: //", ID_BOT_DISTANCE, MENU_COLOR_DEFAULT, NULL);
  3535.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aРасстояние от ботов: //", ID_BOT_DISTANCE_2, MENU_COLOR_DEFAULT, NULL);
  3536.     OverLight_Bot_Follow_Advanced = menu_new(OverLight_Bot_Stuff_Menu, 0, OverLight_Bot_Follow_Callback);
  3537.     menu_item_add(OverLight_Bot_Stuff_Menu, OverLight_Bot_Follow_Advanced, "Дополнительные настройки", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3538.     //menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Bot Silent Aimbot", ID_BOT_SILENT, MENU_COLOR_DEFAULT, NULL);
  3539.     //menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aBot Silent Multiplier: //", ID_BOT_SILENT_MULTIPLIER, MENU_COLOR_DEFAULT, NULL);
  3540.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\tТроллинг ботами", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3541.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aИгрок: //", ID_BOT_SELECT_TARGET, MENU_COLOR_DEFAULT, NULL);
  3542.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Взять ближайшего игрока", ID_BOT_USE_NEAREST_TARGET, MENU_COLOR_DEFAULT, NULL);
  3543.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Стрелять ботами", ID_BOT_SHOOTER, MENU_COLOR_DEFAULT, NULL);
  3544.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Атака ботов", ID_BOT_ATTACKER, MENU_COLOR_DEFAULT, NULL);
  3545.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aID Оружия для атаки: \\", ID_BOT_WEAPON, MENU_COLOR_DEFAULT, NULL);
  3546.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Разнос ботами игрока(ов)", ID_BOT_SLAPPER, MENU_COLOR_DEFAULT, NULL);
  3547.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Подъем игрока в небо", ID_BOT_ELEVATOR, MENU_COLOR_DEFAULT, NULL);
  3548.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Подъем игрока джетпаком", ID_BOT_JETPACK_ELEVATOR, MENU_COLOR_DEFAULT, NULL);
  3549.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Ебля ботами", ID_BOT_FUCK, MENU_COLOR_DEFAULT, NULL);
  3550.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Преследовать с анимацией", ID_BOT_FOLLOW_ANIM, MENU_COLOR_DEFAULT, NULL);
  3551.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aID Анимации: \\", ID_BOT_FOLLOW_SEL_ANIM, MENU_COLOR_DEFAULT, NULL);
  3552.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Боты летают над игроком", ID_BOT_SUN, MENU_COLOR_DEFAULT, NULL);
  3553.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Вихрь ботов", ID_BOT_STORM, MENU_COLOR_DEFAULT, NULL);
  3554.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Взять бота курсором", ID_BOT_PICK, MENU_COLOR_DEFAULT, NULL);
  3555.  
  3556.     OverLight_Bot_Pick_Control_Advanced = menu_new(OverLight_Bot_Stuff_Menu, 0, OverLight_Bot_Control_Callback);
  3557.     menu_item_add(OverLight_Bot_Stuff_Menu, OverLight_Bot_Pick_Control_Advanced, "Bot Pick/Control Advanced", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3558.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Темп", ID_BOT_DELAY, MENU_COLOR_DEFAULT, NULL);
  3559.  
  3560.  
  3561.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\tSync Modifications", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3562.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Fake Ping", ID_FAKE_PING, MENU_COLOR_DEFAULT, NULL);
  3563.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\aIncrease Ping: 0", ID_INCREASE_PING, MENU_COLOR_DEFAULT, NULL);
  3564.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "\tFriends", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3565.     menu_item_add(OverLight_Bot_Stuff_Menu, NULL, "Use Friends on Target", ID_USE_FRIEND_TARGET3, MENU_COLOR_DEFAULT, NULL);
  3566.  
  3567.  
  3568.     menu_item_add(OverLight_Bot_Pick_Control_Advanced, NULL, "\tBot Pick/Control Advanced", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3569.     menu_item_add(OverLight_Bot_Pick_Control_Advanced, NULL, "Bot ID: //", ID_BOT_ID, MENU_COLOR_DEFAULT, NULL);
  3570.     menu_item_add(OverLight_Bot_Pick_Control_Advanced, NULL, "\aAnimation ID: //", ID_BOT_ANIMATION, MENU_COLOR_DEFAULT, NULL);
  3571.  
  3572.  
  3573.  
  3574.     //struct menu *OverLight_Bot_Advanced;
  3575.     //OverLight_Bot_Advanced = menu_new(OverLight_Bot_Stuff_Menu, 0, OverLight_Client_Stuff_Callback);
  3576.     //menu_item_add(OverLight_Bot_Stuff_Menu, OverLight_Bot_Advanced, "Bot Advanced Options", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3577.     //Advanced Follow
  3578.     menu_item_add(OverLight_Bot_Follow_Advanced, NULL, "Copy Health", ID_BOT_COPY_HEALTH, MENU_COLOR_DEFAULT, NULL);
  3579.     menu_item_add(OverLight_Bot_Follow_Advanced, NULL, "Copy Armor", ID_BOT_COPY_ARMOR, MENU_COLOR_DEFAULT, NULL);
  3580.     menu_item_add(OverLight_Bot_Follow_Advanced, NULL, "Copy Weapon", ID_BOT_COPY_WEAPON, MENU_COLOR_DEFAULT, NULL);
  3581.     menu_item_add(OverLight_Bot_Follow_Advanced, NULL, "Copy Chat", ID_BOT_COPY_CHAT, MENU_COLOR_DEFAULT, NULL);
  3582.     menu_item_add(OverLight_Bot_Follow_Advanced, NULL, "Copy RPC (commands, chat, etc..)", ID_BOT_COPY_RPC, MENU_COLOR_DEFAULT, NULL);
  3583.  
  3584.     struct menu* OverLight_Client_Stuff_Menu;
  3585.     struct menu* OverLight_Graphics_Stuff_Menu;
  3586.     OverLight_Client_Stuff_Menu = menu_new(menu_main, 0, OverLight_Client_Stuff_Callback);
  3587.     menu_item_add(menu_main, OverLight_Client_Stuff_Menu, "Client Stuff", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3588.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "\tAnti Crashers/Troll", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3589.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Anti Car Controll/Troll", ID_ANTI_CAR_TROLL, MENU_COLOR_DEFAULT, NULL);
  3590.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Anti Bullet Crasher", ID_ANTI_BULLET_CRASHER, MENU_COLOR_DEFAULT, NULL);
  3591.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Anti Bad Vehicles", ID_ANTI_BAD_VEHICLES, MENU_COLOR_DEFAULT, NULL);
  3592.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "\tChange Graphics", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3593.     OverLight_Graphics_Stuff_Menu = menu_new(OverLight_Client_Stuff_Menu, 0, OverLight_Change_Graphics_Callback);
  3594.     menu_item_add(OverLight_Client_Stuff_Menu, OverLight_Graphics_Stuff_Menu, "GTA Graphics Stuff", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3595.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "\tFunctions for kids", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3596.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Remote RCON Attack", ID_RCON_ATTACK, MENU_COLOR_DEFAULT, NULL);
  3597.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Server Lag", ID_SERVER_LAG, MENU_COLOR_DEFAULT, NULL);
  3598.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "\aMessages Limit: ///sec", ID_MESSAGES_LIMIT, MENU_COLOR_DEFAULT, NULL);
  3599.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Change Serial GPCI", ID_CHANGE_GPCI, MENU_COLOR_DEFAULT, NULL);
  3600.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Join Flood", ID_JOIN_FLOOD, MENU_COLOR_DEFAULT, NULL);
  3601.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Fake FPS", ID_FAKE_FPS, MENU_COLOR_DEFAULT, NULL);
  3602.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "FPS: //", ID_SELECT_FAKE_FPS, MENU_COLOR_DEFAULT, NULL);
  3603.     menu_item_add(OverLight_Client_Stuff_Menu, NULL, "Anti Loading", ID_ANTI_LOADING, MENU_COLOR_DEFAULT, NULL);
  3604.  
  3605.  
  3606.  
  3607.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\tGTA Graphics Stuff", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3608.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "Enable Change Graphics", ID_CHANGE_GRAPHICS, MENU_COLOR_DEFAULT, NULL);
  3609.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aMat. Sharpness Power: //", ID_SHARPNESS_POWER, MENU_COLOR_DEFAULT, NULL);
  3610.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aLight Cutoff Range: //", ID_LIGHT_RANGE, MENU_COLOR_DEFAULT, NULL);
  3611.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aMat. Shininess: //", ID_MAT_SHININESS, MENU_COLOR_DEFAULT, NULL);
  3612.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aLight Shininess: //", ID_LIGHT_SHININESS, MENU_COLOR_DEFAULT, NULL);
  3613.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aMat. Amb. Color: //", ID_MAT_AMBIENTCOLOR, MENU_COLOR_DEFAULT, NULL);
  3614.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aLight Amb. Color: //", ID_LIGHT_AMBIENTCOLOR, MENU_COLOR_DEFAULT, NULL);
  3615.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aMat. Diff. Color: //", ID_MAT_DIFFUSECOLOR, MENU_COLOR_DEFAULT, NULL);
  3616.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aLight Diff. Color: //", ID_LIGHT_DIFFUSECOLOR, MENU_COLOR_DEFAULT, NULL);
  3617.     menu_item_add(OverLight_Graphics_Stuff_Menu, NULL, "\aMat. Emes. Color: //", ID_MAT_EMESSIVECOLOR, MENU_COLOR_DEFAULT, NULL);
  3618.  
  3619.  
  3620.  
  3621.     struct menu* OverLight_HUD_Settings;
  3622.     OverLight_HUD_Settings = menu_new(menu_main, 0, OverLight_HUD_Settings_Callback);
  3623.     menu_item_add(menu_main, OverLight_HUD_Settings, "HUD Settings", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3624.     menu_item_add(OverLight_HUD_Settings, NULL, "Custom Players Tags", ID_PLAYER_TAGS, MENU_COLOR_DEFAULT, NULL);
  3625.     menu_item_add(OverLight_HUD_Settings, NULL, "Vehicles Tags", ID_VEHICLE_TAGS, MENU_COLOR_DEFAULT, NULL);
  3626.     menu_item_add(OverLight_HUD_Settings, NULL, "\tFonts Settings", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3627.     menu_item_add(OverLight_HUD_Settings, NULL, "\aFont Chat Size: \\", ID_FONT_CHAT_SIZE, MENU_COLOR_DEFAULT, NULL, "Press ENTER for save, and restart the game");
  3628.     menu_item_add(OverLight_HUD_Settings, NULL, "\aFont Small Size: \\", ID_FONT_SMALL_SIZE, MENU_COLOR_DEFAULT, NULL, "Press ENTER for save, and restart the game");
  3629.     menu_item_add(OverLight_HUD_Settings, NULL, "\aFont Footer Size: \\", ID_FONT_FOOTER_SIZE, MENU_COLOR_DEFAULT, NULL, "Press ENTER for save, and restart the game");
  3630.     menu_item_add(OverLight_HUD_Settings, NULL, "\aFont Menu Size: \\", ID_FONT_MENU_SIZE, MENU_COLOR_DEFAULT, NULL, "Press ENTER for save, and restart the game");
  3631.  
  3632.  
  3633.     struct menu* OverLight_Chat_Settings;
  3634.     OverLight_Chat_Settings = menu_new(menu_main, 0, OverLight_Chat_Callback);
  3635.     menu_item_add(menu_main, OverLight_Chat_Settings, "Chat Settings", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3636.     menu_item_add(OverLight_Chat_Settings, NULL, "Remove Chat Background", ID_TRANSP, MENU_COLOR_DEFAULT, NULL);
  3637.     menu_item_add(OverLight_Chat_Settings, NULL, "\tOL Chat Privacy", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3638.     menu_item_add(OverLight_Chat_Settings, NULL, "Send Nickname", ID_SEND_NICKNAME, MENU_COLOR_DEFAULT, NULL);
  3639.     menu_item_add(OverLight_Chat_Settings, NULL, "Send Current Server", ID_SEND_SERVER, MENU_COLOR_DEFAULT, NULL);
  3640.  
  3641.  
  3642.  
  3643.  
  3644.     struct menu* OverLight_Crashers;
  3645.     OverLight_Crashers = menu_new(menu_main, 0, OverLight_Crashers_Callback);
  3646.     menu_item_add(menu_main, OverLight_Crashers, "Crashers", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3647.     menu_item_add(OverLight_Crashers, NULL, "Vortex Crasher v2", ID_VORTEX_CRASHER2, MENU_COLOR_DEFAULT, NULL, "You NEED drive a Plane or Vortex to use it.");
  3648.     menu_item_add(OverLight_Crashers, NULL, "Plane Crasher v2", ID_PLANE_CRASHER2, MENU_COLOR_DEFAULT, NULL, "You NEED drive a Plane or Vortex to use it.");
  3649.     menu_item_add(OverLight_Crashers, NULL, "Vortex Crasher v1", ID_VORTEX_CRASHER_, MENU_COLOR_DEFAULT, NULL, "You NEED drive a Plane or Vortex to use it.");
  3650.     menu_item_add(OverLight_Crashers, NULL, "Plane Crasher v1", ID_PLANE_CRASHER_, MENU_COLOR_DEFAULT, NULL, "You NEED drive a Plane or Vortex to use it.");
  3651.     menu_item_add(OverLight_Crashers, NULL, "Bullet Crasher", ID_BULLET_CRASHER, MENU_COLOR_DEFAULT, NULL, "You need a vehicle and a weapon.");
  3652.     menu_item_add(OverLight_Crashers, NULL, "Car Jack Crasher", ID_CARJACK_CRASHER, MENU_COLOR_DEFAULT, NULL, "You need a driver and a weapon.");
  3653.     menu_item_add(OverLight_Crashers, NULL, "Plane Crasher v3", ID_STUNT_CRASHER, MENU_COLOR_DEFAULT, NULL, "Works with Stuntplane Shamal Hydra.");
  3654.     menu_item_add(OverLight_Crashers, NULL, "Hunter Crasher", ID_HUNTER_CRASHER, MENU_COLOR_DEFAULT, NULL, "Works with Hunter.");
  3655.     menu_item_add(OverLight_Crashers, NULL, "Detonator Crasher", ID_DETONATOR_CRASHER, MENU_COLOR_DEFAULT, NULL, "On Foot Crasher.");
  3656.     menu_item_add(OverLight_Crashers, NULL, "Jetpack Roll Crasher", ID_JETPACK_ROLL_CRASHER, MENU_COLOR_DEFAULT, NULL, "Never gonna give you Jetpack.");
  3657.  
  3658.  
  3659.     //menu_item_add(OverLight_Crashers, NULL, "Shamal Crasher", ID_STUNT_CRASHER, MENU_COLOR_DEFAULT, NULL, "You NEED drive a Shamal to use it.");
  3660.  
  3661.  
  3662.     struct menu* OverLight_Credits_Menu;
  3663.     OverLight_Credits_Menu = menu_new(menu_main, 0, OverLight_Credits_Callback);
  3664.     menu_item_add(menu_main, OverLight_Credits_Menu, "OverLight Credits", 1, MENU_COLOR_DEFAULT, NULL);
  3665.     menu_item_add(OverLight_Credits_Menu, NULL, "Mod S0beit OverLight", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3666.     menu_item_add(OverLight_Credits_Menu, NULL, "by RcK.", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3667.     menu_item_add(OverLight_Credits_Menu, NULL, "Special thanks to", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3668.     menu_item_add(OverLight_Credits_Menu, NULL, "Enacostione, Krakazabra", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3669.     menu_item_add(OverLight_Credits_Menu, NULL, "and mod s0beit Developers.", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3670.     menu_item_add(OverLight_Credits_Menu, NULL, "Thanks Heron for beta tester.", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3671.     menu_item_add(OverLight_Credits_Menu, NULL, "", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3672.     menu_item_add(OverLight_Credits_Menu, NULL, "", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3673.     menu_item_add(OverLight_Credits_Menu, NULL, "", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3674.     menu_item_add(OverLight_Credits_Menu, NULL, "", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3675.     menu_item_add(OverLight_Credits_Menu, NULL, "", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3676.     menu_item_add(OverLight_Credits_Menu, NULL, "", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3677.     //menu_item_add(menu_main, NULL, "Owner Menu", 1, MENU_COLOR_DEFAULT, NULL);
  3678.     menu_item_add(menu_main, NULL, "\tGTA", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3679.     menu_item_add(menu_main, menu_cheats, "Cheats", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3680.     menu_item_add(menu_main, menu_weapons, "Weapons", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3681.     menu_item_add(menu_main, menu_vehicles, "Vehicles", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3682.     menu_item_add(menu_main, menu_teleports, "Teleports", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3683.     menu_item_add(menu_main, menu_misc, "Misc.", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3684.     snprintf(name, sizeof(name), "GTA Patches (%d/%d)", iGTAPatchesCount, INI_PATCHES_MAX);
  3685.     menu_item_add(menu_main, menu_patches, name, ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3686.  
  3687.     /* main menu (samp specific) */
  3688.     if (g_dwSAMP_Addr != NULL)
  3689.     {
  3690.         menu_item_add(menu_main, NULL, "\tSA-MP", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3691.         menu_item_add(menu_main, menu_players, "Players", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3692.         snprintf(name, sizeof(name), "Fav. server list (%d/%d)", iServersCount, INI_SERVERS_MAX);
  3693.         menu_item_add(menu_main, menu_servers, name, ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3694.         menu_item_add(menu_main, menu_sampmisc, "SA:MP Misc.", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3695.         snprintf(name, sizeof(name), "SA:MP Patches (%d/%d)", iSAMPPatchesCount, INI_SAMPPATCHES_MAX);
  3696.         menu_item_add(menu_main, menu_samppatches, name, ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3697.     }
  3698.  
  3699.     /* main menu -> cheats - menu items */
  3700.     menu_item_add(menu_cheats, menu_cheats_mods, "Vehicle upgrades", ID_CHEAT_MODS, MENU_COLOR_DEFAULT, NULL);
  3701.  
  3702.     //menu_item_add( menu_cheats, menu_cheats_handling, "Change vehicle handling", ID_CHEAT_HANDLING, MENU_COLOR_DEFAULT, NULL );
  3703.     menu_item_add(menu_cheats, menu_cheats_money, "Money", ID_CHEAT_MONEY, MENU_COLOR_DEFAULT, NULL);
  3704.     menu_item_add(menu_cheats, menu_cheats_inv, "Invulnerable", ID_CHEAT_INVULN, MENU_COLOR_DEFAULT, NULL);
  3705.     menu_item_add(menu_cheats, NULL, "Restore health", ID_CHEAT_HP, MENU_COLOR_DEFAULT, NULL);
  3706.     menu_item_add(menu_cheats, NULL, "Restore armor", ID_CHEAT_ARMOR, MENU_COLOR_DEFAULT, NULL);
  3707.     menu_item_add(menu_cheats, menu_cheats_weather, "Freeze weather", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3708.     menu_item_add(menu_cheats, menu_cheats_time, "Freeze time", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3709.     menu_item_add(menu_cheats, NULL, "Gravity: 0.0080", ID_CHEAT_GRAVITY, MENU_COLOR_DEFAULT, NULL);
  3710.     menu_item_add(menu_cheats, NULL, "Game speed: 100%", ID_CHEAT_GAME_SPEED, MENU_COLOR_DEFAULT, NULL);
  3711.     menu_item_add(menu_cheats, NULL, "Map", ID_CHEAT_MAP, MENU_COLOR_DEFAULT, NULL);
  3712.     menu_item_add(menu_cheats, NULL, "Render teleport texts", ID_CHEAT_TELETEXTS, MENU_COLOR_DEFAULT, NULL);
  3713.     menu_item_add(menu_cheats, NULL, "Misc. protections", ID_CHEAT_PROT, MENU_COLOR_DEFAULT, NULL);
  3714.     menu_item_add(menu_cheats, NULL, "Go to nearest empty car", ID_CHEAT_WARP_NEAR, MENU_COLOR_DEFAULT, NULL);
  3715.     menu_item_add(menu_cheats, NULL, "Give Jetpack", ID_CHEAT_JETPACK, MENU_COLOR_DEFAULT, NULL);
  3716.     menu_item_add(menu_cheats, NULL, "Unlock vehicles", ID_CHEAT_UNLOCK, MENU_COLOR_DEFAULT, NULL);
  3717.     menu_item_add(menu_cheats, NULL, "Keep trailers attached", ID_CHEAT_KEEP_TRAILER, MENU_COLOR_DEFAULT, NULL);
  3718.     menu_item_add(menu_cheats, NULL, "Toggle vehicle collisions", ID_CHEAT_NOCOLS, MENU_COLOR_DEFAULT, NULL);
  3719.     menu_item_add(menu_cheats, NULL, "Chams", ID_CHEAT_CHAMS, MENU_COLOR_DEFAULT, NULL);
  3720.     snprintf(name, sizeof(name), "Custom running style: %i, ", set.custom_runanimation_id);
  3721.     menu_item_add(menu_cheats, NULL, name, ID_CHEAT_CUSTOM_RUNSTYLE, MENU_COLOR_DEFAULT, NULL);
  3722.     snprintf(name, sizeof(name), "Player Fly Speed: %0.01f", set.fly_player_speed);
  3723.     menu_item_add(menu_cheats, NULL, name, ID_CHEAT_FLY_SPEED, MENU_COLOR_DEFAULT, NULL);
  3724.     menu_item_add(menu_cheats, NULL, "Disable Water Waves", ID_CHEAT_DISABLE_WAVES, MENU_COLOR_DEFAULT, NULL);
  3725.     menu_item_add(menu_cheats, NULL, "Surf", ID_CHEAT_SURF, MENU_COLOR_DEFAULT, NULL);
  3726.     menu_item_add(menu_cheats, NULL, "Freeze vehicle spin", ID_CHEAT_FREEZEROT, MENU_COLOR_DEFAULT, NULL);
  3727.     menu_item_add(menu_cheats, NULL, "Draw map lines", ID_CHEAT_MAP_DRAW_LINES, MENU_COLOR_DEFAULT, NULL);
  3728.  
  3729.     /* main menu -> cheats -> invulnerable */
  3730.     menu_item_add(menu_cheats_inv, NULL, "Actor invulnerability", ID_CHEAT_INVULN_ACTOR, MENU_COLOR_DEFAULT, NULL);
  3731.     menu_item_add(menu_cheats_inv, NULL, "Vehicle invulnerability", ID_CHEAT_INVULN_VEHICLE, MENU_COLOR_DEFAULT, NULL);
  3732.     menu_item_add(menu_cheats_inv, NULL, "Vehicle tire protections", ID_CHEAT_INVULN_TIRES, MENU_COLOR_DEFAULT, NULL);
  3733.  
  3734.     /*menu_item_add(menu_cheats_inv, NULL, "\t", ID_NONE, MENU_COLOR_SEPARATOR, NULL);*/
  3735.     snprintf(name, sizeof(name), "Vehicle minimum HP: %d", (int)set.hp_minimum);
  3736.     menu_item_add(menu_cheats_inv, NULL, name, ID_CHEAT_INVULN_MIN_HP, MENU_COLOR_DEFAULT, NULL);
  3737.     snprintf(name, sizeof(name), "Vehicle HP regeneration: %dhp/sec", (int)set.hp_regen);
  3738.     menu_item_add(menu_cheats_inv, NULL, name, ID_CHEAT_INVULN_REGEN, MENU_COLOR_DEFAULT, NULL);
  3739.     snprintf(name, sizeof(name), "Onfoot HP regeneration: %dhp/sec", (int)set.hp_regen);
  3740.     menu_item_add(menu_cheats_inv, NULL, name, ID_CHEAT_INVULN_REGEN_ONFOOT, MENU_COLOR_DEFAULT, NULL);
  3741.     menu_item_add(menu_cheats_inv, NULL, "Single Player Enemies vulnerable",
  3742.         ID_CHEAT_INVULN_DISABLE_EXTRA_INV, MENU_COLOR_DEFAULT, NULL);
  3743.     // actor invulnerability additional values
  3744.     menu_item_add(menu_cheats_inv, NULL, "Additional actor inv.:", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3745.     menu_item_add(menu_cheats_inv, NULL, "Explosion invulnerability", ID_CHEAT_INVULN_ACT_EXPL_INV, MENU_COLOR_DEFAULT, NULL);
  3746.     menu_item_add(menu_cheats_inv, NULL, "Fall invulnerability", ID_CHEAT_INVULN_ACT_FALL_INV, MENU_COLOR_DEFAULT, NULL);
  3747.     menu_item_add(menu_cheats_inv, NULL, "Fire invulnerability", ID_CHEAT_INVULN_ACT_FIRE_INV, MENU_COLOR_DEFAULT, NULL);
  3748.  
  3749.     /* main menu -> cheats -> money */
  3750.     menu_item_add(menu_cheats_money, NULL, "Give $500", ID_CHEAT_MONEY_GIVE_500, MENU_COLOR_DEFAULT, NULL);
  3751.     menu_item_add(menu_cheats_money, NULL, "Give $1000", ID_CHEAT_MONEY_GIVE_1000, MENU_COLOR_DEFAULT, NULL);
  3752.     menu_item_add(menu_cheats_money, NULL, "Give $5000", ID_CHEAT_MONEY_GIVE_5000, MENU_COLOR_DEFAULT, NULL);
  3753.     menu_item_add(menu_cheats_money, NULL, "Give $10000", ID_CHEAT_MONEY_GIVE_10000, MENU_COLOR_DEFAULT, NULL);
  3754.     menu_item_add(menu_cheats_money, NULL, "Give $20000", ID_CHEAT_MONEY_GIVE_20000, MENU_COLOR_DEFAULT, NULL);
  3755.     menu_item_add(menu_cheats_money, NULL, "Give $99999999", ID_CHEAT_MONEY_GIVE_99999999, MENU_COLOR_DEFAULT, NULL);
  3756.     snprintf(name, sizeof(name), "Give custom .ini value ($%d)", (int)set.money_value);
  3757.     menu_item_add(menu_cheats_money, NULL, name, ID_CHEAT_MONEY_GIVE_CUSTOM, MENU_COLOR_DEFAULT, NULL);
  3758.  
  3759.     menu_item_add(menu_cheats_money, NULL, "\tSettings", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3760.     snprintf(name, sizeof(name), "Max money: %d", (int)set.money_amount_max);
  3761.     menu_item_add(menu_cheats_money, NULL, name, ID_CHEAT_MONEY_MAX, MENU_COLOR_DEFAULT, NULL);
  3762.     snprintf(name, sizeof(name), "Random min: %d", (int)set.money_amount_rand_min);
  3763.     menu_item_add(menu_cheats_money, NULL, name, ID_CHEAT_MONEY_RAND_MIN, MENU_COLOR_DEFAULT, NULL);
  3764.     snprintf(name, sizeof(name), "Random max: %d", (int)set.money_amount_rand_max);
  3765.     menu_item_add(menu_cheats_money, NULL, name, ID_CHEAT_MONEY_RAND_MAX, MENU_COLOR_DEFAULT, NULL);
  3766.     snprintf(name, sizeof(name), "Interval min: %dsec", (int)set.money_interval_rand_min);
  3767.     menu_item_add(menu_cheats_money, NULL, name, ID_CHEAT_MONEY_IVAL_MIN, MENU_COLOR_DEFAULT, NULL);
  3768.     snprintf(name, sizeof(name), "Interval max: %dsec", (int)set.money_interval_rand_max);
  3769.     menu_item_add(menu_cheats_money, NULL, name, ID_CHEAT_MONEY_IVAL_MAX, MENU_COLOR_DEFAULT, NULL);
  3770.  
  3771.     /* main menu -> cheats -> weather */
  3772.     const struct
  3773.     {
  3774.         int     id;
  3775.         char* name;
  3776.     }
  3777.  
  3778.     weather_map[] =
  3779.     {
  3780.         0,
  3781.         "Blue sky",
  3782.         8,
  3783.         "Stormy",
  3784.         9,
  3785.         "Cloudy and foggy",
  3786.         10,
  3787.         "Clear blue sky",
  3788.         11,
  3789.         "Scorching hot (heat waves)",
  3790.         12,
  3791.         "Very dull, colorless, hazy",
  3792.         16,
  3793.         "Dull, cloudy, rainy",
  3794.         17,
  3795.         "Scorching hot",
  3796.         19,
  3797.         "Sandstorm",
  3798.         20,
  3799.         "Greenish fog",
  3800.         21,
  3801.         "Very dark, gradiented skyline, purple",
  3802.         22,
  3803.         "Very dark, gradiented skyline, green",
  3804.         23,
  3805.         "Variations of pale orange",
  3806.         27,
  3807.         "Variations of fresh blue",
  3808.         30,
  3809.         "Variations of dark, cloudy, teal",
  3810.         33,
  3811.         "Dark, cloudy, brown",
  3812.         34,
  3813.         "Blue, purple, regular",
  3814.         35,
  3815.         "Dull brown",
  3816.         36,
  3817.         "Extremely bright",
  3818.         40,
  3819.         "Blue, purple, cloudy",
  3820.         43,
  3821.         "Dark toxic clouds",
  3822.         44,
  3823.         "Black, white sky",
  3824.         45,
  3825.         "Black, purple sky",
  3826.         -1,
  3827.         NULL
  3828.     };
  3829.     for (i = 0;; i++)
  3830.     {
  3831.         if (weather_map[i].name == NULL)
  3832.             break;
  3833.         menu_item_add(menu_cheats_weather, NULL, weather_map[i].name, ID_CHEAT_WEATHER, MENU_COLOR_DEFAULT,
  3834.             (void*)(UINT_PTR)weather_map[i].id);
  3835.     }
  3836.  
  3837.     /* main menu -> cheats -> time */
  3838.     for (i = 0; i < 24; i++)
  3839.     {
  3840.         snprintf(name, sizeof(name), "%02d:00", i);
  3841.         menu_item_add(menu_cheats_time, NULL, name, ID_CHEAT_TIME, MENU_COLOR_DEFAULT, (void*)(UINT_PTR)i);
  3842.     }
  3843.  
  3844.     /* main menu -> weapons */
  3845.     menu_item_add(menu_weapons, NULL, "Enable weapon cheat", ID_WEAPON_ENABLE, MENU_COLOR_DEFAULT, NULL);
  3846.     menu_item_add(menu_weapons, NULL, "Randomize ammo values", ID_WEAPON_RANDOM, MENU_COLOR_DEFAULT, NULL);
  3847.     for (slot = 0; slot < 13; slot++)
  3848.     {
  3849.         const struct weapon_entry* weapon = weapon_list;
  3850.  
  3851.         snprintf(name, sizeof(name), "\tSlot %d", slot);
  3852.         menu_item_add(menu_weapons, NULL, name, ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3853.  
  3854.         while (weapon->name != NULL)
  3855.         {
  3856.             if (weapon->slot == slot)
  3857.                 menu_item_add(menu_weapons, NULL, weapon->name, ID_WEAPON_ITEM, MENU_COLOR_DEFAULT, (void*)weapon);
  3858.             weapon++;
  3859.         }
  3860.     }
  3861.  
  3862.     /* main menu -> vehicles */
  3863.     for (i = 0; i < VEHICLE_CLASS_COUNT; i++)
  3864.     {
  3865.         struct menu* menu = menu_new(menu_vehicles, ID_MENU_VEHICLES_SUB, menu_callback_vehicles_sub);
  3866.  
  3867.         snprintf(name, sizeof(name), "%s", gta_vehicle_class_name(i));
  3868.         menu_item_add(menu_vehicles, menu, name, ID_NONE, MENU_COLOR_DEFAULT, (void*)(UINT_PTR)i);
  3869.     }
  3870.  
  3871.     menu_item_add(menu_vehicles, NULL, "Freeze nearby vehicles", ID_VEHICLES_FREEZE, MENU_COLOR_DEFAULT, NULL);
  3872.     menu_item_add(menu_vehicles, NULL, "Warp vehicles to you", ID_VEHICLES_IWARP, MENU_COLOR_DEFAULT, NULL);
  3873.  
  3874.  
  3875.     /* main menu -> patches */
  3876.     for (i = 0; i < INI_PATCHES_MAX; i++)
  3877.     {
  3878.         if (set.patch[i].name == NULL)
  3879.             continue;
  3880.  
  3881.         menu_item_add(menu_patches, NULL, set.patch[i].name, i, MENU_COLOR_DEFAULT, NULL);
  3882.     }
  3883.  
  3884.     if (g_dwSAMP_Addr != NULL)
  3885.     {
  3886.         /* main menu -> players */
  3887.         menu_item_add(menu_players, menu_players_warp, "Warp to player", ID_MENU_PLAYERS_WARP, MENU_COLOR_DEFAULT, NULL);
  3888.         menu_item_add(menu_players, menu_players_vehwarp, "Warp instantly to player's vehicle", ID_MENU_PLAYERS_VEHWARP, MENU_COLOR_DEFAULT, NULL);
  3889.         menu_item_add(menu_players, menu_players_spec, "Spectate player", ID_MENU_PLAYERS_SPEC, MENU_COLOR_DEFAULT, NULL);
  3890.         menu_item_add(menu_players, menu_player_info, "Show infos on player", ID_MENU_PLAYERS_INFO, MENU_COLOR_DEFAULT, NULL);
  3891.         menu_item_add(menu_players, menu_players_mute, "Mute player chat (Anti-spam)", ID_MENU_PLAYERS_MUTE, MENU_COLOR_DEFAULT, NULL);
  3892.  
  3893.         // net patches
  3894.         menu_item_add(menu_samppatches, menu_netpatches_inrpc, "Disable incoming RPC", ID_MENU_NETPATCHES_INRPC, MENU_COLOR_DEFAULT, NULL);
  3895.         menu_item_add(menu_samppatches, menu_netpatches_outrpc, "Disable outcoming RPC", ID_MENU_NETPATCHES_OUTRPC, MENU_COLOR_DEFAULT, NULL);
  3896.         menu_item_add(menu_samppatches, menu_netpatches_inpacket, "Disable incoming packet", ID_MENU_NETPATCHES_INPACKET, MENU_COLOR_DEFAULT, NULL);
  3897.         menu_item_add(menu_samppatches, menu_netpatches_outpacket, "Disable outcoming packet", ID_MENU_NETPATCHES_OUTPACKET, MENU_COLOR_DEFAULT, NULL);
  3898.         menu_item_add(menu_netpatches_inrpc, NULL, "Toggle all", ID_MENU_NETPATCHES_TOGGLE_ALL, MENU_COLOR_DEFAULT, NULL);
  3899.         menu_item_add(menu_netpatches_outrpc, NULL, "Toggle all", ID_MENU_NETPATCHES_TOGGLE_ALL, MENU_COLOR_DEFAULT, NULL);
  3900.         menu_item_add(menu_netpatches_inpacket, NULL, "Toggle all", ID_MENU_NETPATCHES_TOGGLE_ALL, MENU_COLOR_DEFAULT, NULL);
  3901.         menu_item_add(menu_netpatches_outpacket, NULL, "Toggle all", ID_MENU_NETPATCHES_TOGGLE_ALL, MENU_COLOR_DEFAULT, NULL);
  3902.  
  3903.         int netPatchNumber[4] = { 1, 1, 1, 1 };
  3904.         for (i = 0; i < iNetPatchesCount; ++i)
  3905.         {
  3906.             menu* pmenu = nullptr;
  3907.             stNetPatch& patch = set.netPatch[i];
  3908.             sprintf_s(name, "%d. %s", netPatchNumber[patch.type]++, patch.name);
  3909.             switch (patch.type)
  3910.             {
  3911.             case INCOMING_RPC: pmenu = menu_netpatches_inrpc; break;
  3912.             case OUTCOMING_RPC: pmenu = menu_netpatches_outrpc; break;
  3913.             case INCOMING_PACKET: pmenu = menu_netpatches_inpacket; break;
  3914.             case OUTCOMING_PACKET: pmenu = menu_netpatches_outpacket; break;
  3915.             }
  3916.             if (pmenu != nullptr)
  3917.                 menu_item_add(pmenu, NULL, name, i, MENU_COLOR_DEFAULT, NULL);
  3918.         }
  3919.  
  3920.         // samp patches
  3921.         for (i = 0; i < INI_SAMPPATCHES_MAX; i++)
  3922.         {
  3923.             if (set.sampPatch[i].name == NULL)
  3924.                 continue;
  3925.  
  3926.             menu_item_add(menu_samppatches, NULL, set.sampPatch[i].name, i, MENU_COLOR_DEFAULT, NULL);
  3927.         }
  3928.  
  3929.         // server list
  3930.         menu_item_add(menu_servers, NULL, "Keep your current nickname", INI_SERVERS_MAX + 1, MENU_COLOR_DEFAULT, NULL);
  3931.         menu_item_add(menu_servers, NULL, "\tServers", ID_NONE, MENU_COLOR_SEPARATOR, NULL);
  3932.         for (i = 0; i < INI_SERVERS_MAX; i++)
  3933.         {
  3934.             if (set.server[i].server_name == NULL)
  3935.                 continue;
  3936.  
  3937.             menu_item_add(menu_servers, NULL, set.server[i].server_name, i, MENU_COLOR_DEFAULT, NULL);
  3938.         }
  3939.     }
  3940.  
  3941.     /* teleports */
  3942.     menu_item_add(menu_teleports, menu_interiors, "Teleport to interiors", STATIC_TELEPORT_MAX + 1, MENU_COLOR_DEFAULT,
  3943.         NULL);
  3944.     for (i = 0; i < 146; i++)
  3945.     {
  3946.         menu_item_add(menu_interiors, NULL, interiors_list[i].interior_name, i, MENU_COLOR_DEFAULT, NULL);
  3947.     }
  3948.  
  3949.     for (i = 0; i < STATIC_TELEPORT_MAX; i++)
  3950.     {
  3951.         if (strlen(set.static_teleport_name[i]) == 0)
  3952.             continue;
  3953.  
  3954.         if (vect3_near_zero(set.static_teleport[i].pos))
  3955.             continue;
  3956.  
  3957.         menu_item_add(menu_teleports, NULL, set.static_teleport_name[i], i, MENU_COLOR_DEFAULT, NULL);
  3958.     }
  3959.  
  3960.     /* misc */
  3961.     menu_item_add(menu_misc, menu_debug, "Debug", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3962.     menu_item_add(menu_misc, NULL, "Write coordinates to log file", ID_MISC_COORDS, MENU_COLOR_DEFAULT, NULL);
  3963.     menu_item_add(menu_misc, NULL, "Reload settings", ID_MISC_RELOAD, MENU_COLOR_DEFAULT, NULL);
  3964.     menu_item_add(menu_misc, NULL, "Enable HUD text", ID_MISC_HUDTEXT, MENU_COLOR_DEFAULT, NULL);
  3965.     menu_item_add(menu_misc, NULL, "Disable bad weapons", ID_MISC_BAD_WEAPONS, MENU_COLOR_DEFAULT, NULL);
  3966.     menu_item_add(menu_misc, NULL, "Trailer support", ID_MISC_TRAILERS, MENU_COLOR_DEFAULT, NULL);
  3967.     menu_item_add(menu_misc, menu_hudindicators, "Toggle HUD indicators", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3968.     snprintf(name, sizeof(name), "FPS limit: %d", set.fps_limit);
  3969.     menu_item_add(menu_misc, NULL, name, ID_MISC_FPSLIMIT, MENU_COLOR_DEFAULT, NULL);
  3970.     menu_item_add(menu_misc, NULL, "Toggle windowed mode", ID_MISC_TOGGLEWINDOWED, MENU_COLOR_DEFAULT, NULL);
  3971. #ifdef __CHEAT_VEHRECORDING_H__
  3972.     menu_item_add(menu_misc, menu_routes, "Routes", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3973. #endif
  3974.  
  3975.     /* misc -> debug */
  3976.     menu_item_add(menu_debug, NULL, "Enable", ID_DEBUG_ENABLE, MENU_COLOR_DEFAULT, NULL);
  3977.     menu_item_add(menu_debug, NULL, "Self actor", ID_DEBUG_SELF_ACTOR, MENU_COLOR_DEFAULT, NULL);
  3978.     menu_item_add(menu_debug, NULL, "Self vehicle", ID_DEBUG_SELF_VEHICLE, MENU_COLOR_DEFAULT, NULL);
  3979.  
  3980.     if (g_dwSAMP_Addr != NULL)
  3981.     {
  3982.         menu_item_add(menu_debug, NULL, "SA:MP DLL", ID_DEBUG_SAMP_DLL, MENU_COLOR_DEFAULT, NULL);
  3983.         menu_item_add(menu_debug, NULL, "SA:MP Info", ID_DEBUG_SAMP_INFO, MENU_COLOR_DEFAULT, NULL);
  3984.         menu_item_add(menu_debug, NULL, "SA:MP Player List", ID_DEBUG_SAMP_PLAYER_LIST, MENU_COLOR_DEFAULT, NULL);
  3985.         menu_item_add(menu_debug, NULL, "SA:MP Local info", ID_DEBUG_SAMP_LOCAL_INFO, MENU_COLOR_DEFAULT, NULL);
  3986.         menu_item_add(menu_debug, NULL, "SA:MP Vehicle List", ID_DEBUG_SAMP_VEHICLE_LIST, MENU_COLOR_DEFAULT, NULL);
  3987.         menu_item_add(menu_debug, NULL, "SA:MP Chat info", ID_DEBUG_SAMP_CHAT_INFO, MENU_COLOR_DEFAULT, NULL);
  3988.         menu_item_add(menu_debug, NULL, "SA:MP Input info", ID_DEBUG_SAMP_CHAT_IPT_INFO, MENU_COLOR_DEFAULT, NULL);
  3989.         menu_item_add(menu_debug, NULL, "SA:MP Kill info", ID_DEBUG_SAMP_KILL_INFO, MENU_COLOR_DEFAULT, NULL);
  3990.         menu_item_add(menu_debug, NULL, "SA:MP Local SAMP-PED", ID_DEBUG_SAMP_LOCAL_SAMPPED, MENU_COLOR_DEFAULT, NULL);
  3991.     }
  3992.  
  3993. #ifdef __CHEAT_VEHRECORDING_H__
  3994.     /* misc -> routes */
  3995.     menu_item_add(menu_routes, NULL, "Enable Routes function", ID_ROUTES_ACTIVATED, MENU_COLOR_DEFAULT, NULL);
  3996.     menu_item_add(menu_routes, menu_routes_load, "Load Route", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3997.     menu_item_add(menu_routes, menu_routes_drop, "Delete Route", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  3998.     menu_item_add(menu_routes, NULL, "Save current Route", ID_ROUTES_WRITE, MENU_COLOR_DEFAULT, NULL);
  3999.     menu_item_add(menu_routes, NULL, "Optimize Database (Rebuild)", ID_ROUTES_OPTIMIZE, MENU_COLOR_DEFAULT, NULL);
  4000. #endif
  4001.  
  4002.     // misc -> HUD indicators
  4003.     menu_item_add(menu_hudindicators, NULL, "Draw bottom bar", ID_HUDIND_BAR, MENU_COLOR_DEFAULT, NULL);
  4004.     menu_item_add(menu_hudindicators, NULL, "Render text shadows", ID_HUDIND_TSHADOWS, MENU_COLOR_DEFAULT, NULL);
  4005.     menu_item_add(menu_hudindicators, NULL, "Inv", ID_HUDIND_INV, MENU_COLOR_DEFAULT, NULL);
  4006.     menu_item_add(menu_hudindicators, NULL, "Weapon", ID_HUDIND_WEAPON, MENU_COLOR_DEFAULT, NULL);
  4007.     menu_item_add(menu_hudindicators, NULL, "Money", ID_HUDIND_MONEY, MENU_COLOR_DEFAULT, NULL);
  4008.     menu_item_add(menu_hudindicators, NULL, "Freeze", ID_HUDIND_FREEZE, MENU_COLOR_DEFAULT, NULL);
  4009.     menu_item_add(menu_hudindicators, NULL, "In vehicle AirBrk", ID_HUDIND_INVEH_AIRBRK, MENU_COLOR_DEFAULT, NULL);
  4010.     menu_item_add(menu_hudindicators, NULL, "In vehicle Stick", ID_HUDIND_INVEH_STICK, MENU_COLOR_DEFAULT, NULL);
  4011.     menu_item_add(menu_hudindicators, NULL, "In vehicle BrkDance", ID_HUDIND_INVEH_BRKDANCE, MENU_COLOR_DEFAULT, NULL);
  4012.     menu_item_add(menu_hudindicators, NULL, "In vehicle SpiderWheels", ID_HUDIND_INVEH_SPIDER, MENU_COLOR_DEFAULT, NULL);
  4013.     menu_item_add(menu_hudindicators, NULL, "In vehicle Fly", ID_HUDIND_INVEH_FLY, MENU_COLOR_DEFAULT, NULL);
  4014.     menu_item_add(menu_hudindicators, NULL, "On foot AirBrk", ID_HUDIND_ONFOOT_AIRBRK, MENU_COLOR_DEFAULT, NULL);
  4015.     menu_item_add(menu_hudindicators, NULL, "On foot Stick", ID_HUDIND_ONFOOT_STICK, MENU_COLOR_DEFAULT, NULL);
  4016.     menu_item_add(menu_hudindicators, NULL, "On foot Fly", ID_HUDIND_ONFOOT_FLY, MENU_COLOR_DEFAULT, NULL);
  4017.     //menu_item_add( menu_hudindicators, NULL, "Aim", ID_HUDIND_ONFOOT_AIM, MENU_COLOR_DEFAULT, NULL );
  4018.     menu_item_add(menu_hudindicators, NULL, "Surf", ID_HUDIND_SURF, MENU_COLOR_DEFAULT, NULL);
  4019.     menu_item_add(menu_hudindicators, NULL, "FreezeRot", ID_HUDIND_FREEZEROT, MENU_COLOR_DEFAULT, NULL);
  4020.  
  4021.     menu_item_add(menu_hudindicators, NULL, "Position", ID_HUDIND_POS, MENU_COLOR_DEFAULT, NULL);
  4022.     menu_item_add(menu_hudindicators, NULL, "FPS", ID_HUDIND_FPS, MENU_COLOR_DEFAULT, NULL);
  4023.     menu_item_add(menu_hudindicators, NULL, "Toggle left bottom bars", ID_HUDIND_LB_BARS, MENU_COLOR_DEFAULT, NULL);
  4024.  
  4025.     if (g_dwSAMP_Addr != NULL)
  4026.     {
  4027.         // main menu -> sampmisc
  4028.         menu_item_add(menu_sampmisc, menu_vehicles_instant, "Warp instantly to vehicle", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  4029.         menu_item_add(menu_sampmisc, menu_fake_kill, "Fake kill", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  4030.         menu_item_add(menu_sampmisc, menu_spoof_weapon, "Spoof weapon", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  4031.         menu_item_add(menu_sampmisc, NULL, "Player info list", ID_MENU_SAMPMISC_SAMP_INFO_LIST, MENU_COLOR_DEFAULT, NULL);
  4032.         menu_item_add(menu_sampmisc, NULL, "Replace chat text rendering", ID_MENU_SAMPMISC_CHAT_TEXT, MENU_COLOR_DEFAULT, NULL);
  4033.         snprintf(name, sizeof(name), "Display chat lines: %d", set.d3dtext_chat_lines);
  4034.         menu_item_add(menu_sampmisc, NULL, name, ID_MENU_SAMPMISC_CHAT_TEXTLINES, MENU_COLOR_DEFAULT, NULL);
  4035.         menu_item_add(menu_sampmisc, menu_gamestate, "Change game state", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  4036.         menu_item_add(menu_sampmisc, menu_specialaction, "Special action", ID_NONE, MENU_COLOR_DEFAULT, NULL);
  4037.         menu_item_add(menu_sampmisc, NULL, "Drunk", ID_MENU_SAMPMISC_SAMP_DRUNK, MENU_COLOR_DEFAULT, NULL);
  4038.         menu_item_add(menu_sampmisc, menu_teleobject, "Teleport to object", ID_MENU_SAMPMISC_TELEOBJECT, MENU_COLOR_DEFAULT, NULL);
  4039.         menu_item_add(menu_sampmisc, NULL, "Render object texts", ID_MENU_SAMPMISC_RENDEROBJTXT, MENU_COLOR_DEFAULT, NULL);
  4040.         menu_item_add(menu_sampmisc, menu_telepickup, "Teleport to pickup", ID_MENU_SAMPMISC_TELEPICKUP, MENU_COLOR_DEFAULT, NULL);
  4041.         menu_item_add(menu_sampmisc, NULL, "Render pickup texts", ID_MENU_SAMPMISC_RENDERPCKTXT, MENU_COLOR_DEFAULT, NULL);
  4042.         menu_item_add(menu_sampmisc, NULL, "Load M0D-Commands", ID_MENU_SAMPMISC_M0DCOMMANDS, MENU_COLOR_DEFAULT, NULL);
  4043.         menu_item_add(menu_sampmisc, NULL, "Extra godmode", ID_MENU_SAMPMISC_EXTRAGM, MENU_COLOR_DEFAULT, NULL);
  4044.  
  4045.         /* main menu -> sampmisc -> change game state */
  4046.         menu_item_add(menu_gamestate, NULL, "Connecting", GAMESTATE_CONNECTING, MENU_COLOR_DEFAULT, NULL);
  4047.         menu_item_add(menu_gamestate, NULL, "Connected", GAMESTATE_CONNECTED, MENU_COLOR_DEFAULT, NULL);
  4048.         menu_item_add(menu_gamestate, NULL, "Await join", GAMESTATE_AWAIT_JOIN, MENU_COLOR_DEFAULT, NULL);
  4049.         menu_item_add(menu_gamestate, NULL, "Game mode restarting", GAMESTATE_RESTARTING, MENU_COLOR_DEFAULT, NULL);
  4050.         menu_item_add(menu_gamestate, NULL, "Wait connect", GAMESTATE_WAIT_CONNECT, MENU_COLOR_DEFAULT, NULL);
  4051.  
  4052.         /* main menu -> sampmisc -> special action */
  4053.         menu_item_add(menu_specialaction, NULL, "None", ID_MENU_SPECIAL_ACTION_NONE, MENU_COLOR_DEFAULT, NULL);
  4054.         menu_item_add(menu_specialaction, NULL, "Smoke Blunt", ID_MENU_SPECIAL_ACTION_SMOKE_CIGGY, MENU_COLOR_DEFAULT, NULL);
  4055.         menu_item_add(menu_specialaction, NULL, "Drink Beer", ID_MENU_SPECIAL_ACTION_DRINK_BEER, MENU_COLOR_DEFAULT, NULL);
  4056.         menu_item_add(menu_specialaction, NULL, "Drink Wine", ID_MENU_SPECIAL_ACTION_DRINK_WINE, MENU_COLOR_DEFAULT, NULL);
  4057.         menu_item_add(menu_specialaction, NULL, "Drink Sprunk", ID_MENU_SPECIAL_ACTION_DRINK_SPRUNK, MENU_COLOR_DEFAULT, NULL);
  4058.         menu_item_add(menu_specialaction, NULL, "Use Jetpack", ID_MENU_SPECIAL_ACTION_USEJETPACK, MENU_COLOR_DEFAULT, NULL);
  4059.         menu_item_add(menu_specialaction, NULL, "Dance1", ID_MENU_SPECIAL_ACTION_DANCE1, MENU_COLOR_DEFAULT, NULL);
  4060.         menu_item_add(menu_specialaction, NULL, "Dance2", ID_MENU_SPECIAL_ACTION_DANCE2, MENU_COLOR_DEFAULT, NULL);
  4061.         menu_item_add(menu_specialaction, NULL, "Dance3", ID_MENU_SPECIAL_ACTION_DANCE3, MENU_COLOR_DEFAULT, NULL);
  4062.         menu_item_add(menu_specialaction, NULL, "Dance4", ID_MENU_SPECIAL_ACTION_DANCE4, MENU_COLOR_DEFAULT, NULL);
  4063.         menu_item_add(menu_specialaction, NULL, "Hands Up", ID_MENU_SPECIAL_ACTION_HANDSUP, MENU_COLOR_DEFAULT, NULL);
  4064.         menu_item_add(menu_specialaction, NULL, "Use Cellphone", ID_MENU_SPECIAL_ACTION_USECELLPHONE, MENU_COLOR_DEFAULT, NULL);
  4065.         menu_item_add(menu_specialaction, NULL, "Stop Use Cellphone", ID_MENU_SPECIAL_ACTION_STOPUSECELLPHONE, MENU_COLOR_DEFAULT, NULL);
  4066.         menu_item_add(menu_specialaction, NULL, "Cuffed", ID_MENU_SPECIAL_ACTION_CUFFED, MENU_COLOR_DEFAULT, NULL);
  4067.         menu_item_add(menu_specialaction, NULL, "Carry", ID_MENU_SPECIAL_ACTION_CARRY, MENU_COLOR_DEFAULT, NULL);
  4068.         menu_item_add(menu_specialaction, NULL, "Urinate", ID_MENU_SPECIAL_ACTION_URINATE, MENU_COLOR_DEFAULT, NULL);
  4069.  
  4070.         /* main menu -> sampmisc -> fake weapon */
  4071.         for (i = 0; weapon_list[i].name != NULL; i++)
  4072.         {
  4073.             const struct weapon_entry* weapon = &weapon_list[i];
  4074.  
  4075.             if (strcmp(weapon->name, "Camera") == 0
  4076.                 || strcmp(weapon->name, "NV Goggles") == 0
  4077.                 || strcmp(weapon->name, "IR Goggles") == 0
  4078.                 || strcmp(weapon->name, "Parachute") == 0
  4079.                 || strcmp(weapon->name, "Detonator") == 0) continue;
  4080.  
  4081.             snprintf(name, sizeof(name), "Fake killed by %s", weapon->name);
  4082.             menu_item_add(menu_spoof_weapon, NULL, name, ID_MENU_SAMPMISC_SPOOF_WEAPON, MENU_COLOR_DEFAULT,
  4083.                 (void*)(UINT_PTR)weapon->id);
  4084.         }
  4085.  
  4086.         menu_item_add(menu_spoof_weapon, NULL, "Fake death by fall", ID_MENU_SAMPMISC_SPOOF_WEAPON, MENU_COLOR_DEFAULT,
  4087.             (void*)(UINT_PTR)20);
  4088.         menu_item_add(menu_spoof_weapon, NULL, "Fake begin run over", ID_MENU_SAMPMISC_SPOOF_WEAPON, MENU_COLOR_DEFAULT,
  4089.             (void*)(UINT_PTR)21);
  4090.     }
  4091.  
  4092.     menu_active = menu_main;
  4093. }
  4094.  
  4095. static void menu_free(struct menu* menu)
  4096. {
  4097.     traceLastFunc("menu_free");
  4098.     int i;
  4099.  
  4100.     if (menu->parent != NULL)
  4101.     {
  4102.         for (i = 0; i < menu->count; i++)
  4103.         {
  4104.             if (menu->item[i].submenu != NULL)
  4105.             {
  4106.                 menu_free(menu->item[i].submenu);
  4107.                 if (menu->item[i].name != NULL)
  4108.                     free((void*)menu->item[i].name);
  4109.             }
  4110.         }
  4111.     }
  4112.  
  4113.     /*if(menu->parent != NULL)
  4114.    {
  4115.       struct menu *parent = menu->parent;
  4116.       for(i=0; i<parent->count; i++)
  4117.       {
  4118.          if(menu->item[i].submenu == menu)
  4119.             menu->item[i].submenu = NULL;
  4120.       }
  4121.    }*/
  4122.     free(menu->item);
  4123.     free(menu);
  4124. }
  4125.  
  4126. void menu_items_free(struct menu* menu)
  4127. {
  4128.     int i;
  4129.  
  4130.     if (menu == NULL)
  4131.         return;
  4132.  
  4133.     for (i = 0; i < menu->count; i++)
  4134.     {
  4135.         if (menu->item[i].submenu != NULL)
  4136.         {
  4137.             menu_free(menu->item[i].submenu);
  4138.             if (menu->item[i].name != NULL)
  4139.                 free((void*)menu->item[i].name);
  4140.         }
  4141.     }
  4142.  
  4143.     free(menu->item);
  4144.     menu->item = NULL;
  4145.     menu->count = 0;
  4146.     menu->pos = 0;
  4147.     menu->top_pos = 0;
  4148. }
  4149.  
  4150. void menu_free_all(void)
  4151. {
  4152.     struct menu* menu;
  4153.  
  4154.     if (menu_active == NULL)
  4155.         return;
  4156.  
  4157.     /* find root menu */
  4158.     for (menu = menu_active; menu->parent != NULL; menu = menu->parent);
  4159.  
  4160.     menu_free(menu);
  4161.     menu_active = NULL;
  4162.     menu_init = 0;
  4163. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement