showAdvancedNotification
xPlayer.showAdvancedNotification(sender, subject, msg, textureDict, iconType, flash, saveToBrief, hudColorIndex)
This function shows an advanced notification.
Arguments
Argument | Data Type | Optional | Default Value | Explanation |
---|---|---|---|---|
sender | string | No | - | Message header |
subject | string | No | - | Message subject |
msg | string | No | - | Message content |
textureDict | string | No | - | Texture directory, see Texture Directory for accepted values |
iconType | number | No | - | Icon type, see Icon Types for accepted values |
flash | boolean | Yes | false | Flash the notification? |
savetoBreif | boolean | Yes | true | Save to brief? Located in Pause Menu > Help |
hudColorIndex | number | Yes | nil | The background color, see https://gyazo.com/68bd384455fceb0a85a8729e48216e15 for available colors |
Example
function notification(playerId, msg)
local xPlayer = ESX.GetPlayerFromId(playerId)
xPlayer.showAdvancedNotification('title', 'subject', 'msg', 'CHAR_BANK_MAZE', 9)
end
Texture Directory
To specify an texture directory you can either simply parse an already existing notification image, or you can for example create a player mugshot with ESX on the client side.
Icon Types
Icon Type | Explantation |
---|---|
1 | Chat Box |
2 | |
3 | Add Friend Request |
7 | Right Jumping Arrow |
8 | RP Icon |
9 | $ Icon |