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.

[SOLVED] My callout is never dispatched

Featured Replies

Hi, does anyone know why this basic chase code doesn't work, it never spawns naturally with dispatch and when I want to spawn it with Callout Interface it doesn't work either.

The Callout : (ignore the comment)

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

namespace Mytical_Callout.Callouts
{
    [CalloutInfo("SimplePursuit", CalloutProbability.High)]
    class SimplePursuit : Callout
    {
        private Blip blip;
        private Vector3 spawnPoint;
        private Ped suspect;
        //private Ped suspect2;
        private Vehicle suspectVehicle;
        private LHandle pursuit;
        private bool pursuitCreated;
        
        
        public override bool OnBeforeCalloutDisplayed()
        {
            Game.DisplayNotification("OnBeforeCalloutDisplayed");
            spawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(300f)); 
            ShowCalloutAreaBlipBeforeAccepting(spawnPoint, 30f);
            AddMinimumDistanceCheck(30f, spawnPoint);

            CalloutMessage = "THIIIIIIIIIIIISSSSSSSSSSOOOOOOONNNNNNNNNEEEEEEEEEEPoursuit!";
            CalloutPosition = spawnPoint;
            CalloutAdvisory = "THHHHHHHHHIIIIIIIIIISSSSSSSSSSSOOOOOOOOONBNNNNNNNNNNNNEEEEEEEEEa pursuit is in progress!";
            Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST_04 IN_OR_ON_POSITION", spawnPoint);


            return base.OnBeforeCalloutDisplayed();
        }

        public override bool OnCalloutAccepted()
        {
            Game.DisplayNotification("OnCalloutAccepted");
            suspectVehicle = new Vehicle("KURUMA", spawnPoint);
            suspectVehicle.IsPersistent = true;
            

            suspect = new Ped(spawnPoint);
            suspect.IsPersistent = true;
            suspect.BlockPermanentEvents = true;
            //suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true);
            suspect.WarpIntoVehicle(suspectVehicle, -1);
            /*
            suspect2 = new Ped(suspectVehicle.GetOffsetPositionFront(5f));
            suspect2.IsPersistent = true;
            suspect2.BlockPermanentEvents = true;
            suspect2.Inventory.GiveNewWeapon("WEAPON_ASSAULTRIFLE", -1, true);
            suspect2.WarpIntoVehicle(suspectVehicle, 2);
            */

            blip = suspect.AttachBlip();
            blip.Color = Color.Red;
            blip.IsRouteEnabled = true;

            pursuitCreated = false;



            return base.OnCalloutAccepted();
        }

       
        
        
        public override void Process()
        {
            Game.DisplayNotification("Process");
            if (!pursuitCreated && Game.LocalPlayer.Character.DistanceTo(suspectVehicle) <= 100f)
            {
                blip.Delete();
                pursuit = Functions.CreatePursuit();
                Functions.AddPedToPursuit(pursuit, suspect);
                Functions.SetPursuitIsActiveForPlayer(pursuit, true);
                pursuitCreated = true;

            }
           /* if (Game.LocalPlayer.Character.DistanceTo(suspectVehicle) <= 5f)
            {
                NativeFunction.Natives.TASK_OPEN_VEHICLE_DOOR(suspect2, suspectVehicle, 18000, 2, 1.47f);
                Game.DisplayNotification("SHOT FIRED !");
                NativeFunction.Natives.SetPedCombatAttributes(suspect, 1, true);
                suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
                Functions.PlayScannerAudio("WE_HAVE CRIME_SHOTS_FIRED_01");
            }

            if (Game.LocalPlayer.GetFreeAimingTarget() || Game.LocalPlayer.Character.IsDoingDriveby == suspect || suspectVehicle)
            {
                NativeFunction.Natives.TASK_OPEN_VEHICLE_DOOR(suspect2, suspectVehicle, 18000, 2, 1.47f);
                suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true);
                Game.DisplayNotification("SHOT FIRED !");
                NativeFunction.Natives.SetPedCombatAttributes(suspect, 1, true);
                suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
                Functions.PlayScannerAudio("WE_HAVE CRIME_SHOTS_FIRED_01");
            }
            if (!suspect.IsOnFoot)
            {
                Game.DisplayNotification("IS ON FOOT !");
                
                suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true);
                suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
                suspect.Tasks.FireWeaponAt(Game.LocalPlayer.Character, 20000, FiringPattern.BurstFirePistol);
            }
            if (suspect.IsOnFoot)
            {
                Game.DisplayNotification("IS ON FOOT");
                
                suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true);
                suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
                suspect.Tasks.FireWeaponAt(Game.LocalPlayer.Character, 20000,FiringPattern.BurstFirePistol);
            }
            if (Game.LocalPlayer.Character.IsShooting)
            {
                Game.DisplayNotification("IS SHOOTING");
                suspect.Inventory.GiveNewWeapon("WEAPON_PISTOL", -1, true);
                NativeFunction.Natives.TASK_OPEN_VEHICLE_DOOR(suspect2,suspectVehicle, 18000, 2, 1.47f);
                suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);
                
                suspect.Tasks.FireWeaponAt(Game.LocalPlayer.Character, 20000, FiringPattern.BurstFirePistol);
            }*/

            if (pursuitCreated && !Functions.IsPursuitStillRunning(pursuit))
            {
                End();
            }

            base.Process();
        }
    
