Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Disable store clerks

Featured Replies

  • Author
1 minute ago, CowNation said:

No clue but you could try teleporting a ped inside the store and then delete all nearby peds

Trying to make a robbery callout, but what would the code be??

 

 is it

Function.Call(Hash.SET_PED_POPULATION_BUDGET, 0); ?

 

cd.png

I have a utils folder for things like that. So I would do Utils.ClearAreaOfPeds(SuspectPos.location, 10f);

 

(that makes the area clear of peds, so if the store clerk is in 10f of the suspect, he'll be deleted. But you can change the feet to whatever really)

Just rename the namespace to what ever it was when you made the .cs file

 

using LSPD_First_Response.Engine.Scripting;
using LSPD_First_Response.Mod.API;
using Rage;
using Rage.Native;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

 

namespace Code_2_Callouts.Stuff
{
    internal static class Utils
    {
        public static Ped Player => Game.LocalPlayer.Character;

        public static readonly Random Random = new Random();

        public static bool IsLSPDFRPluginRunning(string Plugin, Version minversion = null)
        {
            return Functions.GetAllUserPlugins().Select(assembly => assembly.GetName()).Where(an => string.Equals(an.Name, Plugin, StringComparison.CurrentCultureIgnoreCase)).Any(an => minversion == null || an.Version.CompareTo(minversion) >= 0);
        }

        public static void AddLog(this string s)
        {
            Game.LogTrivial($"[RoadIncidentCallouts] {s}");
        }

        public static SpawnHelper getNearestSpawnHelper(Vector3 refLocation, IEnumerable<SpawnHelper> locationList)
        {
            var location = locationList.OrderBy(element => element.location.DistanceTo2D(refLocation)).First();
            return location;
        }

        public static float GetGroundZ(this Vector3 position)
        {
            NativeFunction.Natives.GET_GROUND_Z_FOR_3D_COORD(position.X, position.Y, position.Z, out float height, false);
            return height;
        }

        public static Vector3 ToGround(this Vector3 position)
        {
            return new Vector3(position.X, position.Y, position.GetGroundZ());
        }

        public static void TurnToFaceEntity(this Ped ped, Entity entity, int duration = -1)
        {
            NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(ped, entity, duration);
        }

        public static string GetPolicePedModelForPosition(Vector3 position)
        {
            var result = string.Empty;
            var array1 = new[]
            {
                "s_m_y_cop_01",
                "s_f_y_cop_01"
            };
            var array2 = new[]
            {
                "s_m_y_sheriff_01",
                "s_f_y_sheriff_01"
            };
            result = Functions.GetZoneAtPosition(position).County == EWorldZoneCounty.LosSantos
                ? array1[Random.Next(array1.Length)]
                : array2[Random.Next(array2.Length)];
            return result;
        }

        public static string GetPoliceVehicleModelForPosition(Vector3 position)
        {
            var result = string.Empty;
            var array1 = new[]
            {
                "police",
                "police2",
                "police3",
                "police4"
            };
            var array2 = new[]
            {
                "sheriff",
                "sheriff2"
            };
            result = Functions.GetZoneAtPosition(position).County == EWorldZoneCounty.LosSantos ? array1[Random.Next(array1.Length)] : array2[Random.Next(array2.Length)];
            return result;
        }

        public static void RandomizeLicensePlate(this Vehicle vehicle)
        {
            if (vehicle)
                vehicle.LicensePlate = MathHelper.GetRandomInteger(0, 9).ToString() +
                                       MathHelper.GetRandomInteger(0, 9) +
                                       Convert.ToChar(Convert.ToInt32(Math.Floor(26 * MathHelper.GetRandomDouble(0, 1) + 65))) +
                                       Convert.ToChar(Convert.ToInt32(Math.Floor(26 * MathHelper.GetRandomDouble(0, 1) + 65))) +
                                       Convert.ToChar(Convert.ToInt32(Math.Floor(26 * MathHelper.GetRandomDouble(0, 1) + 65))) +
                                       MathHelper.GetRandomInteger(0, 9) +
                                       MathHelper.GetRandomInteger(0, 9) +
                                       MathHelper.GetRandomInteger(0, 9);
        }

        public static void Damage(this Vehicle vehicle, float radius, float amount)
        {
            var model = vehicle.Model;
            model.GetDimensions(out var vector3_1, out var vector3_2);
            var num = new Random().Next(10, 45);
            for (var index = 0; index < num; ++index)
            {
                var randomInt1 = MathHelper.GetRandomSingle(vector3_1.X, vector3_2.X);
                var randomInt2 = MathHelper.GetRandomSingle(vector3_1.Y, vector3_2.Y);
                var randomInt3 = MathHelper.GetRandomSingle(vector3_1.Z, vector3_2.Z);
                vehicle.Deform(new Vector3(randomInt1, randomInt2, randomInt3), radius, amount);
            }
        }

        public static float GetRandomHeading()
        {
            return MathHelper.GetRandomSingle(0, 360);
        }

        public static void ClearAreaOfPeds(Vector3 position, float radius)
        {
            var allPeds = World.GetAllPeds();
            foreach (var ped in allPeds)
            {
                if (!ped) continue;
                if (!(ped.DistanceTo2D(position) <= radius)) continue;
                if (ped != Game.LocalPlayer.Character)
                {
                    ped.Delete();
                }
            }
        }

        public static void ClearAreaOfVehicles(Vector3 position, float radius)
        {
            var allVehicles = World.GetAllVehicles();
            foreach (var vehicle in allVehicles)
            {
                if (!vehicle) continue;
                if (!(vehicle.DistanceTo2D(position) <= radius)) continue;
                if (vehicle != Game.LocalPlayer.Character.LastVehicle)
                {
                    vehicle.Delete();
                }
            }
        }

        public static void PlayRadioAnimation(this Ped ped)
        {
            if (ped && ped.IsAlive)
            {
                GameFiber.StartNew(delegate
                {
                    ped.Tasks.Clear();
                    var animTask1 = ped.Tasks.PlayAnimation(new AnimationDictionary("random@arrests"), "generic_radio_enter", 1f, AnimationFlags.SecondaryTask | AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly);
                    var length1 = animTask1.Length;
                    GameFiber.Sleep((int)length1 * 1000);
                    ped.Tasks.PlayAnimation(new AnimationDictionary("random@arrests"), "generic_radio_chatter", 1f, AnimationFlags.SecondaryTask | AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly);
                    GameFiber.Sleep(5000);
                    var animTask2 = ped.Tasks.PlayAnimation(new AnimationDictionary("random@arrests"), "generic_radio_exit", 1f, AnimationFlags.SecondaryTask | AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly);
                    var length2 = animTask2.Length;
                    GameFiber.Sleep((int)length2 * 1000);
                    ped.Tasks.Clear();
                });
            }
        }
    }
}

  • Author
1 minute ago, SRS Bladez said:

Just rename the namespace to what ever it was when you made the .cs file

 

using LSPD_First_Response.Engine.Scripting;
using LSPD_First_Response.Mod.API;
using Rage;
using Rage.Native;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

 

namespace Code_2_Callouts.Stuff
{
    internal static class Utils
    {
        public static Ped Player => Game.LocalPlayer.Character;

        public static readonly Random Random = new Random();

        public static bool IsLSPDFRPluginRunning(string Plugin, Version minversion = null)
        {
            return Functions.GetAllUserPlugins().Select(assembly => assembly.GetName()).Where(an => string.Equals(an.Name, Plugin, StringComparison.CurrentCultureIgnoreCase)).Any(an => minversion == null || an.Version.CompareTo(minversion) >= 0);
        }

        public static void AddLog(this string s)
        {
            Game.LogTrivial($"[RoadIncidentCallouts] {s}");
        }

        public static SpawnHelper getNearestSpawnHelper(Vector3 refLocation, IEnumerable<SpawnHelper> locationList)
        {
            var location = locationList.OrderBy(element => element.location.DistanceTo2D(refLocation)).First();
            return location;
        }

        public static float GetGroundZ(this Vector3 position)
        {
            NativeFunction.Natives.GET_GROUND_Z_FOR_3D_COORD(position.X, position.Y, position.Z, out float height, false);
            return height;
        }

        public static Vector3 ToGround(this Vector3 position)
        {
            return new Vector3(position.X, position.Y, position.GetGroundZ());
        }

        public static void TurnToFaceEntity(this Ped ped, Entity entity, int duration = -1)
        {
            NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(ped, entity, duration);
        }

        public static string GetPolicePedModelForPosition(Vector3 position)
        {
            var result = string.Empty;
            var array1 = new[]
            {
                "s_m_y_cop_01",
                "s_f_y_cop_01"
            };
            var array2 = new[]
            {
                "s_m_y_sheriff_01",
                "s_f_y_sheriff_01"
            };
            result = Functions.GetZoneAtPosition(position).County == EWorldZoneCounty.LosSantos
                ? array1[Random.Next(array1.Length)]
                : array2[Random.Next(array2.Length)];
            return result;
        }

        public static string GetPoliceVehicleModelForPosition(Vector3 position)
        {
            var result = string.Empty;
            var array1 = new[]
            {
                "police",
                "police2",
                "police3",
                "police4"
            };
            var array2 = new[]
            {
                "sheriff",
                "sheriff2"
            };
            result = Functions.GetZoneAtPosition(position).County == EWorldZoneCounty.LosSantos ? array1[Random.Next(array1.Length)] : array2[Random.Next(array2.Length)];
            return result;
        }

        public static void RandomizeLicensePlate(this Vehicle vehicle)
        {
            if (vehicle)
                vehicle.LicensePlate = MathHelper.GetRandomInteger(0, 9).ToString() +
                                       MathHelper.GetRandomInteger(0, 9) +
                                       Convert.ToChar(Convert.ToInt32(Math.Floor(26 * MathHelper.GetRandomDouble(0, 1) + 65))) +
                                       Convert.ToChar(Convert.ToInt32(Math.Floor(26 * MathHelper.GetRandomDouble(0, 1) + 65))) +
                                       Convert.ToChar(Convert.ToInt32(Math.Floor(26 * MathHelper.GetRandomDouble(0, 1) + 65))) +
                                       MathHelper.GetRandomInteger(0, 9) +
                                       MathHelper.GetRandomInteger(0, 9) +
                                       MathHelper.GetRandomInteger(0, 9);
        }

        public static void Damage(this Vehicle vehicle, float radius, float amount)
        {
            var model = vehicle.Model;
            model.GetDimensions(out var vector3_1, out var vector3_2);
            var num = new Random().Next(10, 45);
            for (var index = 0; index < num; ++index)
            {
                var randomInt1 = MathHelper.GetRandomSingle(vector3_1.X, vector3_2.X);
                var randomInt2 = MathHelper.GetRandomSingle(vector3_1.Y, vector3_2.Y);
                var randomInt3 = MathHelper.GetRandomSingle(vector3_1.Z, vector3_2.Z);
                vehicle.Deform(new Vector3(randomInt1, randomInt2, randomInt3), radius, amount);
            }
        }

        public static float GetRandomHeading()
        {
            return MathHelper.GetRandomSingle(0, 360);
        }

        public static void ClearAreaOfPeds(Vector3 position, float radius)
        {
            var allPeds = World.GetAllPeds();
            foreach (var ped in allPeds)
            {
                if (!ped) continue;
                if (!(ped.DistanceTo2D(position) <= radius)) continue;
                if (ped != Game.LocalPlayer.Character)
                {
                    ped.Delete();
                }
            }
        }

        public static void ClearAreaOfVehicles(Vector3 position, float radius)
        {
            var allVehicles = World.GetAllVehicles();
            foreach (var vehicle in allVehicles)
            {
                if (!vehicle) continue;
                if (!(vehicle.DistanceTo2D(position) <= radius)) continue;
                if (vehicle != Game.LocalPlayer.Character.LastVehicle)
                {
                    vehicle.Delete();
                }
            }
        }

        public static void PlayRadioAnimation(this Ped ped)
        {
            if (ped && ped.IsAlive)
            {
                GameFiber.StartNew(delegate
                {
                    ped.Tasks.Clear();
                    var animTask1 = ped.Tasks.PlayAnimation(new AnimationDictionary("random@arrests"), "generic_radio_enter", 1f, AnimationFlags.SecondaryTask | AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly);
                    var length1 = animTask1.Length;
                    GameFiber.Sleep((int)length1 * 1000);
                    ped.Tasks.PlayAnimation(new AnimationDictionary("random@arrests"), "generic_radio_chatter", 1f, AnimationFlags.SecondaryTask | AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly);
                    GameFiber.Sleep(5000);
                    var animTask2 = ped.Tasks.PlayAnimation(new AnimationDictionary("random@arrests"), "generic_radio_exit", 1f, AnimationFlags.SecondaryTask | AnimationFlags.StayInEndFrame | AnimationFlags.UpperBodyOnly);
                    var length2 = animTask2.Length;
                    GameFiber.Sleep((int)length2 * 1000);
                    ped.Tasks.Clear();
                });
            }
        }
    }
}

thanks alot man 🙂

cd.png

1. check distance between player and store owner

2.

var nearbyPeds = StoreOwner.GetNearbyPeds(16);
foreach(var ped in nearbyPeds)
{
    if (ped.Model == StoreOwner.Model)
    {
        ped.Delete();
    }
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.