Jump to content

[SOLVED]How do you make LSPDFR plugins?


OneSimpleDuck

Recommended Posts

I know I am asking a lot of questions, I have asked like 3 in the last 3 hours but my every question needs a different post. I have already made an LSPDFR callout which has seen successful days and I am glad people like it. While still working on the callouts, I want to learn how to make LSPDFR plugins. I am pretty sure it will be pretty similar to callouts but again, I am not completely sure how similar it will be and how to setup the workspace and what all attachments are needed to make a plugin. I have knowledge in LSPDFR callout C# coding, Unity game engine C# coding, Roblox Lua, and Java and some Python. There are not also videos that I can find that show how to make a plugin. So if you guys have any idea of how to setup a normal plugin workspace or like a simple tutorial, that would be great! Thanks.

 

Edited by PTurtle

GRAY

Link to comment
Share on other sites

7 minutes ago, Rich said:

Create a non-LSPDFR plugin, then add LSPDFR as a dependency and reference it's API.

Oh alright! Also another question. Do we have to add like a main.cs file just like you do when making callout packs or the plugin only consists of one script? Also the public override void Initialize() is triggered when the plugin is loaded right? How do we make the plugin load only when the player goes on duty? And also what is in the public override void Finally() method? Is there where the plugin's content is? 

 

GRAY

Link to comment
Share on other sites

The main file should be called EntryPoint.cs.  You're correct about the Initialize method.  See my screenshot below about the OnOnDutyStateChanged event.  My InitializeFeatures method is what loads my separate plugin features and runs their logic.  The Finally method can be used to clean up anything when your plugin is being unloaded.

 

6e081a403e54566b7621a1b115c50f69.png

Edited by Rich

Released plugins

Automatic Siren Cutout | Rich's Police EnhancementsScene Manager | Rich Ambiance

Retired - No more updates

Link to comment
Share on other sites

10 minutes ago, Rich said:

The main file should be called EntryPoint.cs.  You're correct about the Initialize method.  See my screenshot below about the OnOnDutyStateChanged event.  My InitializeFeatures method is what loads my separate plugin features and runs their logic.  The Finally method can be used to clean up anything when your plugin is being unloaded.

 

6e081a403e54566b7621a1b115c50f69.png

To be honest, this cleared every single doubt from my previous question, and thanks a lot. But I am still kinda confused, where does the main code go where you actually script what the plugin does? 

GRAY

Link to comment
Share on other sites

  • The title was changed to [SOLVED]How do you make LSPDFR plugins?

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...