Jump to content
Joshy24

Plugin Development: Main()

Recommended Posts

Hi everyone,

As someone who isn't new to C#, but is new to plugin dev, it seems like if I run my code loop through Main(), it will hog the whole of  LSPDFR will halt, or if I have my code loop through OnOnDutyStateChanged it works, however when I force start duty (jump + F9) it seems to have really weird side effects to LSPDFR. Is there something I'm missing or perhaps I am forgetting something really simple? I can get my code to work, it's just that when accepting a callout, the flashing radius blip won't update to the 'enemy', thus kind of halting everything anyway.

Thanks everyone in advance

Share this post


Link to post
Share on other sites

Do you make sure to return execution via GameFiber.Yield or GameFiber.Sleep? Because all native invocations have to be synced with the game's scripting engine, there is no real multithreading and threads must return control each tick.

Share this post


Link to post
Share on other sites

How exactly do you make a plugin? Is there an  API example of a plugin (similar to the one available for callouts) that loads when you go on duty, that constantly checks for button pushes so that I could write a script that toggles based on a button push?

Edited by download500

Share this post


Link to post
Share on other sites
16 minutes ago, download500 said:

How exactly do you make a plugin? Is there an  API example of a plugin (similar to the one available for callouts) that loads when you go on duty, that constantly checks for button pushes so that I could write a script that toggles based on a button push?

Check out the vehicle indicators SDK example. That should give you help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×