System::notify: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "{{ClientsideJsFunction}} Sends the user a Windows notification. {{JSContainer| == Syntax == <pre> mp.system.notify({ title, text, attribute, duration, silent }); </pre> ===...")
 
mNo edit summary
 
Line 17: Line 17:


== Examples ==
== Examples ==
Example description
A server will notify a player 5 minutes before they're kicked for AFK idle.


<pre>
<pre>

Latest revision as of 05:08, 22 April 2020

Client-Side
Function

 JavaScript



Sends the user a Windows notification.

JavaScript Syntax

Syntax

mp.system.notify({ title, text, attribute, duration, silent });

Parameters

  • title String
  • text String
  • attribute String
  • duration Int
  • silent Boolean

Examples

A server will notify a player 5 minutes before they're kicked for AFK idle.

mp.events.add('AFK_Reminder', () => {
    mp.system.notify({
        title: 'AFK Timer',
        text: `You have 5 minutes until you're kicked from the server.`,
        attribute: 'Test Roleplay',
        duration: 5,
        silent: true
    });
});


See also