GithubHelp home page GithubHelp logo

bobbyswaggtv / sy_notify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from syno-sy/sy_notify

0.0 0.0 0.0 176 KB

FiveM notification script for rp servers

License: GNU General Public License v3.0

JavaScript 45.77% Lua 15.38% CSS 4.19% HTML 34.67%

sy_notify's Introduction

SY_Notify

Dependency

Installation

  • Download the file and put it in the resource directory
  • Install Sql
      CREATE TABLE IF NOT EXISTS `sy_notify` (
     `identifier` varchar(65) DEFAULT NULL,
     `position` longtext DEFAULT NULL,
      UNIQUE KEY `identifier` (`identifier`) USING HASH
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  • Rename the Folder to SY_Notify.
  • Add ensure SY_Notify in you're server.cfg
  1. To display a notification you should call it like below:

    1. Using Client Side:
       exports['SY_Notify']:Alert("Title", "Message", Time, 'type')
    1. Using Server Side:
       TriggerClientEvent('SY_Notify:Alert', source, "Title", "Message", Time, 'type')
  2. To set the notification display time, use:

    1. 1000 - [1 second]
    2. 2000 - [2 seconds]
    3. 5000 - [5 seconds]
    4. 10000 - [10 seconds]
    5. etc...
  3. To change the type of notification, use this types of notifications:

    1. success
    2. info
    3. warning
    4. error
    5. announcement
  4. IF YOU NEED TO ADD THIS NOTIFICATION AS DEFAULT IN ESX LEGACY ADD THE GIVEN CODE IN @es_extended/client/function.lua

   function ESX.ShowNotification(message, type, length)
      if GetResourceState("esx_notify") ~= "missing" then
         exports["esx_notify"]:Notify(type, length, message)
      else
         print("[^1ERROR^7] ^5ESX Notify^7 is Missing!")
      end
   end

replace it with

   function ESX.ShowNotification(message, type, length)
      if GetResourceState("SY_Notify") ~= "missing" then
         exports['SY_Notify']:Alert("NOTIFICATION", message, length, type)
      else
         print("[^1ERROR^7] ^5SY_NOTIFY^7 is Missing!")
      end
   end

sy_notify's People

Contributors

syno-sy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.