Samuel's Development, Official Documentation
  • 🎉Welcome
  • 📑Overview
    • Resources
      • Bobcat Weapon Heist
        • Installation Guide
        • Configuration
      • Traphouse Robbery
        • Installation Guide
        • Configuration
      • Pacific Bank Heist
        • Installation Guide
        • Configuration
      • Oxy Run
        • Installation Guide
        • Configuration
      • Dumpster Diving
        • Installation Guide
        • Configuration
        • Log Configuration
      • Warehouse Heist
        • Installation Guide
        • Configuration
      • Oil Rig
        • Installation Guide
        • Configuration
      • Beekeeping
        • Installation Guide
        • Configuration
        • Log Configuration
      • Yacht Robbery
        • Installation Guide
        • Configuration
      • Notify
        • Installation
        • Configuration
      • Cocaine Mission
        • Installation Guide
        • Configuration
      • Advanced Drug Sales
        • Installation Guide
        • Configuration
    • Library
      • Installation & Integration
      • Modules
        • Client
          • Callback
          • StartProgress
          • LoadAnim
          • LoadModel
          • LoadPtfxAsset
          • ShowNotification
          • SendEmail
          • PoliceDispatch
          • StartHack
        • Server
          • Callback
          • Name
          • Money
          • Logger
          • Inventory
          • HasGroup
          • GetPlayer
          • GetPlayers
          • GetPlayerByIdentifier
          • GetIdentifier
          • GetPlayerGender
          • CheckVersion
        • Shared
          • Array
          • Table
          • String
          • Math
          • Locale
            • JSON Example
          • AwaitLoad
          • Framework
  • 📚F.A.Q
    • How do I change Locales?!
    • How to add Police Alerts?!
    • What types of dirty money are supported?
Powered by GitBook
On this page
  • Overview
  • Selection Process for Notification Method
  • Parameters
  • Usage Example
  1. Overview
  2. Library
  3. Modules
  4. Client

ShowNotification

The SD.ShowNotification function serves to display notifications.

Overview

Purpose: Displays notifications to the user, leveraging the most suitable method determined by available libraries or game frameworks.

Selection Process for Notification Method

A helper function named Notification is utilized to determine and return the best-suited function for displaying notifications. It performs the following checks and configurations:

  • Library Availability: If a specific library (lib) is available, it employs lib.notify for notification functionality.

  • Framework-Based Methods: In the absence of the library, it checks the active framework (Framework) and selects an appropriate method based on whether the framework is 'esx', 'qb', or 'qbx'.

  • Fallback Strategy: If neither a library nor a supported framework is available, it provides a fallback function that either does nothing or throws an error, indicating the lack of support for notifications.

Parameters

  • message (string): The content of the notification to be displayed.

  • type (string): Specifies the type of notification, influencing the visual style or urgency (e.g., error, success, info).

Usage Example

-- Example of using SD.ShowNotification
SD.ShowNotification("Quest completed successfully!", "success")
SD.ShowNotification("Unable to connect to the server.", "error")
PreviousLoadPtfxAssetNextSendEmail

Last updated 1 year ago

📑