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.

Need Help with Callout Scripting

You're viewing a summary of the most helpful posts in this topic — about 4 minutes of reading instead of 11 minutes for all 22 posts.

Featured Replies

Hello, I am new to scripting Callouts at all, I kinda made myself one but it doesn't load at all, doesn't show up in Callout Interface etc, I made my Callout with a tutorial from youtube and a little help from ChatGPT to have custom cars that get chosen from randomly and make the Driver only spawn on Highways. Sadly the script doesn't work and I need some help from someone who knows alot more about scripting callouts. If anything else is needed then I am here to provide for that. Looking forward for helpful people 🙂

 

This is my Callout Script.

Spoiler
Spoiler

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
using System.Drawing;
using Rage.Native;

namespace RealisticCarCallouts.Callouts
{
    [CalloutInfo("HighSpeedChase", CalloutProbability.Low)]
    internal class HighSpeedChase : Callout
    {
        private Ped Suspect1, Suspect2;
        private Vehicle SuspectVehicle;
        private Vector3 Spawnpoint;
        private Blip SuspectBlip;
        private LHandle Pursuit;
        private bool PursuitCreated;

        private static readonly string[] vehicleModels = { "16challenger", "16charger", "458it", "gtr", "lhuracant", "m3", "s63w222", "toysupmk4" };

        // Predefined highway locations for guaranteed highway spawns
        private static readonly Vector3[] HighwayLocations =
        {
            new Vector3(-2178.2f, 4277.9f, 48.0f),  // Great Ocean Highway (North)
            new Vector3(1835.6f, 3652.1f, 34.2f),   // Senora Freeway (Sandy Shores)
            new Vector3(2545.1f, 4192.3f, 41.1f),   // Senora Freeway (Northeast)
            new Vector3(-55.1f, -2521.9f, 6.1f),    // Los Santos Freeway (South)
            new Vector3(2750.3f, 3488.1f, 55.3f),   // Senora Freeway (East)
            new Vector3(-1845.7f, -682.5f, 10.4f),  // Del Perro Freeway (West)
            new Vector3(1415.3f, -2145.9f, 51.9f),  // Palomino Freeway (East)
            new Vector3(-1356.8f, 159.2f, 55.7f)    // Great Ocean Highway (City)
        };

        public override bool OnBeforeCalloutDisplayed()
        {
            // Pick a random highway location
            Spawnpoint = HighwayLocations[new Random().Next(HighwayLocations.Length)];

            ShowCalloutAreaBlipBeforeAccepting(Spawnpoint, 50f);
            AddMinimumDistanceCheck(50f, Spawnpoint);
            CalloutMessage = "High-Speed Chase on the Highway";
            CalloutPosition = Spawnpoint;
            Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESISTING_ARREST_O2 IN_OR_ON_POSITION", Spawnpoint);

            return base.OnBeforeCalloutDisplayed();
        }

        public override bool OnCalloutAccepted()
        {
            string selectedVehicle = vehicleModels[new Random().Next(vehicleModels.Length)];
            SuspectVehicle = new Vehicle(selectedVehicle, Spawnpoint);

            if (!SuspectVehicle.Exists()) return false;

            // Create two armed suspects
            Suspect1 = new Ped(SuspectVehicle.GetOffsetPositionFront(3f));
            Suspect2 = new Ped(SuspectVehicle.GetOffsetPositionFront(5f));

            if (!Suspect1.Exists() || !Suspect2.Exists()) return false;

            // Make peds persistent and hostile
            Suspect1.IsPersistent = true;
            Suspect2.IsPersistent = true;
            Suspect1.BlockPermanentEvents = true;
            Suspect2.BlockPermanentEvents = true;

            // Give weapons
            Suspect1.Inventory.GiveNewWeapon("WEAPON_SMG", 250, true);
            Suspect2.Inventory.GiveNewWeapon("WEAPON_PISTOL", 100, true);

            // Set them as criminals
            Suspect1.RelationshipGroup = "CRIMINALS";
            Suspect2.RelationshipGroup = "CRIMINALS";

            // Attach blip to the vehicle
            SuspectBlip = SuspectVehicle.AttachBlip();
            SuspectBlip.Color = Color.Red;
            SuspectBlip.IsRouteEnabled = true;

            PursuitCreated = false;

            return base.OnCalloutAccepted();
        }

