MSK.Register("Callback_Name", function(source,arg1,arg2, ...)return...end)-- ExampleMSK.Register("msk_testing:serverCallback:1", function(source,a,b,c)print(source, a, b, c)return a, b, cend)MSK.Register("msk_testing:serverCallback:2", function(source,cb,a,b,c)print(source, a, b, c) cb(a, b, c)print('Have fun!')end)
local data = MSK.Trigger("Callback_Name", source, arg1, arg2, ...)-- Examplelocal a, b, c = MSK.Trigger("msk_testing:clientCallback", source, '123', '456', '789')print(a, b, c)
MSK.AddWebhook
Discord Webhook
Parameterswebhook - string - The Discord Webhook Link
color - string - Color for the Embed Message
botName - string - The name of the bot
botAvatar - string - Bot Avatar Link
title - string - The Embed Message Title
description - string - the Embed Message
fields - table - Fields
footer - table <text, link> - Embed Message Footer
time - string - Time in the footer
If you don't want to use f.e. footer then set footer = false to deactivate the footer.
Show a Notification.
You can use farbcodes like: ~g~
Preview
Parameterssource - string/number - The Player Server ID
title - string - Title
message - string - Message Text
info - string - Optional - Default: general
time - number <miliseconds> - Optional - Default: 5000
MSK.Notification(source, title, message, info, duration)-- ExampleMSK.Notification(source, 'Title', 'This is a Notification', 'general', 5000)
MSK.AdvancedNotification
Shows a Picture Notification
Parameterssource - string/number - The Player Server ID
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 optionalMSK.AdvancedNotification(source, text, title, subtitle, icon, flash, icontype)-- ExampleMSK.AdvancedNotification(source, 'This is a Notification', 'Title', 'Subtitle', 'CHAR_HUMANDEFAULT', true, 1)
MSK.HasItem
Checks if you have the item in your inventory (only for ESX or QBCore)
ParametersplayerId - number - The ServerId of the player
item - string - The item name
ReturnshasItem - table <name, label, count> - If the player has the item
Parameterskey - string - Optional
value - string - Optional
ReturnsPlayers - table <key, Player> - The PlayerData
local Players = MSK.GetPlayers() -- returns all players on the serverlocal Players = MSK.GetPlayers('job', 'police') -- returns only players with that specified joblocal Players = MSK.GetPlayers('gang', 'bloods') -- returns only players with that specified gang *(Only QBCore)*local Players = MSK.GetPlayers('group', 'admin') -- returns only player that have the group/permission 'admin'
MSK.Cron.Create
Create a Cronjob
Parametersdate - table <w, d, h, m, atD, atH, atM> - The datetime when the cron will be executed
data - any - You can set you own data to use it later when executing
ReturnsuniqueId - number - UniqueId of the Cronjob
data - any - Your data from parameters
date - table <d, h, m> - The current Datetime
-- Will be executed every minuteMSK.Cron.Create({m =1}, 'Cronjob executed at', function(uniqueId,data,date)print(data) -- Output: 'Cronjob executed at'print('Day: ' .. date.d, 'Hour: ' .. date.h, 'Minute: ' .. date.m)end)-- Will be executed every hourMSK.Cron.Create({h =1}, 'Cronjob executed at', function(uniqueId,data,date)print(data) -- Output: 'Cronjob executed at'print('Day: ' .. date.d, 'Hour: ' .. date.h, 'Minute: ' .. date.m)end)-- Will be executed every dayMSK.Cron.Create({d =1}, 'Cronjob executed at', function(uniqueId,data,date)print(data) -- Output: 'Cronjob executed at'print('Day: ' .. date.d, 'Hour: ' .. date.h, 'Minute: ' .. date.m)end)-- Will be executed every day at 18:30MSK.Cron.Create({atH =18, atM =30}, 'Cronjob executed at', function(uniqueId,data,date)print(data) -- Output: 'Cronjob executed at'print('Day: ' .. date.d, 'Hour: ' .. date.h, 'Minute: ' .. date.m)end)-- Will be executed every monday at 18:30MSK.Cron.Create({atD =1, atH =18, atM =30}, 'Cronjob executed at', function(uniqueId,data,date)print(data) -- Output: 'Cronjob executed at'print('Day: ' .. date.d, 'Hour: ' .. date.h, 'Minute: ' .. date.m)end)
MSK.Cron.Delete
Deletes a specific Cronjob
ParametersuniqueId - number - The UniqueId of the Cronjob
Returnssuccess - boolean <true/false> - If the Cronjob Id was found and deleted.
local success = MSK.Cron.Delete(uniqueId)
MSK.BanPlayer
This will ban a player
ParametersplayerId - number - The ServerId of the player who banned someone - Optional
targetId - number - The ServerId of the player who gets banned
time - string - The Time until the player gets unbanned
reason - string - The Reason why the player gets banned
DescriptionFor the Parameter time you can set different types.
1M = 1 Minute
1H = 1 Hour
1D = 1 Day
1W = 1 Week
P = Permanent
MSK.BanPlayer(playerId, targetId, time, reason)-- Player gets banned for 2 days for reason cheatingMSK.BanPlayer(playerId, targetId, '2D', 'cheating')
MSK.UnbanPlayer
This will unban a player
ParametersbanId - number - The BanId
DescriptionThe Parameter banId is the id in msk_bansystem database
MSK.UnbanPlayer(banId)
MSK.IsPlayerBanned
This will check if the given player is banned
ParametersplayerId - number - The ServerId of the player
ReturnsisBanned - boolean or table - If the player is banned or not
isExpired - boolean or nil - If the Ban is expired or not
Description
On a future update we implement that you can search for specific identifiers like license, discord, etc.
local isBanned, isExpired = MSK.IsPlayerBanned(playerId)-- If isBanned then isBanned is a table -- If not isBanned then isExpired is a boolean <true/false>-- {id = banId, ids = playerIds, reason = reason, time = timeUntil, from = bannedBy}-- If not isBanned then isBanned is a boolean <false>-- If not isBanned then isExpired is nil