Version 2.1.0
2331 downloads
Now with 200% more color.
Clientside Functions:
mp.game.ui.notifications.show(message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200])
mp.game.ui.notifications.showWithPicture(title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200])
Serverside Functions:
player.notify(message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200])
player.notifyWithPicture(title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200])
As Events:
BN_Show(message, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200])
BN_ShowWithPicture(title, sender, message, notifPic, icon = 0, flashing = false, textColor = -1, bgColor = -1, flashColor = [77, 77, 77, 200])
Example:
// Clientside
mp.game.ui.notifications.show("Normal message with custom text and background color.", false, 15, 20);
mp.game.ui.notifications.showWithPicture("New Message", "Facebook", "You got some more of that data?", "CHAR_FACEBOOK", 1, false, 0, 139);
// Serverside
player.notify("This message is red which means you're doing something wrong.", false, 6);
player.notifyWithPicture("Title", "Ammu-Nation", "Ammunation has all the equipment you need to protect your family from the evils of a liberal society! Fixed, mounted, and shoulder-held submachine guns. Mortars! Surface-to-air and all manner of heat-seeking missiles!", "CHAR_AMMUNATION");
Icons:
You can specify an icon ID for picture notifications, here's a list of them:
0, 4, 5, 6 = No Icon
1 = Speech Bubble
2 = Message
3 = Friend Request
7 = Arrow
8 = RP
9 = Money
Notes:
textColor and bgColor parameters want a HUD color ID which you can find here. (it is a bit outdated now though)
You can find notification pictures here.
If you can't see picture notifications, you must enable Phone Alerts from Settings > Notifications > Phone Alerts.
This script changes player.notify on serverside.