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.

Simple dialouge system for scripting

Featured Replies

Hey there.

I coded a very simple dialouge system to enhance the immersion of GTA V scripts / LSPDFR callouts.

Here's the GitHub repo: https://github.com/LouiDev/DialougeSystem

 

It's only one file called DialougeSystem.cs.

 

Usage:

The class has the following methods:

  • void Progress() - Progresses the dialouge
  • void Reset() - Resets the dialouge
  • void AddActionToIndex() - Adds an Action that will be executed once the dialouge reaches the specified index 
  • string GetCurrentMessage() - Gets the current message of the dialouge
  • bool Isrunning() - Checks if dialouge is running
  • bool HasStarted() - Checks if dialouge has started
  • bool HasFinished() - checks if dialouge has finished

 

Example usage:
Creating a dialouge:

DialougeSystem dialougeSystem = new DialougeSystem(new string[]
{
    "~g~You: ~w~Hey there, what's up!",
    "~b~Friend: ~w~Sup, dude! How's it going?"
});

 

Adding an action:

dialougeSystem.AddActionToIndex(1, () =>
{
    // This would be executed once the dialouge reaches the index of 1
    // Do Something
});


Updating the dialouge:

// In some form of an Update method
public void Update()
{
    // Check input
    if (PlayerCanInteract())
    {
        // Use Progress() to progress the dialouge
        dialougeSystem.Progress();
    }

    // Display the current message
    // Use GetCurrentMessage() to get the current message
    ShowMessageToPlayer(dialougeSystem.GetCurrentMessage());
}

 

 

Cheers!

Edited by LouiDev

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.