Ui::setNotificationMessage
See Notification Pictures for a list of notification pictures. Pictures from this link have the same textureDict and textureName.
Also some of them needs to be requested with Graphics::requestStreamedTextureDict.
Syntax
mp.game.ui.setNotificationMessage(textureDict, textureName, flash, iconType, sender, subject);
Icon types
- No Icon: 0, 4, 5, 6
- Speech Bubble: 1
- Message: 2
- Friend Request: 3
- Arrow: 7
- RP: 8
- Money: 9
Required Arguments
- textureDict: String
- textureName: String
- flash: Boolean
- iconType: Int
- sender: String
- subject: String
Return value
- Int
Example
Client-Side
const notifyWithPicture = () => {
mp.game.ui.setNotificationTextEntry('STRING');
mp.game.ui.setNotificationMessage('CHAR_RON', 'CHAR_RON', false, 2, 'New Message', 'Hello World!');
};
notifyWithPicture();
Output:
Values textureDict and textureName gives you ability to make custom notifcation pictures using: Using_DLC_Packs_with_Custom_Textures
Client-Side
// Before using your custom textures you must request them by this function
mp.game.graphics.requestStreamedTextureDict('notifications', true);
const notifyWithPicture = () => {
mp.game.ui.setNotificationTextEntry('STRING');
mp.game.ui.setNotificationMessage('notifications', 'rage', false, 2, 'New Message', 'Hi, now your notifications look ~y~beast');
};
notifyWithPicture();
Output:
or using in-game sprites and textures (see Textures):
Client-Side
// Just in case you should request textureDict
mp.game.graphics.requestStreamedTextureDict('commonmenu', true);
const notifyWithPicture = () => {
mp.game.ui.setNotificationTextEntry('STRING');
return mp.game.ui.setNotificationMessage('commonmenu', 'mp_specitem_cash', false, 9, 'New notification!', 'Your account has been charged');
};
notifyWithPicture();
Output: