public static async Task PetCompanion() { int player = Game.Player.Character.Handle; if (API.IsPedInAnyHeli(player)) { Hud.Notification("Don't spawn that poor pet on a heli"); return; } else if (API.IsPedInAnyVehicle(player, false)) { var vehicle = API.GetVehiclePedIsIn(player, false); if (API.GetVehicleDashboardSpeed(vehicle) > 0.1f) { Hud.Notification("Player is in a moving vehicle"); return; } } var ped = await Peds.Spawn(Config.PetList, 28); Companions.Add(ped); await Peds.Arm(ped, null); API.SetEntityAsNoLongerNeeded(ref ped); }
public static async Task PocceCompanion() { int ped; int player = Game.Player.Character.Handle; if (API.IsPedInAnyVehicle(player, false)) { var vehicle = API.GetVehiclePedIsIn(player, false); if (Vehicles.GetFreeSeat(vehicle, out int seat)) { var pocce = Config.PocceList[API.GetRandomIntInRange(0, Config.PocceList.Length)]; await Common.RequestModel(pocce); ped = API.CreatePedInsideVehicle(vehicle, 26, pocce, seat, true, false); } else if (API.GetEntitySpeed(vehicle) > 0.1f) { Hud.Notification("Player is in a moving vehicle and there are no free seats"); return; } else { ped = await Peds.Spawn(Config.PocceList); } } else { ped = await Peds.Spawn(Config.PocceList); } Companions.Add(ped); await Peds.Arm(ped, Config.WeaponList); API.SetEntityAsNoLongerNeeded(ref ped); }
public static async Task SpawnTrashPed() { var ped = await Peds.Spawn(Config.TrashPedList); Peds.Burn(ped); API.SetPedAsNoLongerNeeded(ref ped); }
public static async Task SpawnTrashPed() { var ped = await Peds.Spawn(Config.TrashPedList); await Delay(500); Common.Burn(ped); API.SetEntityAsNoLongerNeeded(ref ped); }
private static async Task PocceRiot(bool useWeapons) { var peds = new List <int>(); var weapons = useWeapons ? Config.WeaponList : null; for (int i = 0; i < 4; ++i) { int ped1 = await Peds.Spawn(Config.PocceList); int ped2 = await Peds.Spawn(Config.PocceList); peds.Add(ped1); peds.Add(ped2); await Peds.Arm(ped1, weapons); await Peds.Arm(ped2, weapons); API.TaskCombatPed(ped1, ped2, 0, 16); API.TaskCombatPed(ped2, ped1, 0, 16); } for (int i = 0; i < 4; ++i) { int ped = await Peds.Spawn(Config.PocceList); peds.Add(ped); await Peds.Arm(ped, weapons); API.TaskCombatPed(ped, API.GetPlayerPed(-1), 0, 16); } foreach (int ped in peds) { int tmp_ped = ped; API.SetPedAsNoLongerNeeded(ref tmp_ped); } }