Skip to content

mcschirl/altv-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

altv-notifications

Features

With this resource you can create notifications, like shown above.

Install

To install this script, just download the latest release or download the repository

Usage

You can either create them clientside with CreateNotification:

export function CreateNotification(type: number, duration: number, title: string, message: string) {
    if (webview) webview.emit('notifications:create', {id: 0, type: type, duration: duration, title: title, message: message});
}

Or you can just emit from server here:

alt.onServer('notifications:create', (type: number, duration: number, title: string, message: string) => {
    if (webview) webview.emit('notifications:create', {id: 0, type: type, duration: duration, title: title, message: message});
})

Example:

alt.emitClient(player, 'notifications:create', 0, 5, 'My title', 'My super cool message');

Notification types:

Type Number
Information 0
Announcement 1
Success 2
Warning 3
Error 4

IMPORTANT: duration must be seconds not ms

I hope you enjoy my small script

About

A simple notification script made with typescript and vue.js

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors