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.

LSPDFR Plugin wont build

Featured Replies

Hello, i'm trying to make a callout pack. Whenever I build the callout I get a failed error. Please help, heres the log i get

 

Spoiler

Build started at 16:59...
1>------ Build started: Project: AJ, Configuration: Debug Any CPU ------
1>D:\1visual\IDE\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "RagePluginHook", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
1>D:\1visual\IDE\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3029,5): warning MSB3290: Failed to create the wrapper assembly for type library "{215d64d2-031c-33c7-96e3-61794cd1ee61}". Type library 'System_Windows_Forms' was exported from a CLR assembly and cannot be re-imported as a CLR assembly.
1>D:\1visual\IDE\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3029,5): warning MSB3290: Failed to create the wrapper assembly for type library "{d37e2a3e-8545-3a39-9f4f-31827c9124ab}". Type library 'System_Drawing' was exported from a CLR assembly and cannot be re-imported as a CLR assembly.
1>F:\1callout\AJ\AJ\obj\Debug\net6.0-windows\AJ.GlobalUsings.g.cs(10,14,10,42): error CS0138: A 'using namespace' directive can only be applied to namespaces; 'Forms' is a type not a namespace. Consider a 'using static' directive instead
1>F:\1callout\AJ\AJ\obj\Debug\net6.0-windows\AJ.GlobalUsings.g.cs(10,37,10,42): warning CS0437: The type 'Forms' in 'F:\1callout\AJ\AJ\System\Windows\Forms.cs' conflicts with the imported namespace 'System.Windows.Forms' in 'System.Design, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in 'F:\1callout\AJ\AJ\System\Windows\Forms.cs'.
1>F:\1callout\AJ\AJ\System\Windows\Forms.cs(5,23,5,28): warning CS0437: The type 'Forms' in 'F:\1callout\AJ\AJ\System\Windows\Forms.cs' conflicts with the imported namespace 'System.Windows.Forms' in 'System.Design, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in 'F:\1callout\AJ\AJ\System\Windows\Forms.cs'.
1>F:\1callout\AJ\AJ\System\Windows\Forms.cs(5,29,5,33): error CS0426: The type name 'Keys' does not exist in the type 'Forms'
1>F:\1callout\AJ\AJ\Main.cs(56,86,56,90): warning CS8625: Cannot convert null literal to non-nullable reference type.
1>Done building project "AJ.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 17:00 and took 12.003 seconds ==========

 

11 minutes ago, AL3K54NDER said:

The type 'Forms' in 'F:\1callout\AJ\AJ\System\Windows\Forms.cs' conflicts with the imported namespace 'System.Windows.Forms' in 'System.Design, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Using the type defined in 'F:\1callout\AJ\AJ\System\Windows\Forms.cs'.

Looks like you are missing a reference
How does your key-presses code look?
There are two different ways to register keypress
if (Game.IsKeyDown(Keys.N))
and
if (Game.IsKeyDown(System.Windows.Forms.Keys.N))

Also do you have an assembly declaration?

-But this is just me guessing. It is not possible to know without seeing the code

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

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

  • Author
10 minutes ago, GTAbear said:

Looks like you are missing a reference
How does your key-presses code look?
There are two different ways to register keypress
if (Game.IsKeyDown(Keys.N))
and
if (Game.IsKeyDown(System.Windows.Forms.Keys.N))

Also do you have an assembly declaration?

-But this is just me guessing. It is not possible to know without seeing the code

Hello, let me send you the code, hold on

 

 

 

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 System.Windows;

namespace AJ.Callouts
{

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

    public class IntoxicatedIndividual : Callout
    {
        private Ped Suspect;
        private Blip SuspectBlip;
        private Vector3 Spawnpoint;
        private float Heading;
        private int counter;
        private string malefemale;


