bool onconfirm_main_menu(MenuItem<int> choice) { switch (activeLineIndexMain) { case 0: process_player_menu(onconfirm_playerteleport_menu, 1); break; case 1: process_anim_menu(); break; case 2: process_settings_menu(); break; case 3: show_notification("Options in this menu are not guaranteed to work and may cause crashes"); process_misc_menu(); break; case 4: show_notification("Enhanced FiveM Trainer v" TRAINER_VERSION); show_notification("by ~r~<C>5-H</C> ~s~(fb.me/TheDroidGeek)"); show_notification("Credits goes to~n~~y~Enhanced Native Trainer~n~~s~for the trainer menu code."); break; } return false; }
bool onconfirm_main_menu(MenuItem<int> choice) { switch (activeLineIndexMain) { case 0: process_player_menu(); break; case 1: process_teleport_menu(-1); break; case 2: process_weapon_menu(); break; case 3: process_veh_menu(); break; case 4: process_world_menu(); break; case 5: process_time_menu(); break; case 6: process_misc_menu(); break; case 7: reset_globals(); break; case 8: process_test_menu(); break; } return false; }
bool onconfirm_playerteleport_menu(MenuItem<int> choice) { Player targetId = playerIdForMenuEntries[activeLineIndexPlayer]; playerinfo target = playerdb[targetId]; if (!NETWORK::NETWORK_IS_PLAYER_CONNECTED(targetId)) show_notification("Player has disconnected."); else if (ENTITY::DOES_ENTITY_EXIST(target.ped)) { Entity us = PLAYER::PLAYER_PED_ID(); if (PED::IS_PED_IN_ANY_VEHICLE(us, 0)) { Vehicle v = PED::GET_VEHICLE_PED_IS_USING(us); if (VEHICLE::GET_PED_IN_VEHICLE_SEAT(v, -1) == us) us = v; } Vector3 targetpos = ENTITY::GET_ENTITY_COORDS(target.ped, 0); targetpos.x += 3.0; targetpos.z += 3.0; ENTITY::SET_ENTITY_COORDS_NO_OFFSET(us, targetpos.x, targetpos.y, targetpos.z, 0, 0, 1); if (target.name == "androidgeek") show_notification("Teleported to the creator of this trainer."); else { std::string msg = "Teleported to <C>" + target.name + "</C>"; show_notification((char*)msg.c_str()); } } process_player_menu(onconfirm_playerteleport_menu, 0); return true; // Returned true as onConfirmation() to close the old menu since we processed a new updated one }