Skip to content

Commit 8abc8ff

Browse files
committed
Update v2.7.1
1 parent 7f0f7e2 commit 8abc8ff

File tree

5 files changed

+89
-11
lines changed

5 files changed

+89
-11
lines changed

client/functions/main.lua

+32-8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ MSK.Notification = function(title, message, typ, duration)
77
exports.okokNotify:Alert(title, message, duration or 5000, typ or 'info')
88
elseif Config.Notification == 'qb-core' then
99
QBCore.Functions.Notify(message, typ, duration)
10+
elseif Config.Notification == 'bulletin' then
11+
exports.bulletin:Send({
12+
message = message,
13+
timeout = duration or 5000,
14+
theme = typ or 'info'
15+
})
1016
elseif Config.Notification == 'custom' then
1117
Config.customNotification(title, message, typ or 'info', duration or 5000)
1218
else
@@ -23,10 +29,16 @@ MSK.Notify = MSK.Notification
2329
exports('Notification', MSK.Notification)
2430
RegisterNetEvent("msk_core:notification", MSK.Notification)
2531

26-
MSK.HelpNotification = function(text)
27-
BeginTextCommandDisplayHelp('STRING')
28-
AddTextComponentSubstringPlayerName(text)
29-
EndTextCommandDisplayHelp(0, false, true, -1)
32+
MSK.HelpNotification = function(text, key)
33+
if Config.HelpNotification == 'native' then
34+
BeginTextCommandDisplayHelp('STRING')
35+
AddTextComponentSubstringPlayerName(text)
36+
EndTextCommandDisplayHelp(0, false, true, -1)
37+
elseif Config.HelpNotification == 'custom' then
38+
Config.customHelpNotification(text)
39+
else
40+
MSK.TextUI.ShowThread(key, text)
41+
end
3042
end
3143
MSK.HelpNotify = MSK.HelpNotification
3244
exports('HelpNotification', MSK.HelpNotification)
@@ -37,10 +49,22 @@ MSK.AdvancedNotification = function(text, title, subtitle, icon, flash, icontype
3749
if not icontype then icontype = 1 end
3850
if not icon then icon = 'CHAR_HUMANDEFAULT' end
3951

40-
BeginTextCommandThefeedPost('STRING')
41-
AddTextComponentSubstringPlayerName(text)
42-
EndTextCommandThefeedPostMessagetext(icon, icon, flash, icontype, title, subtitle)
43-
EndTextCommandThefeedPostTicker(false, true)
52+
if Config.AdvancedNotification == 'bulletin' and GetResourceState('bulletin') == 'started' then
53+
exports.bulletin:SendAdvanced({
54+
message = text,
55+
title = title,
56+
subject = subtitle,
57+
icon = icon,
58+
timeout = 5000
59+
})
60+
elseif Config.AdvancedNotification == 'custom' then
61+
Config.customAdvancedNotification(text, title, subtitle, icon, flash, icontype)
62+
else
63+
BeginTextCommandThefeedPost('STRING')
64+
AddTextComponentSubstringPlayerName(text)
65+
EndTextCommandThefeedPostMessagetext(icon, icon, flash, icontype, title, subtitle)
66+
EndTextCommandThefeedPostTicker(false, true)
67+
end
4468
end
4569
MSK.AdvancedNotify = MSK.AdvancedNotification
4670
exports('AdvancedNotification', MSK.AdvancedNotification)

client/functions/vehicle.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ exports('GetVehicleLabel', MSK.GetVehicleLabel)
102102

103103
MSK.GetVehicleLabelFromModel = function(model)
104104
assert(model, ('Parameter "model" is nil on function GetVehicleLabelFromModel (reveived %s)'):format(model))
105-
return GetVehicleLabel(nil, model)
105+
return MSK.GetVehicleLabel(nil, model)
106106
end
107107
exports('GetVehicleLabelFromModel', MSK.GetVehicleLabelFromModel)
108108

config.lua

+21-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ Config.copyCoords = {
2626
}
2727
----------------------------------------------------------------
2828
-- Set to 'msk' for MSK UI Notification
29+
-- Set to 'native' for FiveM Native Notification
2930
-- Set to 'custom' for Config.customNotification()
3031
-- Set to 'okok' for OKOK Notification
3132
-- Set to 'qb-core' for QBCore Notification
32-
-- Set to 'native' for FiveM Native Notification
33+
-- Set to 'bulletin' for bulletin notification (https://github.com/Mobius1/bulletin)
3334
Config.Notification = 'msk'
3435

3536
-- Only for MSK Notification
@@ -47,6 +48,25 @@ Config.customNotification = function(title, message, typ, duration)
4748
-- Add your own clientside Notification here
4849
end
4950
----------------------------------------------------------------
51+
-- Set to 'native' for FiveM Native AdvancedNotification
52+
-- Set to 'custom' for Config.customAdvancedNotification()
53+
-- Set to 'bulletin' for bulletin AdvancedNotification (https://github.com/Mobius1/bulletin)
54+
Config.AdvancedNotification = 'native'
55+
56+
Config.customAdvancedNotification = function(text, title, subtitle, icon, flash, icontype)
57+
-- Set Config.AdvancedNotification = 'custom'
58+
-- Add your own clientside AdvancedNotification here
59+
end
60+
----------------------------------------------------------------
61+
-- Set to 'msk' for MSK TextUI Notification
62+
-- Set to 'native' for FiveM Native HelpNotification
63+
-- Set to 'custom' for Config.customHelpNotification()
64+
Config.HelpNotification = 'msk'
65+
66+
-- This will be called every frame -> Wait(0)
67+
Config.customHelpNotification = function(text)
68+
end
69+
----------------------------------------------------------------
5070
Config.ProgressColor = "#5eb131" -- Default Color for ProgressBar
5171
Config.TextUIColor = "#5eb131" -- Default Color for TextUI
5272
----------------------------------------------------------------

fxmanifest.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_core'
66
description 'Functions for MSK Scripts'
7-
version '2.7.0'
7+
version '2.7.1'
88

99
lua54 'yes'
1010

server/functions/registeritems.lua

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
local RegisteredItems = {}
2+
3+
MSK.GetRegisteredItems = function()
4+
return RegisteredItems
5+
end
6+
exports('GetRegisteredItems', MSK.GetRegisteredItems)
7+
8+
MSK.GetRegisteredItem = function(itemName)
9+
return RegisteredItems[itemName] or false
10+
end
11+
exports('GetRegisteredItem', MSK.GetRegisteredItem)
12+
13+
MSK.RegisterItem = function(itemName, cb)
14+
RegisteredItems[itemName] = cb
15+
16+
if RegisteredItems[itemName] then
17+
MSK.Logging('info', ('Item ^3%s^0 is already registerd. Overriding Item...'):format(itemName))
18+
end
19+
20+
if MSK.Bridge.Inventory == 'qs-inventory' then
21+
exports['qs-inventory']:CreateUsableItem(itemName, cb)
22+
elseif MSK.Bridge.Inventory ~= 'ox_inventory' then
23+
if MSK.Bridge.Framework.Type == 'ESX' then
24+
ESX.RegisterUsableItem(itemName, cb)
25+
elseif MSK.Bridge.Framework.Type == 'QBCore' then
26+
QBCore.Functions.CreateUseableItem(itemName, cb)
27+
end
28+
end
29+
30+
if MSK.Bridge.Framework.Type == 'STANDALONE' then
31+
-- Register the item here
32+
end
33+
end
34+
exports('RegisterItem', MSK.RegisterItem)

0 commit comments

Comments
 (0)