        public override void End()
        {
            Game.DisplayNotification("End");
            base.End();
            if (suspect.Exists())
            {
                suspect.Dismiss();
            }
            if (blip.Exists())
            {
                blip.Delete();
            }
            if (suspectVehicle.Exists())
            {
                suspectVehicle.Delete();
            }
            Game.LogTrivial("Mytical Callout cleaned up.");
        }


    }
}

 

RagePluginHook.log

Edited by Mytical49
Resolved

by Mytical.

  • Management Team

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author
25 minutes ago, LMS said:

Yes I did, I just created a github repository to facilitate the help, note that when I want to force the callout with callout interface I have an error:

[3/29/2022 6:20:10 PM.331] LSPD First Response: CalloutInterface: [DEBUG] user selected callout SimplePursuitMytical from menu
[3/29/2022 6:20:10 PM.358] LSPD First Response: CalloutInterface: [INFO] starting callout SimplePursuitMytical
[3/29/2022 6:20:10 PM.358] LSPD First Response: CalloutInterface: [DEBUG] waiting for callout delay: 1 s
[3/29/2022 6:20:11 PM.382] LSPD First Response: CalloutInterface: [DEBUG] starting callout: SimplePursuitMytical
[3/29/2022 6:20:12 PM.405] LSPD First Response: CalloutInterface: [WARNING] attempted to start callout SimplePursuitMytical but nothing happened
[3/29/2022 6:20:13 PM.290] LSPD First Response: [TRACE] Preloading POLICE
[3/29/2022 6:20:13 PM.290] LSPD First Response: [TRACE] Preloading MP_M_FREEMODE_01
[3/29/2022 6:20:13 PM.339] LSPD First Response: [TRACE] Preloading POLICE
[3/29/2022 6:20:13 PM.340] LSPD First Response: [TRACE] Created police at X:197.4658 Y:-1036.796 Z:29.63838
[3/29/2022 6:20:13 PM.368] LSPD First Response: [TRACE] Preloading MP_M_FREEMODE_01
[3/29/2022 6:20:13 PM.375] LSPD First Response: [TRACE] New ped created mp_m_freemode_01 (PedType: 6), Agency: CityPolice ()
[3/29/2022 6:20:13 PM.382] LSPD First Response: [TRACE] Jon Macerry (MP_M_FREEMODE_01) was set as a cop
[3/29/2022 6:20:13 PM.401] LSPD First Response: [TRACE] Preloading MP_M_FREEMODE_01
[3/29/2022 6:20:13 PM.408] LSPD First Response: [TRACE] New ped created mp_m_freemode_01 (PedType: 6), Agency: CityPolice ()
[3/29/2022 6:20:13 PM.414] LSPD First Response: [TRACE] George Kingsford (MP_M_FREEMODE_01) was set as a cop
[3/29/2022 6:20:13 PM.432] LSPD First Response: [TRACE] AmbientSpawn - spawned: police
[3/29/2022 6:20:38 PM.370] LSPD First Response: [TRACE] Preloading POLICE2
[3/29/2022 6:20:38 PM.371] LSPD First Response: [TRACE] Preloading MP_F_FREEMODE_01
[3/29/2022 6:20:38 PM.418] LSPD First Response: [TRACE] Preloading POLICE2
[3/29/2022 6:20:38 PM.419] LSPD First Response: [TRACE] Created police2 at X:216.0066 Y:-728.9883 Z:35.05275
[3/29/2022 6:20:38 PM.446] LSPD First Response: [TRACE] Preloading MP_F_FREEMODE_01
[3/29/2022 6:20:38 PM.452] LSPD First Response: [TRACE] New ped created mp_f_freemode_01 (PedType: 6), Agency: CityPolice ()
[3/29/2022 6:20:38 PM.497] LSPD First Response: [TRACE] Cached 1360 decorators for index 4
[3/29/2022 6:20:38 PM.503] LSPD First Response: [TRACE] Kate Lotter (MP_F_FREEMODE_01) was set as a cop
[3/29/2022 6:20:38 PM.635] LSPD First Response: [TRACE] Preloading MP_F_FREEMODE_01
[3/29/2022 6:20:38 PM.642] LSPD First Response: [TRACE] New ped created mp_f_freemode_01 (PedType: 6), Agency: CityPolice ()
[3/29/2022 6:20:38 PM.648] LSPD First Response: [TRACE] Banko Jerem (MP_F_FREEMODE_01) was set as a cop
[3/29/2022 6:20:38 PM.669] LSPD First Response: [TRACE] AmbientSpawn - spawned: police2
[3/29/2022 6:20:42 PM.513] LSPD First Response: [TRACE] It has been 33 seconds since the last callout
[3/29/2022 6:20:42 PM.513] LSPD First Response: Creating IBuauNedmbmVEYLDmNmoYfNfCcVYA from IBuauNedmbmVEYLDmNmoYfNfCcVYA, LSPD First Response, Version=0.4.8037.37597, Culture=neutral, PublicKeyToken=null
[3/29/2022 6:20:42 PM.514] LSPD First Response: GetAudioFileForAction: No file found for: STREET_DEL_PERRO_FREEWAY
[3/29/2022 6:20:42 PM.515] LSPD First Response: [TRACE] Preloading BISON
[3/29/2022 6:20:42 PM.515] LSPD First Response: [TRACE] Callout created: Pursuit #4
[3/29/2022 6:20:42 PM.516] LSPD First Response: CalloutInterface: [ERROR] There is something wrong with your RAGE World Datetime
[3/29/2022 6:20:42 PM.517] LSPD First Response: CalloutInterface: [ERROR] Year, Month, and Day parameters describe an un-representable DateTime.
[3/29/2022 6:20:42 PM.519] LSPD First Response: CalloutInterface: [DEBUG]    at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
[3/29/2022 6:20:42 PM.519] at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second)
[3/29/2022 6:20:42 PM.519] at Rage.World.get_DateTime()
[3/29/2022 6:20:42 PM.519] at CalloutInterface.API.Functions.GetDateTime()
[3/29/2022 6:20:42 PM.519] LSPD First Response: CalloutInterface: [ERROR] There is something wrong with your RAGE World Datetime
[3/29/2022 6:20:42 PM.519] LSPD First Response: CalloutInterface: [ERROR] Year, Month, and Day parameters describe an un-representable DateTime.
[3/29/2022 6:20:42 PM.519] LSPD First Response: CalloutInterface: [DEBUG]    at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
[3/29/2022 6:20:42 PM.519] at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second)
[3/29/2022 6:20:42 PM.519] at Rage.World.get_DateTime()
[3/29/2022 6:20:42 PM.519] at CalloutInterface.API.Functions.GetDateTime()
[3/29/2022 6:20:42 PM.520] LSPD First Response: CalloutInterface: [ERROR] There is something wrong with your RAGE World Datetime
[3/29/2022 6:20:42 PM.520] LSPD First Response: CalloutInterface: [ERROR] Year, Month, and Day parameters describe an un-representable DateTime.
[3/29/2022 6:20:42 PM.520] LSPD First Response: CalloutInterface: [DEBUG]    at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
[3/29/2022 6:20:42 PM.520] at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second)
[3/29/2022 6:20:42 PM.520] at Rage.World.get_DateTime()
[3/29/2022 6:20:42 PM.520] at CalloutInterface.API.Functions.GetDateTime()
[3/29/2022 6:20:42 PM.520] LSPD First Response: CalloutInterface: [ERROR] There is something wrong with your RAGE World Datetime
[3/29/2022 6:20:42 PM.520] LSPD First Response: CalloutInterface: [ERROR] Year, Month, and Day parameters describe an un-representable DateTime.
[3/29/2022 6:20:42 PM.520] LSPD First Response: CalloutInterface: [DEBUG]    at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
[3/29/2022 6:20:42 PM.520] at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second)
[3/29/2022 6:20:42 PM.520] at Rage.World.get_DateTime()
[3/29/2022 6:20:42 PM.520] at CalloutInterface.API.Functions.GetDateTime()

 

