CreateTrayNotification: Difference between revisions
Jump to navigation
Jump to search
(Added examples and a note) |
(Change parameter name) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This functions creates a notification ballon on the desktop. | This functions creates a notification ballon on the desktop. | ||
Line 8: | Line 7: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool createTrayNotification ( string notificationText, [ string | <syntaxhighlight lang="lua">bool createTrayNotification ( string notificationText, [ string iconType = "default", bool useSound = true ] )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
Line 14: | Line 13: | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
*''' | *'''iconType:''' The notification icon type. Possible values are: '''"default" (the MTA icon), "info", "warning", "error"''' | ||
*'''useSound:''' A boolean value indicating whether or not to play a sound when receiving the notification. | *'''useSound:''' A boolean value indicating whether or not to play a sound when receiving the notification. | ||
Revision as of 18:33, 20 October 2016
This functions creates a notification ballon 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 ingame. 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
- iconType: The notification icon type. Possible values are: "default" (the MTA icon), "info", "warning", "error"
- useSound: A boolean value indicating whether or not to play a sound when receiving the notification.
Returns
Returns true if the notification is correctly created, false otherwise.
Example
-- Note: You have to wait 30 seconds before showing another tray notification, there is no queuing -- Show a 'Hello World' notification createTrayNotification( "Hello World" ) -- Show a notification with a warning symbol createTrayNotification( "Hello World", "warning" ) -- Show a default notification without sound createTrayNotification( "Hello World", "default", false )
See Also
- addDebugHook
- base64Decode
- base64Encode
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace
- createTrayNotification
- debugSleep
- downloadFile
- decodeString
- encodeString
- fromJSON
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getFPSLimit
- getKeyboardLayout
- getLocalization
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimers
- getTimerDetails
- gettok
- getUserdataType
- getVersion
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isShowCollisionsEnabled
- isShowSoundEnabled
- isTimer
- isTransferBoxAlwaysVisible
- isTransferBoxVisible
- isTrayNotificationEnabled
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setClipboard
- setDevelopmentMode
- setFPSLimit
- setTimer
- setTransferBoxVisible
- setWindowFlashing
- sha256
- showCol
- showSound
- split
- teaDecode
- teaEncode
- tocolor
- toJSON
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub