Skip to content

Switty6/swt_notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swt_notifications

FiveM notification system using Quasar framework and Material Design Icons.

Screenshots are here

Installation

  • Download the last release
  • Unzip the folder
  • Drag and drop the swt_notifications into your resources folder
  • Don´t forget to add ensure swt_notifications in your server.cfg

Edit

To edit the file you have to:

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files


Documentation

caption = string, represents the caption/small title under message

message = string, message you want to show up

position = string, can take the following values: top top-left top-right center left right bottom bottom-left bottom-right

color = string, list of colors found -> here

textColor = string | represents the color of the text, list of colors found -> here

timeout = int, 1000 represents 1 second

progress = true/false, specify if it shows the time remaining bar

icon = string, list of icons found -> here


Default

--Client
TriggerEvent("swt_notifications:default",message,position,color,textColor,timeout,progress)
--or
exports['swt_notifications']:Default(message,position,color,textColor,timeout,progress)

--Server
TriggerClientEvent("swt_notifications:default",source,message,position,color,textColor,timeout,progress)

With Caption

--Client
TriggerEvent("swt_notifications:caption",caption,message,position,timeout,color,textColor,progress)
--or
exports['swt_notifications']:Caption(caption,message,position,timeout,color,textColor,progress)

--Server
TriggerClientEvent("swt_notifications:caption",source,caption,message,position,timeout,color,textColor,progress)

Infomative notification

Info

--Client
TriggerEvent("swt_notifications:Info",caption,message,position,timeout,progress)
--or
exports['swt_notifications']:Info(caption,message,position,timeout,progress)

--Server
TriggerClientEvent("swt_notifications:Info",source,caption,message,position,timeout,progress)

Success

Sucess

--Client
TriggerEvent("swt_notifications:Success",caption,message,position,timeout,progress)
--or
exports['swt_notifications']:Success(caption,message,position,timeout,progress)

--Server
TriggerClientEvent("swt_notifications:Success",source,caption,message,position,timeout,progress)

Warning

Warning

--Client
TriggerEvent("swt_notifications:Warning",caption,message,position,timeout,progress)
--or
exports['swt_notifications']:Warning(caption,message,position,timeout,progress)

--Server
TriggerClientEvent("swt_notifications:Warning",source,caption,message,position,timeout,progress)

Negative

Negative

--Client
TriggerEvent("swt_notifications:Negative",caption,message,position,timeout,progress)
--or
exports['swt_notifications']:Negative(caption,message,position,timeout,progress)

--Server
TriggerClientEvent("swt_notifications:Negative",caption,message,position,timeout,progress)

With Icon

Icon

--Client
TriggerEvent("swt_notifications:Icon",message,position,timeout,color,textColor,progress,icon)
--or
exports['swt_notifications']:Icon(message,position,timeout,color,textColor,progress,icon)

--Server
TriggerClientEvent("swt_notifications:Icon",source,message,position,timeout,color,textColor,progress,icon)

With Icon and Caption

CaptionIcon

--Client
TriggerEvent("swt_notifications:captionIcon",caption,message,position,timeout,color,textColor,progress,icon)
--or
exports['swt_notifications']:CaptionIcon(caption,message,position,timeout,color,textColor,progress,icon)

--Server
TriggerClientEvent("swt_notifications:captionIcon",caption,message,position,timeout,color,textColor,progress,icon)

Example to use

TriggerEvent("swt_notifications:Icon","Hey, this is an example","top",2500,"blue-10","white",true,"mdi-earth")
--or
exports['swt_notifications']:Icon("Hey, this is an example","top",2500,"blue-10","white",true,"mdi-earth")
--Server
TriggerClientEvent("swt_notifications:Icon",source,"Hey, this is an example","top",2500,"blue-10","white",true,"mdi-earth")

Credits

Thanks Hugo for updated docs and exports!

Contributing

Pull requests are welcome.

License

MIT

My tebex

https://switty.tebex.io/category/1779708