by Mytical.

  • The title was changed to [SOLVED] My callout is never dispatched
  • Author

I finally solved the problem by looking if my callout was registered in rage (I thought so because it was displayed in Callout Interface), and it turned out that it was not registered, so there was a problem on recording the callout. I was misled because I followed this tutorial by @SneakySteve which shows that you have to use a certain method to register the callout, it doesn't seem to work. So I followed the tutorial of master @Albo1125 and it now works. PS: pay attention to the order of your code for example this will not work because "suspect" has not been created yet, so make sure everything exist and is in order :

  public override bool OnCalloutAccepted()
        {
            Game.DisplayNotification("OnCalloutAccepted");
            suspectVehicle = new Vehicle("POLICE2", spawnPoint);
            suspectVehicle.IsPersistent = true;
            suspect.WarpIntoVehicle(suspectVehicle, -1); //suspect is not created yet so we can't put him in the vehicule 

           suspect = suspectVehicle.CreateRandomDriver(); //suspect is create here
            suspect.IsPersistent = true;
            suspect.BlockPermanentEvents = true;
           
            
            blip = suspect.AttachBlip();
            blip.Color = Color.Red;
            blip.IsRouteEnabled = true;
          
            return base.OnCalloutAccepted();
        }

thanks you for helping me !

by Mytical.

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.