/// <summary> /// Determines whether the specified ped is grabbed. /// </summary> /// <param name="ped"></param> /// <returns><c>true</c> if the ped is grabbed; otherwise, <c>false</c>.</returns> public static bool IsPedGrabbed(Ped ped) { if (PedManager.IsGrabEnabled) { return(ped.Equals(PedManager.FollowingPed)); } else { return(false); } }
/// <summary> /// Returns a boolean indicating if the specified ped is grabbed or not. /// </summary> /// <param name="ped"></param> /// <returns></returns> public static bool IsPedGrabbed(Ped ped) { if (PedManager.EnableGrab) { return(ped.Equals(PedManager.pedfollowing)); } else { return(false); } }
public static void SetAsCriminalWhoIs(Ped p, string type) { if (!ThereIs(p)) { return; } int relationship = p.Equals(Game.Player.Character) ? playerID : type == "ARMY" ? pedTerrorist : pedCriminal; List <int> relationshipGroup = type == "ARMY" ? armyRelationships : copRelationships; foreach (int i in relationshipGroup.FindAll(r => !World.GetRelationshipBetweenGroups(relationship, r).Equals(Relationship.Hate))) { World.SetRelationshipBetweenGroups(Relationship.Hate, relationship, i); } if (relationship != playerID) { p.RelationshipGroup = relationship; } }
private bool isVehicleConsideredEmpty(Vehicle vehicle) { return(!vehicle.Equals(player.VehicleTryingToEnter) && !player.Equals(vehicle.Driver) && !vehiclesWithPeds.Contains(vehicle)); }
private bool IsPedAlloedToAssignVehicle(Ped ped) { return(ped.IsGettingIntoVehicle && (Vehicle)tryingToEnterVehclesWithPeds[ped] != null && !player.Equals(ped.VehicleTryingToEnter.Driver)); }
public bool IsCreatedIn(float radius) { if (relationship == 0) { return(false); } Ped[] nearbyPeds = World.GetNearbyPeds(Game.Player.Character.Position, radius); if (nearbyPeds.Length < 1) { Logger.Error("Carjacker: Couldn't find peds nearby. Abort", ""); return(false); } this.radius = radius; for (int i = 0; i < 5; i++) { Ped selectedPed = nearbyPeds[Util.GetRandomIntBelow(nearbyPeds.Length)]; if (!Util.WeCanGiveTaskTo(selectedPed) || Util.BlipIsOn(selectedPed) || selectedPed.IsPersistent || selectedPed.Equals(Game.Player.Character) || !selectedPed.IsHuman) { Logger.Write(false, "Carjacker: Couldn't use selected ped.", ""); continue; } Logger.Write(false, "Carjacker: Found proper ped.", ""); spawnedPed = selectedPed; spawnedPed.IsPersistent = true; spawnedPed.IsPriorityTargetForEnemies = true; spawnedPed.AlwaysKeepTask = true; spawnedPed.BlockPermanentEvents = true; Logger.Write(false, "Carjacker: Characteristics are set.", ""); if (spawnedPed.IsInVehicle()) { lastVehicle = spawnedPed.CurrentVehicle.Handle; } Util.AddBlipOn(spawnedPed, 0.7f, BlipSprite.Masks, BlipColor.White, "Carjacker"); Logger.Write(false, "Carjacker: Selected carjacker successfully.", ""); FindNewVehicle(); return(true); } Logger.Error("Carjacker: Couldn't select carjacker. Abort.", ""); Restore(true); return(false); }
void CheckPeds(List <Ped> targetList) { Ped player = Game.Player.Character; foreach (Ped ped in targetList) {/* * bool isNear = false; * if (World.GetDistance(player.Position, ped.Position) < 100f) * { * isNear = true; * //UI.Notify("nearly " + ped.Handle.ToString()); * } * * //Cleaning Up far away Peds * if (!isNear) * { * LöschIndizies.Add(ped); * }*/ //else { //setting Up Tasks: Every one who idle goto the enemy spawnpoint if (ped.IsIdle) { if (targetList == managedPedsTeamA) { ped.Task.RunTo(spawnLocB); } if (targetList == managedPedsTeamB) { ped.Task.RunTo(spawnLocA); } } } //Cleaning Up death Peds if (ped.IsDead & deletepeds) // Puts death ped onto the delete-list { Ped killer = ped.GetKiller() as Ped; if (killer != null) { if (!LöschIndizies.Contains(ped)) { if (IsPedInTeam(killer, managedPedsTeamA)) { PointsTeamA++; } if (IsPedInTeam(killer, managedPedsTeamB)) { PointsTeamB++; } if (killer.Equals(player)) { PointsTeamB++; } LöschIndizies.Add(ped); //UI.Notify(killer.Handle.ToString() + " kills " + ped.Handle.ToString()); } } } } /* * //Delete noted Peds * foreach (Ped lped in LöschIndizies) * { * targetList.Remove(lped); * //UI.Notify("Remove " + lped.Handle.ToString()); * lped.Delete(); * } */ //UI.Notify(PointsTeamA.ToString() + " : " + PointsTeamB.ToString()); }