        public override void Process()
        {
            base.Process();

            if (!PursuitCreated && Game.LocalPlayer.Character.DistanceTo(SuspectVehicle) <= 20f)
            {
                Pursuit = Functions.CreatePursuit();
                Functions.AddPedToPursuit(Pursuit, Suspect1);
                Functions.AddPedToPursuit(Pursuit, Suspect2);
                Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                PursuitCreated = true;
            }

            if (PursuitCreated && !Functions.IsPursuitStillRunning(Pursuit))
            {
                End();
            }
        }

        public override void End()
        {
            base.End();

            if (Suspect1.Exists()) Suspect1.Dismiss();
            if (Suspect2.Exists()) Suspect2.Dismiss();
            if (SuspectBlip.Exists()) SuspectBlip.Delete();
            if (SuspectVehicle.Exists()) SuspectVehicle.Dismiss();

            Game.LogTrivial("RealisticCarCallouts - High-Speed Chase cleaned up.");
        }
    }
}

 

 

This is the Main.cs

Spoiler
Spoiler

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using LSPD_First_Response.Mod.API;
using System.Reflection;

namespace RealisticCarCallouts
{
    public class Main: Plugin
    {

        public override void Initialize()
        {
            Functions.OnOnDutyStateChanged += OnOnDutyStateChangedHandler;
            Game.LogTrivial("Plugin RealisticCarCallouts" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + " by Author has been initialised");
            Game.LogTrivial("Go on duty to fully load RealisticCarCallouts");

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(LSPDFRResolveEventHandler);
        }

        public override void Finally()
        {
            Game.LogTrivial("RealisticCarCallouts has been cleaned up.");
        }

        private static void OnOnDutyStateChangedHandler(bool OnDuty)
        {
            if (OnDuty)
            {
                RegisterCallouts();
                Game.DisplayNotification("RealisticCarCallouts by Author Version 1.0.0 - Alpha - Has been successfully loaded!");
            }
        }

        private static void RegisterCallouts()
        {
            Functions.RegisterCallout(typeof(Callouts.HighSpeedChase));
        }

        public static Assembly LSPDFRResolveEventHandler(object sender, ResolveEventArgs args)
        {
            foreach (Assembly assembly in Functions.GetAllUserPlugins())
            {
                if (args.Name.ToLower().Contains(assembly.GetName().Name.ToLower()))
                {
                    return assembly;
                }
            }
            return null;
        }

        public static bool IsLSPDFRPluginRunning(string Plugin, Version minversion = null)
        {
            foreach (Assembly assembly in Functions.GetAllUserPlugins())
            {
                AssemblyName an = assembly.GetName();
                if (an.Name.ToLower() == Plugin.ToLower())
                {
                    if (minversion == null || an.Version.CompareTo(minversion) >= 0)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}
 

 

 

RagePluginHook_28032025_212943.log

  • Replies 21
  • Views 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

  • Author

@GTAbearthere is no " D:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager", I removed it completely from my Folder like I told last time (look at the attached file Screenshot 389), + it showed this "at System.Reflection.Assembly.GetTypes() at GGGgmqSptMDCWgeGXIYyYZkejcajA.yyAmRbIQDuPUMRnzgYvyxyhKLIzI() in D:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 731" since I put it in my Callouts folder, and I don't even have a Folder called "LSPD First Response" so that's from the person who made it, not from my side (look at Screenshot (390)) 

 

Could contain: text, screenshot, display, number, software, font, line

Could contain: text, screenshot, menu, number

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.