Notify
Last updated
Last updated
A notification can only be sent to staff and protected player. Not users.
'd'
Debug
'i'
Info
'w'
Warning
'e'
Error
's'
Success
Send a notification to one or more players. Staff may not receive notifications depending on your ingame options.
(Table) notification
(String) severity - See Severities
(String) module - Helps user to understand what this message is about
(String) message
(SteamID32|SteamID64|Player) player (optional) - NOT the recipient! Who is this notify about? Name and Avatar will get displayed in top right corner of notify.
(String|Player|SteamID32|SteamID64) recipient
Possible values for recipient:
'protected' - sends to all protected players
[SteamID32|SteamID64] - sends to a specific player
[Player] - sends to a specific player
default - sends to all staff and protected players
// Send warning notification to all protected players
sWatch.notify({
["severity"] = "w",
["module"] = "mymodule",
["message"] = sWatch.lang("my_message"),
}, "protected")
// Send info notification to all staff and protected players
sWatch.notify({
["severity"] = "i",
["module"] = "mymodule",
["message"] = sWatch.lang("my_message"),
})
// Send success notification to a specific player (staff or protected!)
sWatch.notify({
["severity"] = "s",
["module"] = "mymodule",
["message"] = sWatch.lang("my_message"),
}, targetPlayer)
// Send warning notification to all staff about a player
sWatch.notify({
["severity"] = "w",
["module"] = "mymodule",
["message"] = sWatch.lang("my_message"),
["ply"] = attacker
})
Ask a staff of protected player what to do against a bad guy. Depending on your settings, this won't get sent to staff.
(Table) notification
(String) identifier - See Detections
(String) action_key - Settings key where all possible actions for this detection are listed
(String) reason - Message to be shown, what this person did
(SteamID32|SteamID64|Player) ply - Player that we take action about
(Function) callback
(String) answer (nil
if nobody answered, false
if duplicate or invalid)
(SteamID32) admin - player that took action
// Ask staff/protected what to do about player
sWatch.askAction({
["identifier"] = "network_spam",
["action_key"] = "networking_netcollector_spam_action",
["reason"] = "Reason for punishment",
["ply"] = attacker
}, function(answer, admin)
if IsValid(attacker) and answer == "kick" then
attacker:Kick()
end
end)