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

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.3k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

23 hours ago, PlayerUnknown2025 said:

This is my Callout Script.

Hi
You  missing the assembly declaration in Main after your using statements:

[assembly: Rage.Attributes.Plugin("Plugin_name", Description = " ", Author = "")]


The strings can be anything.
I think assembly is some kind of "id-card" and i diddent have it in my first plugin, and it failed. After adding it. it ran.
Otherwise i would say that you commit the most typical mistake by adding way to much before you testrun. It is better to have next to noting, because it gets so much easier to spot mistakes.
Advises:
* Keep a rollback version of your code for catastrophes
* Add only minute codeparts and expand them after you know it works

* Never develop with other plugins loaded!

 

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

  • Author

@GTAbearso I've putted it like this into my code but still doesn't work. Did I put it wrong into the code or is it smth else? could you help me a little bit more ? 😅, I've removed all my other plugins just left CalloutInterface in to see if it shows it there or not but still no luck so far

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;

[assembly: Rage.Attributes.Plugin("RealisticCarCallouts", Description = "Still in testphase", Author = "PlayerUnknown2025")]

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_30032025_182518.log

4 hours ago, PlayerUnknown2025 said:

put it wrong into the code or is it smth else?

The log is not the correct log
The correct log is the one created in your GTAV-base-folder. I totally understand that you are confused about this, because it is warped and odd.
Let us see the one named RagePluginHook.log

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

Expected parts are not found.
I cant see if it is your CalloutInterface.Main or your own RealisticCarCallouts that is not found.
The error is not specific just
Die Datei oder Assembly "System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden
This is even stated twice.. Try and remove CalloutInterface and see if the same error happens again, then it is your RealisticCarCallouts that is not found

So move  CalloutInterface, run lspdfr and repost the log

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

On 3/31/2025 at 9:21 PM, PlayerUnknown2025 said:

I removed CalloutInterface and now it's only my calloutscript

That is not so. CalloutInterface is still there:


at System.Reflection.Assembly.GetTypes() at GGGgmqSptMDCWgeGXIYyYZkejcajA.yyAmRbIQDuPUMRnzgYvyxyhKLIzI() in D:\GTA V\LSPD First Response\LSPD First Response\Mod\Callouts\CalloutManager.cs:line 731
LSPD First Response: Die Datei oder Assembly "System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

 

That Version=8.0.0.0 is the calloutManager, and it is still being attempted loaded.
Your own plugin RealisticCarCallouts is version 1.0.0.0 -And that is also not found
To make sure nothing is attempted read from folder Mods, rename it _Mods

Also show me the path to your own RealisticCarCallouts.dll

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

  • 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

11 hours ago, PlayerUnknown2025 said:

I removed it completely from my Folder

it is still attempted loaded and fails
Have you tried to open LSPDFR completely without any added plugins, also without your own new plugin.
Does LSPDFR load and can you go to duty without a crash
Your log should show that NO plugins was attempted to be opened, and there should ONLY be the 3 default callouts. Try that, i suspect it will crash and CalloutManager still will be in the pipeline and cause an exception.
To make sure the new log is indeed for a vanilla version of LSPDFR, do first delete the current 
RagePluginHook.log and then post the log once more.
Something is just wrong! CalloutManager  should not have any entry in your log, and it has 4...
 

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

On 4/2/2025 at 9:16 PM, PlayerUnknown2025 said:

I didn't crash at all

ash crap
The vehicles....
Where do you have them from?!
The are not single-player -sorry i should have seen that, but all those calloutinterfase errors made me blind
Try these vehicles instead:

"WARRENER", "RAPIDGT", "INTRUDER", "FELTZER2", "FQ2", "RANCHERXL", "REBEL"


Here is the DB of vehicles:
https://www.gtabase.com/grand-theft-auto-v/vehicles/#sort=attr.ct3.frontend_value&sortdir=desc&attr.ct5.value=gta5-story&name=m3&page=1
Those you can see there are sorted as single-player and good to go

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

On 4/7/2025 at 12:36 PM, PlayerUnknown2025 said:

here is the log

what about the framework you are using in VS?
you need to choose .NET franmework instead of net. lspdfr was a VS2014/17 project, and the net-framework was not an option.
install .NET Framework Developer 4.8, and then manually change the .NET target framework in the project file
If indeed this is the issue, you cant use the old project-file, you need to make a new and then target that to the correct framework. All your code in the old main is fine so just copy paste it

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

  • Author

@GTAbearso I use framework net 8.0, when trying to use 4.8 (changed it manually in the Project file) i get an error code, that it wants me to use 8.0 or greater "Invalid 'nullable' value: 'Enable' for C#7.3. Please use language Version '8.0' or greater." Also when making a new Project it only lets me choose between net 8.0, net 9.0, standard 2.0 and 2.1. 

4 hours ago, PlayerUnknown2025 said:

I use framework net 8.0

Bingo! Theres the issue! Now we know what is wrong. :!
Changing framework in vs2022 is a google thing:

https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-multi-targeting-overview?view=vs-2022

Let us know if this let you use the plugin!
 

See my plugin here:
https://www.youtube.com/watch?v=peqSXuTfIyY

Let me know if you find it interesting.
Best Regards.

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.