Jump to content

world events/random events


Bhavin2707

Recommended Posts

Heyy guys m preparing a plugin in which i   want to include some world events i have no idea on how to do it as i am scripthookv developer i never worked with ragehook before. . . I searched in lspdfr master api it tells about callouts but not world events. . .as callouts does have their own function does world events have it too. . . . If u know any guide or if u can explain how to do it would be great :)

Link to comment
Share on other sites

You have to write them yourself, there is no API class that's usable right now.

What I do is, I have a GameFiber that runs in the background (much like a regular RPH plugin), and uses a timer/stopwatch to trigger the events at a certain interval. Note that you need to do a series of checks, to make sure the player isn't already in a pursuit or a callout, make sure that any peds you get from the world are valid/actually exist, etc.

I wrote my own base class for ambient events, which handles those checks, and any other code that is common to all the events I create. See my inheritance example on the GitHub repo...its for callouts, but the principle is the same.

However, all of that being said, I would recommend that you get yourself comfortable with the inner workings of C# and .NET first. Rome wasn't built overnight...you should be comfortable with the concepts of programming before attempting a project like this.

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!

Link to comment
Share on other sites

On Wednesday, August 17, 2016 at 9:42 PM, Stealth22 said:

You have to write them yourself, there is no API class that's usable right now.

What I do is, I have a GameFiber that runs in the background (much like a regular RPH plugin), and uses a timer/stopwatch to trigger the events at a certain interval. Note that you need to do a series of checks, to make sure the player isn't already in a pursuit or a callout, make sure that any peds you get from the world are valid/actually exist, etc.

I wrote my own base class for ambient events, which handles those checks, and any other code that is common to all the events I create. See my inheritance example on the GitHub repo...its for callouts, but the principle is the same.

However, all of that being said, I would recommend that you get yourself comfortable with the inner workings of C# and .NET first. Rome wasn't built overnight...you should be comfortable with the concepts of programming before attempting a project like this.

Heyyy. . . Thanx for the reply yaa i know m not much experienced as i am in final year of my school but m clear with my programming Skill But i still got to learn  I know u r talking about inheritance Concepts and I created A base class with all those stuff i may need. . . Actually i think i didn't Make My questions clear i wanTed to ask how to do it using rageHooK and lspdfr like there R some stuff Like initialize and finalize,Onduty check n all I did all these stuff created A new folder n created a new class accordinG to Api pdf but then what i am noT able to use tick , keydown , keyup As i used to do in scripthook v scriPts even though I added system.Windows.forms and wrote using system.windows.forms It doesnot allow me i am confused wIth all tHese stuff please make me clear of my stuff if U can i mAde a callout successfulLy but not done with the world events :(

Link to comment
Share on other sites

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