createTrayNotification
Client-side
Server-side
Shared
Manual Review Required
Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.
This function creates a notification balloon on the desktop.
Note
MTA won't show any tray notifications if the MTA window is focused, because there is no reason to show tray notifications if you are in-game. If you want to test this function you should use a Timer and switch to your desktop.
Note
You can only show a tray notification every 30 seconds.
Syntax
bool createTrayNotification ( string notificationText, [ string iconType = "default", bool useSound = true ] )Required Arguments
- notificationText: The text to send in the notification.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- iconType (default: "default"): The notification icon type. Possible values are: "default" (the MTA icon), "info", "warning", "error"
- useSound (default: true): A boolean value indicating whether or not to play a sound when receiving the notification.
Returns
- bool: value
Returns true if the notification is correctly created, false otherwise.
Code Examples
shared
-- Note: You have to wait 30 seconds before showing another tray notification, there is no queuing
createTrayNotification("Hello World") -- Show a 'Hello World' notification
createTrayNotification("Hello World", "warning") -- Show a notification with a warning symbol
createTrayNotification("Hello World", "default", false) -- Show a default notification without soundSee Also
Utility Functions
- addDebugHook
- bitAnd
- bitArShift
- bitExtract
- bitLRotate
- bitLShift
- bitNot
- bitOr
- bitReplace
- bitRRotate
- bitRShift
- bitTest
- bitXor
- createTrayNotification
- debugSleep
- decodeString
- deref
- downloadFile
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getKeyboardLayout
- getLocalization
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getProcessMemoryStats
- getRealTime
- getServerIp
- getTickCount
- getTimerDetails
- getTimers
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTimer
- isTimerPaused
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- ref
- removeDebugHook
- resetTimer
- setClipboard
- setDevelopmentMode
- setFPSLimit
- setTimer
- setTimerPaused
- setTransferBoxVisible
- setWindowFlashing
- sha256
- showCol
- showSound
- split
- teaDecode
- teaEncode
- tocolor
- toJSON
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub