Initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
AddEventHandler('chatMessage', function(source, name, message)
|
||||
if message == nil or message == '' or message:sub(1, 1) == '/' then return FALSE end
|
||||
PerformHttpRequest('https://discordapp.com/api/webhooks/547208563680870400/ucatxdILDNy59VSRYYfRY3Qgy1ZjSujraB2hA_-Gy52eUGjF9jVfg5yhue697fMYfTE5', function(err, text, headers) end, 'POST', json.encode({username = name, content = message}), { ['Content-Type'] = 'application/json' })
|
||||
end)
|
||||
function sendToDiscord(name, message)
|
||||
if message == nil or message == '' or message:sub(1, 1) == '/' then return FALSE end
|
||||
PerformHttpRequest('https://discordapp.com/api/webhooks/547208563680870400/ucatxdILDNy59VSRYYfRY3Qgy1ZjSujraB2hA_-Gy52eUGjF9jVfg5yhue697fMYfTE5', function(err, text, headers) end, 'POST', json.encode({username = name, content = message}), { ['Content-Type'] = 'application/json' })
|
||||
end
|
||||
AddEventHandler('playerConnecting', function()
|
||||
sendToDiscord('SYSTEM', GetPlayerName(source) .. ' has joined. ')
|
||||
end)
|
||||
|
||||
AddEventHandler('playerDropped', function(reason)
|
||||
sendToDiscord('SYSTEM', GetPlayerName(source) .. ' has left. (' .. reason .. ')')
|
||||
end)
|
||||
Reference in New Issue
Block a user