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.

CLR ASSEMBLY

Featured Replies

when ever I try to load my callout I get " The specified file is not a valid CLR assembly ", Anyone know what's going on? Suggestions?

10 hours ago, KALIL said:

when ever I try to load my callout I get " The specified file is not a valid CLR assembly ", Anyone know what's going on? Suggestions?

Hi Sir Download that API Here > that will fix your assembly

to enter the project :-

API Examples > DemoProject > DemoProject > DemoProject.sln

And Add Your Script i hope your callouts will be good

  • Author

Sorry its been awhile since I responded, here's my script.

 

using System;

using LSPD_First_Response.Engine.Scripting.Entities;

using LSPD_First_Response.Mod.API;

using LSPD_First_Response.Mod.Callouts;

using Rage;

 

Functions.RegisterCallout(typeof(Callouts.ExampleCallout));

namespace APIExample.Callouts

{

 

[CalloutInfo("ExampleCallout", CalloutProbability.Medium)]

public class ExampleCallout : Callout

{

 

private Vehicle myVehicle; // a rage vehicle

private Ped myPed; // a rage ped

private Vector3 SpawnPoint; // a Vector3

private Blip myBlip; // a rage blip

private LHandle pursuit; // an API pursuit handle

/// <summary>

/// OnBeforeCalloutDisplayed is where we create a blip for the user to see where the pursuit is happening, we initiliaize any variables above and set

/// the callout message and position for the API to display

/// </summary>

/// <returns></returns>

public override bool OnBeforeCalloutDisplayed()

{

//Set our spawn point to be on a street around 300f (distance) away from the player.

SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around(300f));

//Create our ped in the world

myPed = new Ped("a_m_y_mexthug_01", SpawnPoint, 0f);

//Create the vehicle for our ped

myVehicle = new Vehicle("DUKES2", SpawnPoint);

//Now we have spawned them, check they actually exist and if not return false (preventing the callout from being accepted and aborting it)

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

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

//If we made it this far both exist so let's warp the ped into the driver seat

myPed.WarpIntoVehicle(myVehicle, -1);

// Show the user where the pursuit is about to happen and block very close peds.

this.ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 15f);

this.AddMinimumDistanceCheck(5f, myPed.Position);

// Set up our callout message and location

this.CalloutMessage = "Example Callout Message";

this.CalloutPosition = SpawnPoint;

//Play the police scanner audio for this callout (available as of the 0.2a API)

Functions.PlayScannerAudioUsingPosition("CITIZENS_REPORT CRIME_RESIST_ARREST IN_OR_ON_POSITION", SpawnPoint);

return base.OnBeforeCalloutDisplayed();

}

 

/// <summary>

/// OnCalloutAccepted is where we begin our callout's logic. In this instance we create our pursuit and add our ped from eariler to the pursuit as well

/// </summary>

/// <returns></returns>

public override bool OnCalloutAccepted()

{

//We accepted the callout, so lets initilize our blip from before and attach it to our ped so we know where he is.

myBlip = myPed.AttachBlip();

this.pursuit = Functions.CreatePursuit();

Functions.AddPedToPursuit(this.pursuit, this.myPed);

return base.OnCalloutAccepted();

}

/// <summary>

/// If you don't accept the callout this will be called, we clear anything we spawned here to prevent it staying in the game

/// </summary>

public override void OnCalloutNotAccepted()

{

base.OnCalloutNotAccepted();

if (myPed.Exists()) myPed.Delete();

if (myVehicle.Exists()) myVehicle.Delete();

if (myBlip.Exists()) myBlip.Delete();

}

//This is where it all happens, run all of your callouts logic here

public override void Process()

{

base.Process();

 

//A simple check, if our pursuit has ended we end the callout

if (!Functions.IsPursuitStillRunning(pursuit))

{

this.End();

}

}

/// <summary>

/// More cleanup, when we call end you clean away anything left over

/// This is also important as this will be called if a callout gets aborted (for example if you force a new callout)

/// </summary>

public override void End()

{

base.End();

if (myBlip.Exists()) myBlip.Delete();

if (myPed.Exists()) myPed.Delete();

if (myVehicle.Exists()) myVehicle.Delete();

 

}

}

}

your code have no error

 click Right in DemoProject to properties

Application > Target framework > .NET Framework 4.6.1

and Save All Look if the problem fix

It should go under Plugins\LSPDFR. LSPDFR will load it automatically. 

Edited by Stealth22

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

  • Author

Yeah that's where I have it, but I check the console and it says could not load cause of invalid CLR assembly

I might be wrong but should'nt it be like:

namespace DemoProject.Callouts 

instead of

namespace APIExample.Callouts 

 

One thing I noticed is that you have " Functions.RegisterCallout(typeof(Callouts.ExampleCallout)); " on top of the namespace, I don't know if it originally is in other part and you just copy all together here but it should be inside a class method. Are you using VisualStudio? It should tell you about these errors.

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.