1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Popup Notifications

Popup notifications that can be created by admins and other plugins

Total Downloads: 9,201 - First Release: Jul 22, 2015 - Last Update: Feb 18, 2018

5/5, 30 likes

  1. k1lly0u
    This plugin adds customizable UI notifications. Admins and other plugins can create notifications.

    2015-07-21_00001.jpg

    Admin commands

    /popupmsg "message" --- Creates a notification for everyone on the server.
    /popupmsg "player name" "message" --- Creates a notification for a player.

    Console commands
    popupmsg.global "message" duration --- Creates a notification for everyone on the server. Duration is optional.
    popupmsg.toplayer "message" "player name" duration --- Creates a notification for a player. Duration is optional.

    Permissions
    "popupnotifications.send" - Allows users with this permission to use the chat command to send a popup message

    Config
    Code:
    {
      "Notification duration (in seconds)": 8,
      "Maximum notifications shown at any time": 8,
      "UI Positioning": {
        "Position of the left side of notification (0.0 - 1.0)": 0.8,
        "Position of the bottom of noticiation (0.0 - 1.0)": 0.78,
        "Width (0.0 - 1.0)": 0.19,
        "Height (0.0 - 1.0)": 0.1,
        "Space between notification (0.0 - 1.0)": 0.01
      },
      "UI Options": {
        "Show close button": true,
        "Panel color (hex)": "#2b2b2b",
        "Panel transparency (0.0 - 1.0)": 0.5,
        "Close button color (hex)": "#d85540",
        "Close button transparency (0.0 - 1.0)": 0.5,
        "Font": "droidsansmono.ttf",
        "Font size": 12
      },
      "Version": {
        "Major": 0,
        "Minor": 1,
        "Patch": 3
      }
    }
    
    Available fonts:
    • "daubmark.ttf"
    • "droidsansmono.ttf"
    • "robotocondensed-bold.ttf"
    • "robotocondensed-regular.ttf"
    For plugin developers
    To call the functions from this API your plugin needs to get the plugin instance.
    Code:
    [PluginReference]
    Plugin PopupNotifications;
    Code:
    local popupApi = plugins.Find("PopupNotifications")
    You can then use this to create notifications using the CreatePopupNotification method.
    Code:
    PopupNotifications?.Call("CreatePopupNotification", "Test message");
    Code:
    popupApi:CallHook("CreatePopupNotification", "Test message")
    Example
    Code:
    using Oxide.Core.Plugins;
    
    namespace Oxide.Plugins
    {
        [Info("Popup Test", "emu", 0.0.1)]
        class PopupTest : RustPlugin
        {
            [PluginReference]
            Plugin PopupNotifications;
    
            void Loaded()
            {
                if (!PopupNotifications)
                {
                    Puts("PopupNotifications is not loaded! http://oxidemod.org/plugins/popup-notifications.1252/");
                    return;
                }
                PopupNotifications?.Call("CreatePopupNotification", "Test message");
            }
        }
    }
    Code:
    PLUGIN.Title = "Popup Test"
    PLUGIN.Version = V(0, 0, 1)
    PLUGIN.Author = "emu"
    
    function PLUGIN:Init()
        local popupApi = plugins.Find("PopupNotifications")
        if not popupApi then print("PopupNotifications is not loaded! http://oxidemod.org/plugins/popup-notifications.1252/") return end
        popupApi:CallHook("CreatePopupNotification", "Test message")
    end
    Code:
    class popuptest:
    
        def __init__(self):
    
            self.Title = "Popup Test"
            self.Author = "emu"
            self.Version = V(0, 0, 1)
    
        def Init(self):
    
            PopupAPI = plugins.Find("PopupNotifications")
    
            if not PopupAPI:
                print("PopupNotifications is not loaded! http://oxidemod.org/plugins/popup-notifications.1252/")
                return
    
            PopupAPI.CallHook("CreatePopupNotification", "Test Message")