        public override bool OnBeforeCalloutDisplayed()
        {
            Spawnpoint = new Vector3(2760.251f, 3472.108f, 55.26629f);
            Heading = 66.64632f;
            ShowCalloutAreaBlipBeforeAccepting(Spawnpoint, 30f);
            AddMinimumDistanceCheck(30f, Spawnpoint);
            CalloutMessage = "Intoxicated Person in public.";
            Functions.PlayScannerAudioUsingPosition("WE_HAVE_CRIME_DISTURBING_THE_PEACE_01 IN_OR_ON_POSITION", Spawnpoint);


            return base.OnBeforeCalloutDisplayed();
        }

        public override bool OnCalloutAccepted()
        {
            Suspect = new Ped("cs_russiandrunk", Spawnpoint, Heading);
            Suspect.IsPersistent = true;
            Suspect.BlockPermanentEvents = true;

            SuspectBlip = Suspect.AttachBlip();
            SuspectBlip.Color = System.Drawing.Color.DarkGreen;
            SuspectBlip.IsRouteEnabled = true;

            if (Suspect.IsMale)
                malefemale = "sir";
            else
                malefemale = "ma'am";

            counter = 0;

            return base.OnCalloutAccepted(base.GetSpawnpoint());
        }

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

            if (Game.LocalPlayer.Character.DistanceTo(Suspect) <= 10f)
            {
                Game.DisplayHelp("Press 'Y' to talk to the suspect.", false);

                if (Game.IsKeyDown(System.Windows.Forms.Keys.N))
                {
                    counter++;

                    if (counter == 1)
                    {
                        Game.DisplaySubtitle("Player: Excuse me." + malefemale + ", do you need any assistance?");
                    }
                    if (counter == 2) ;
                    {
                        Game.DisplaySubtitle("Suspect: No sir, there is no assistance here. My name is uhh, I forgot.");
                    }

                    if (counter == 3) ;
                    {
                        Game.DisplaySubtitle("Player: What have you had to drink?");
                    }

                    if (counter == 4) ;
                    {
                        Game.DisplaySubtitle("Suspect: Nothing...");
                    }

                    if (counter == 5) ;
                    {
                        Game.DisplaySubtitle("Player: Alright. I will be issuing a breathalyzer test on you.");
                    }

                    if (counter == 6) ;
                    {
                        Game.DisplaySubtitle("*The officer takes out a breathalyzer. The suspect blows into it.*");
                    }

                    Game.DisplayHelp("The suspect has blown twice over the legal limit, Deal with the situation accordingly");

                    if (counter > 7)
                    {
                        Game.DisplayNotification("No further dialogue.");
                    }

                }
            }

            if (Suspect.IsCuffed || Suspect.IsDead || Game.LocalPlayer.Character.IsDead || Suspect.Exists()) ;
            {
                End();
            }


        }

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

            if (Suspect.Exists())
            {
                Suspect.Dismiss(); 
            }

            if (SuspectBlip.Exists())
            {
                SuspectBlip.Delete();
            }

            Game.LogTrivial("AJ Callouts - Intoxicated Individual has been cleaned up.");
        }


    }
    
        
}
 

 

 

 

On 6/9/2024 at 6:38 PM, AL3K54NDER said:

namespace AJ.Callouts

Could you screen shoot your folder-structure?
Obvious you do not mean

Game.DisplayHelp("Press 'Y' to talk to the suspect.", false);

                if (Game.IsKeyDown(System.Windows.Forms.Keys.N))
That should be Y

Can you build now?
How does the Main code look? Do you have an assembly-statement?

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

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

  • Author
25 minutes ago, GTAbear said:

Could you screen shoot your folder-structure?
Obvious you do not mean

Game.DisplayHelp("Press 'Y' to talk to the suspect.", false);

                if (Game.IsKeyDown(System.Windows.Forms.Keys.N))
That should be Y

Can you build now?
How does the Main code look? Do you have an assembly-statement?

Hello. I have found the problem. I was using the wrong class library, there was one with the .NET Framework and one without it. I was using the wrong one. I have fixed it, thank you for the help.

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.