Server
Functions - Serverside
MSK.Register
Register Server Callback (MSK.Trigger)
MSK.Register("Callback_Name", function(source, arg1, arg2, ...)
return ...
end)
-- Example
MSK.Register("msk_testing:serverCallback:1", function(source, a, b, c)
print(source, a, b, c)
return a, b, c
end)
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)
-- As an Export:
exports.msk_core:Register("msk_testing:serverCallback:1", function(source, a, b, c)
print(source, a, b, c)
return a, b, c
end)MSK.Trigger
Trigger Client Callback (MSK.Register)
MSK.AddWebhook
Discord Webhook
Parameters
webhook - 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.
MSK.Notification
Show a Notification.
You can use farbcodes like: ~g~
Parameters
source - 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.AdvancedNotification
Shows a Picture Notification
Parameters
source - 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
MSK.HasItem
Checks if you have the item in your inventory (only for ESX or QBCore)
Parameters
playerId - number - The ServerId of the player
item - string - The item name
Returns
hasItem - table <name, label, count> - If the player has the item
MSK.GetPlayer
Get the Player from PlayerId, Identifier, CitizenId or Phone. This works for ESX and QBCore.
Parameters
playerData - table <source, identifier, citizenid, phone> - Player Data
Returns
Player - table - The PlayerData
MSK.GetPlayers
Get all the Players on the server.
Parameters
key - string - Optional
value - string - Optional
Returns
Players - table <key, Player> - The PlayerData
MSK.Cron.Create
Create a Cronjob
Parameters
date - 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
Returns
uniqueId - number - UniqueId of the Cronjob
data - any - Your data from parameters
date - table <d, h, m> - The current Datetime
MSK.Cron.Delete
Deletes a specific Cronjob
Parameters
uniqueId - number - The UniqueId of the Cronjob
Returns
success - boolean <true/false> - If the Cronjob Id was found and deleted.
MSK.RegisterItem
This function registeres an item dependet on which framework you use.
Last updated
