Jump to content

Can someone post some basic code examples for a total noob?


download500

Recommended Posts

I get paid to wite VBA scripts all day at work but this is my first experience with C# (btw side note, can you write callout mods in VB script?)

 

Anyway, I modified the callout example successfully and removed the vehicle and changed the ped model. Worked like a charm. When I tried to do more than that, however, LSPDFR crashed when loading the callout. 

I learned VBA myself, by looking at other people's scripts and reverse engineering them (or recording macros and reverse engineering them).

Could someone post a few examples of a complete callout script, so that new modders can tinker with it and learn by changing variables? 

 

For example if someone made a simple script that would:

1. Spawn ped at any nearby building

2. Have ped do animation X by default

3. Have ped animation change to Y when he spots the player

4. Have ped have a chance to react hostile or compliant

etc.

 

Then I could run with this and create 50 different callouts by changing the ped model/animation/callout text etc. This is kind of what I did with the example callout but any time I do more than that I screw it up because I am not that familiar with C#.

Link to comment
Share on other sites

  • Management Team

There are some examples here: https://github.com/LMSDev/LSPDFR-API/tree/master/API Examples

You cannot use VB script at all. You could however use VB.NET, however this is so different from VB script that you might as well learn C#. Plus, all the examples are in C#.

Imitation is the sincerest form of flattery.

Link to comment
Share on other sites

There are some examples here: https://github.com/LMSDev/LSPDFR-API/tree/master/API Examples

You cannot use VB script at all. You could however use VB.NET, however this is so different from VB script that you might as well learn C#. Plus, all the examples are in C#.

Thanks. Based on my experience, and knowing zero about programming outside advanced VBA in Excel, is it realistic to expect to learn to make callouts relatively quickly by mimicking others work? or is C# too complex for that and I need to read guides on intros to it first?

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