Exemplo n.º 1
0
 /// <summary>
 /// Objective of type location functionality.
 /// </summary>
 /// <param name="player"></param>
 /// <param name="objInfo"></param>
 public static bool objectiveLocation(Client player, ObjectiveInfo objInfo)
 {
     if (player.position.DistanceTo(objInfo.Location) <= 5)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Used for breaking into vehicles. Acts as a 'capture' point.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        /// <returns></returns>
        public static bool objectiveBreakIntoVehicle(Client player, ObjectiveInfo objInfo)
        {
            if (!isCloseToObjective(player, objInfo.Location, 5))
            {
                return(false);
            }

            if (objInfo.Lockpick.GameInfo.Score >= 100)
            {
                objInfo.Status = true;
                return(true);
            }

            API.shared.triggerClientEvent(player, "Start_Lock_Pick_Minigame");
            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Objective of type Retrieve Vehicle functionality.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        public static bool objectiveRetrieveVehicle(Client player, ObjectiveInfo objInfo)
        {
            if (!player.isInVehicle)
            {
                return(false);
            }

            if (!player.vehicle.hasData("Mission_UID"))
            {
                return(false);
            }

            if (player.vehicle.getData("Mission_UID") != objInfo.UniqueVehicleID)
            {
                return(false);
            }

            objInfo.Status = true;
            return(true);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Objective of type Destruction functionality.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        public static bool objectiveDestroy(Client player, ObjectiveInfo objInfo)
        {
            if (!player.isAiming)
            {
                return(false);
            }

            if (!isCoolDownOver(player))
            {
                return(false);
            }

            objInfo.Progress += 5;

            if (objInfo.Progress < 100)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Objective of type Pickup functionality.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        public static bool objectivePickupObject(Client player, ObjectiveInfo objInfo)
        {
            if (player.isInVehicle)
            {
                return(false);
            }

            if (!isCloseToObjective(player, objInfo.Location, 4))
            {
                return(false);
            }

            player.playAnimation("pickup_object", "pickup_low", (int)(AnimationFlags.StopOnLastFrame));

            API.shared.delay(1500, true, () =>
            {
                player.stopAnimation();
            });

            return(true);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Objective of type player Capture functionality.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        public static bool objectiveCapture(Client player, ObjectiveInfo objInfo)
        {
            if (!isCloseToObjective(player, objInfo.Location, 8))
            {
                return(false);
            }

            if (!isCoolDownOver(player))
            {
                return(false);
            }

            objInfo.Progress += 5;

            if (objInfo.Progress < 100)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Objective of type Vehicle Location functionality.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        public static bool objectiveVehicleLocation(Client player, ObjectiveInfo objInfo)
        {
            if (!player.isInVehicle)
            {
                return(false);
            }

            if (!player.vehicle.hasData("Mission_UID"))
            {
                return(false);
            }

            if (player.vehicle.getData("Mission_UID") != objInfo.UniqueVehicleID)
            {
                return(false);
            }

            if (player.position.DistanceTo(objInfo.Location) >= 5)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Objective of type Vehicle Capture functionality.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="objInfo"></param>
        public static bool objectiveVehicleCapture(Client player, ObjectiveInfo objInfo)
        {
            if (!player.isInVehicle)
            {
                return(false);
            }

            if (!player.vehicle.hasData("Mission_UID"))
            {
                return(false);
            }

            if (player.vehicle.getData("Mission_UID") != objInfo.UniqueVehicleID)
            {
                return(false);
            }

            if (!isCloseToObjective(player, objInfo.Location, 8))
            {
                return(false);
            }

            if (!isCoolDownOver(player))
            {
                return(false);
            }

            objInfo.Progress += 5;

            if (objInfo.Progress < 100)
            {
                return(false);
            }

            return(true);
        }