With this resource you can create notifications, like shown above.
To install this script, just download the latest release or download the repository
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 |