Clientside

This functions are clientside ONLY

MSK.RegisterClientCallback

Register Synchron Client Callback (MSK.TriggerClientCallback)

MSK.RegisterClientCallback("Callback_Name", function(playerId, ...)
    return ...
end)

MSK.Trigger

MSK.TriggerServerCallback still works but it's using a outdated method.

Trigger Synchron Server Callback (MSK.Register)

local data = MSK.Trigger("Callback_Name", ...)

Example

local value1, value2  = 'Test', 'Test2'
local data, data2 = MSK.Trigger("Callback_Name", value1, value2)
print(data, data2) -- Output: 'Test', 'Test2'

MSK.Notification

Show a Notification. info and duration is optional. Look at Flipz-Alert for better understanding.

MSK.Notification(title, message, info, duration)

Example

MSK.Notification('Title', 'This is a Notification', 'general', 5000)

MSK.HelpNotification

Show a Help Notification

MSK.HelpNotification(text)

Example

MSK.HelpNotification('Press ~g~E~s~ to open')

MSK.AdvancedNotification

Show a Picture Notification

-- flash and iconType are optional
MSK.AdvancedNotification(text, title, subtitle, icon, flash, icontype)

Example

MSK.AdvancedNotification('This is a Notification', 'Title', 'Subtitle', 'CHAR_HUMANDEFAULT', true, 1)

MSK.Draw3DText

Draw a 3D Text (size and font is optional)

MSK.Draw3DText(location, text, size, font)

Example

local location = GetEntityCoords(PlayerPedId())
MSK.Draw3DText(location, 'This is the Label Text', 1, 0)
MSK.Draw3DText(location, 'This is the Label Text')

MSK.HasItem

Checks if you have the item in your inventory (only for ESX or QBCore)

MSK.HasItem(itemName)

Example

local hasItem = MSK.HasItem('bread') -- returns: name, label, count

MSK.Input

Opens an Input Window. You can use MSK.Input or exports.msk_core:openInput

More Information can be found here: https://github.com/MSK-Scripts/msk_input

-- Small Input Window
MSK.Input('This is a Header', 'This is a Placeholder', function(input)
    if not input then return end

    print(input)
end)

-- Big Input Window
MSK.Input('This is a Header', 'This is a Placeholder', true, function(input)
    if not input then return end

    print(input)
end)

MSK.GetPedMugshot

Get the PedMugshot from a specific Ped.

local mugshot, mugshotStr = MSK.GetPedMugshot(ped, transparent --[[boolean]])
UnregisterPedheadshot(mugshot) -- You have to call this to delete the unregister the mugshot after use

Example

local mugshot, mugshotStr = MSK.GetPedMugshot(PlayerPedId(), true) -- transparent = whether transparent background or not
MSK.AdvancedNotification('Message', 'Title', 'Subtitle', mugshotStr)
UnregisterPedheadshot(mugshot)

MSK.ProgressStart

Shows a progressbar. color is optional and can be set in config.lua.

MSK.ProgressStart(time, text, color)

Example

MSK.ProgressStart(5000, 'Progressing...') -- default color set in config.lua
MSK.ProgressStart(5000, 'Progressing...', "#5eb131") -- custom color

MSK.ProgressStop

Stops the current ProgressBar.

MSK.ProgressStop()

Last updated