Popup notifications that can be created by admin and other plugins

Supported Games

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

Permissions

  • popupnotifications.send - Allows players with permission to use chat command to send a popup message

Chat Commands

  • /popupmsg "message" -- Create a notification for everyone on the server
  • /popupmsg "player name" "message"` -- Create a notification for a player

Console Commands

  • popupmsg.global "message" duration -- Create a notification for everyone on the server (duration is optional)
  • popupmsg.toplayer "message" "player name" duration -- Create a notification for a player (duration is optional)

Configuration

{
  "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

Developer API

To call the functions from this API your plugin needs to get the plugin instance.

[PluginReference]
Plugin PopupNotifications;

You can then use this to create notifications using the CreatePopupNotification method.

PopupNotifications?.Call("CreatePopupNotification", "Test message");

Example

using Oxide.Core.Plugins;

namespace Oxide.Plugins
{
    [Info("Popup Test", "k1lly0u", 0.0.1)]
    class PopupTest : CovalencePlugin
    {
        [PluginReference]
        Plugin PopupNotifications;

        private void Loaded()
        {
            if (!PopupNotifications)
            {
                Puts("PopupNotifications is not loaded! https://umod.org/plugins/popup-notifications");
                return;
            }

            PopupNotifications.Call("CreatePopupNotification", "Test message");
        }
    }
}

MIT License


Copyright (c) 2020 k1lly0u


Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.