Initial commit

This commit is contained in:
Jacob
2021-12-03 01:19:31 +00:00
parent c1add166a1
commit f8efc78730
807 changed files with 201658 additions and 0 deletions
+15
View File
@@ -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)