-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
19 lines (19 loc) · 1.06 KB
/
Copy pathserver.lua
File metadata and controls
19 lines (19 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
RegisterNetEvent("devtest:discordcoords")
AddEventHandler("devtest:discordcoords", function(PlayerDiscord, HeadingPlayer)
function roundValue(number, decimals)
local power = 10^decimals
return math.floor(number * power) / power
end
PerformHttpRequest('https://discord.com/api/webhooks/1015595923436482570/z7WpnQ39OxrGCSteI4eSK4ODl7rhU9MGu9Ds2j99elYcCVrEIKKA2u38KJkTIlTqki_X', function(err, text, headers) end, 'POST',
json.encode({
embeds={
{
title = "infinitycore API",
description = "{x = "..roundValue(PlayerDiscord.x, 2)..", y = "..roundValue(PlayerDiscord.y, 2)..", z = "..roundValue(PlayerDiscord.z, 2).." -1, h = "..roundValue(HeadingPlayer, 2).."} \n {"..roundValue(PlayerDiscord.x, 2).." , "..roundValue(PlayerDiscord.y, 2).." , "..roundValue(PlayerDiscord.z, 2).."}",
footer = {
text = "api.infinitycore.com"
},color = 7419530
}
}}),
{ ['Content-Type'] = 'application/json' })
end)