Client

Functions - Clientside

MSK.Register

Register Client Callback (MSK.Trigger)

MSK.Register("Callback_Name", function(playerId, arg1, arg2, ...)
    return ...
end)

-- Example
MSK.Register("msk_testing:clientCallback", function(source, a, b, c)
    print(source, a, b, c)
    return a, b, c
end)

MSK.Trigger

Trigger Server Callback (MSK.Register)

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

-- Example
local a, b, c = MSK.Trigger("msk_testing:serverCallback:1", '123', '456', '789')
print(a, b, c)

MSK.TriggerCallback

Trigger Server Callback (MSK.Register)

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

-- Example
local a, b, c = MSK.TriggerCallback("msk_testing:serverCallback:2", '123', '456', '789')
print(a, b, c)

MSK.Notification

Show a Notification.

Parameters title - string - Title message - string - Message Text info - string - Optional - Default: general time - number <miliseconds> - Optional - Default: 5000

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

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

MSK.HelpNotification

Show a Help Notification

Parameters text - string - Text

MSK.HelpNotification(text)

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

MSK.AdvancedNotification

Show a Picture Notification

Parameters text - string - Text title - string - Title subtitle - string - Subtitle icon - string - Optional - Default: CHAR_HUMANDEFAULT flash - boolean - Optional - Default: true icontype - number - Optional - Default: 1

-- 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)

Parameters location - table <x, y, z> / vector3 - Location text - string - Text size - number - Optional - Default: 1 font - number - Optional - Default: 0

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)

Parameters itemName - string - The item name

Retuns hasItem - table <name, label, count> - If the player has the item

local hasItem = MSK.HasItem(itemName)

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

MSK.Input

Opens an Input Window.

Parameters header - string - Header Text placeholder - string - Placeholder text field - boolean - Small Input or Big Input

Retuns input - string/number - 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.CloseInput

Closes the current Input Window.

MSK.CloseInput()

MSK.GetPedMugshot

Get the PedMugshot from a specific Ped.

Parameters playerPed - number - The Player Ped transparent - boolean - Transparent Background

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)
MSK.AdvancedNotification('Message', 'Title', 'Subtitle', mugshotStr)
UnregisterPedheadshot(mugshot)

MSK.ProgressStart

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

Parameters time - number <miliseconds> - The time in miliseconds text - boolean - Text color - string - Color as hex

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()

MSK.Numpad

Opens an Numpad Window.

Parameters pin - string - The correct Pin showPin - boolean - Show Numbers or ****

Retuns isCorrect - boolean - If the inserted pin is correct or not

MSK.Numpad('1234', true, function(isCorrect)
    logging('debug', 'Correct:', isCorrect)
end)

MSK.CloseNumpad

Closes the current Numpad Window.

MSK.CloseNumpad()

Last updated