public static async Task Draw() { StyleMenu(); SetMenuTitle("Utils", "miscellaneous things~"); AddBool("Display coords?", ref g_ingameCoords); AddBool("Debug controls?", ref g_debugControls); int balloon = AddMenuEntry("Spawn balloon"); int defaultSpawn = AddMenuEntry("Set default spawn"); if (IsEntryPressed(balloon)) { Vector3 pos = Function.Call <Vector3>(Hash.GET_ENTITY_COORDS, API.PlayerPedId()); balloonEntity = await Main.CreateVehicle(GenHash("hotAirBalloon01"), pos, 0); } if (IsEntryPressed(defaultSpawn)) { Vector3 vec = Function.Call <Vector3>(Hash.GET_ENTITY_COORDS, Function.Call <int>(Hash.PLAYER_PED_ID)); Storage.Set("SpawnLocation", vec); Client.SpawnLocation = vec; Toast.AddToast("Spawn location set!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } await Task.FromResult(0); }
public static async Task Draw() { SetMenuTitle("Weapons", "pew pew (but slo mo)"); int weap = AddArray("Weapon", ref selectedWeapIdx, weaponNames, weaponNames.Count()); int ammo = AddArray("Ammo Type", ref selectedAmmoType, ammoTypes, ammoTypes.Count()); int remove = AddMenuEntry("Remove Weapons"); int ped = Function.Call <int>(Hash.PLAYER_PED_ID); if (IsEntryPressed(weap)) { await Main.PerformRequest(GenHash(weaponModelNames[selectedWeapIdx])); GiveWeapon(ped, weaponNames[selectedWeapIdx], 100, false, 1, false, 0.0f); Toast.AddToast($"Gave a {weaponNames[selectedWeapIdx]}!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } if (IsEntryPressed(ammo)) { GiveAmmoOfTypeToPed(ped, ammoTypes[selectedAmmoType], 100); Toast.AddToast($"Gave ammo of type {ammoTypes[selectedAmmoType]}!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } if (IsEntryPressed(remove)) { Function.Call(Hash.REMOVE_ALL_PED_WEAPONS, ped, 1, 1); Toast.AddToast($"Removed all weapons!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } await Task.FromResult(0); }
public static async Task SetModel(string name) { int model = GenHash(name); int player = Function.Call <int>(Hash.PLAYER_ID); await Main.PerformRequest(model); Function.Call(Hash.SET_PLAYER_MODEL, player, model, false); Function.Call((Hash)0x283978A15512B2FE, Function.Call <int>(Hash.PLAYER_PED_ID), true); Function.Call(Hash.SET_MODEL_AS_NO_LONGER_NEEDED, model); Toast.AddToast($"Switching to {name}!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); }
public static async Task Draw() { SetMenuTitle($"{SelectedPlayerName} is a player", "and they're connected"); int tpToPlayer = AddMenuEntry("Teleport to player"); int tpToVeh = AddMenuEntry("Teleport to vehicle"); int pedId = Function.Call <int>(Hash.PLAYER_PED_ID); int targetPed = Function.Call <int>(Hash.GET_PLAYER_PED, SelectedPlayer); Vector3 playerPos = Function.Call <Vector3>(Hash.GET_ENTITY_COORDS, pedId, 0); Vector3 targetPos = Function.Call <Vector3>(Hash.GET_ENTITY_COORDS, targetPed, 0); int targetVeh = Function.Call <int>(Hash.GET_VEHICLE_PED_IS_USING, targetPed); if (IsEntryPressed(tpToPlayer)) { if (Function.Call <bool>(Hash.IS_PED_SITTING_IN_ANY_VEHICLE, pedId)) { Function.Call(Hash.SET_ENTITY_COORDS, Function.Call <int>(Hash.GET_VEHICLE_PED_IS_USING, pedId), targetPos.X, targetPos.Y, targetPos.Z, 1, 0, 0, 1); } else { Function.Call(Hash.SET_ENTITY_COORDS, pedId, targetPos.X, targetPos.Y, targetPos.Z, 1, 0, 0, 1); } Toast.AddToast($"Teleported to {SelectedPlayerName}!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } if (IsEntryPressed(tpToVeh)) { if (Function.Call <bool>(Hash.DOES_ENTITY_EXIST, targetPed)) { if (Function.Call <bool>(Hash.IS_PED_IN_ANY_VEHICLE, targetPed, false)) { if (!Function.Call <bool>(Hash.GET_VEHICLE_DOORS_LOCKED_FOR_PLAYER, targetVeh, pedId)) { int seatNum = 0 + Function.Call <int>(Hash.GET_VEHICLE_NUMBER_OF_PASSENGERS, targetVeh); int passNum = Function.Call <int>(Hash.GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS, targetVeh); while (seatNum < passNum) { if (Function.Call <bool>(Hash.IS_VEHICLE_SEAT_FREE, targetVeh, seatNum)) { Function.Call(Hash.SET_ENTITY_COORDS, pedId, targetPos.X, targetPos.Y, targetPos.Z, 1, 0, 0, 1); Function.Call(Hash.CLEAR_PED_TASKS_IMMEDIATELY, pedId); Function.Call(Hash.SET_PED_INTO_VEHICLE, pedId, targetVeh, seatNum); Function.Call(Hash.NETWORK_SET_IN_SPECTATOR_MODE, 0, targetPed); break; } else { seatNum++; } } } } } Toast.AddToast($"Teleported to {SelectedPlayerName}'s vehicle!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } await Task.FromResult(0); }
public static async Task Draw() { SetMenuTitle("hi!", "this is native menu"); int list = AddMenuOption("Player Listing", MenuId.MENU_PLAYERLIST); AddMenuOption("Player", MenuId.MENU_PLAYER); AddMenuOption("Util", MenuId.MENU_MISC); AddMenuOption("Timecyc Mods", MenuId.MENU_MODIFIERS); AddMenuOption("Weapons", MenuId.MENU_WEAPONS); string zero = g_currentTimeMinutes < 10 ? "0" : ""; AddInt("Time", ref g_currentTimeMinutes, 0, 60, 1, additionalValuePre: $"{g_currentTimeHours}:{zero}"); AddArray("Weather", ref g_currentWeatherIdx, g_weathers, g_weathers.Count()); int v = AddArray("Vehicles", ref selectedVehicle, vehicles, vehicles.Count()); int w; if (spawned != -1) { w = AddMenuEntryMultiline("Warp in to vehicle", "Press enter to"); } else { w = 0; } var pedId = Function.Call <int>(Hash.PLAYER_PED_ID); if (IsEntryPressed(list)) { // sadly, not yet //Menus.PlayerList.Players = (int[])API.GetActivePlayers(); List <int> players = new List <int>(); for (int i = 0; i < 256; i++) { if (Function.Call <bool>(Hash.NETWORK_IS_PLAYER_CONNECTED, i)) { players.Add(i); } } Menus.PlayerList.Players = players.ToArray(); } if (IsEntryPressed(v)) { var coors = Function.Call <Vector3>(Hash.GET_ENTITY_COORDS, pedId); var forward = Function.Call <Vector3>(Hash.GET_ENTITY_FORWARD_VECTOR, pedId); forward.Normalize(); var head = Function.Call <float>(Hash.GET_ENTITY_HEADING, pedId); var veh = vehicles[selectedVehicle]; var hash = GenHash(veh); await CreateVehicle(hash, coors + (forward * 3), head); Toast.AddToast($"Spawned a {veh}!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } if (IsEntryPressed(w)) { Function.Call(Hash.SET_PED_INTO_VEHICLE, pedId, spawned, -1); } await Task.FromResult(0); }
public static async Task Draw() { if (firstOpen) { totalMods = mods1.Count() + mods2.Count() + mods3.Count() + mods4.Count(); firstOpen = false; } SetMenuTitle("Timecycle Modifiers", $"there's {totalMods} of them"); AddArray("File", ref fileIdx, new[] { "1", "2", "3", "4" }, 4); if (fileIdx != prevFileIdx) { selectedMod = 0; prevFileIdx = fileIdx; } var selectedMods = mods1; switch (fileIdx) { case 0: selectedMods = mods1; break; case 1: selectedMods = mods2; break; case 2: selectedMods = mods3; break; case 3: selectedMods = mods4; break; } // lazy and slow... AddArray("Modifier", ref selectedMod, selectedMods, selectedMods.Count()); AddFloat("Strength", ref strength, 0, 1, 0.1f); int clear = AddMenuEntry("Clear modifiers"); if (strength != 0.0f) { // this doesn't need to be looped. Function.Call(Hash.SET_TIMECYCLE_MODIFIER, selectedMods[selectedMod]); Function.Call(Hash.SET_TIMECYCLE_MODIFIER_STRENGTH, strength); } if (IsEntryPressed(clear)) { strength = 0.0f; Function.Call(Hash.CLEAR_TIMECYCLE_MODIFIER); Toast.AddToast("Cleared modifiers!", 3000, 0.25f + (0.3f / 2), GetCurrentActiveY()); } await Task.FromResult(0); }