local identifiers = {discord = "", steam = "", ip = ""}
AddEventHandler('playerConnecting', function()
local num = GetNumPlayerIdentifiers(source)
for i = 0, num-1 do
local a = GetPlayerIdentifier(source, i)
local f = string.find(a, ":")
if f then
local b = string.sub(a, 1, f-1)
identifiers[b] = a
end
end
local steamname = GetPlayerName(source)
local connect = {
{
["color"] = "3447003",
["title"] = "**"..steamname.."** Sunucuya Giriş Yaptı ;",
["description"] = "** [IP Adresi] : "..identifiers.ip.."\n [Discord ID] : "..identifiers.discord.."\n [Hex ID] : "..identifiers.steam.."**",
["footer"] = {
["text"] = SystemName,
["icon_url"] = SystemAvatar,
},
}
}
PerformHttpRequest(Config.GirisCikisLogu, function(err, text, headers) end, 'POST', json.encode({username = SystemName, embeds = connect}), { ['Content-Type'] = 'application/json' })
end)
AddEventHandler('playerDropped', function()
local num = GetNumPlayerIdentifiers(source)
for i = 0, num-1 do
local a = GetPlayerIdentifier(source, i)
local f = string.find(a, ":")
if f then
local b = string.sub(a, 1, f-1)
identifiers[b] = a
end
end
local steamname = GetPlayerName(source)
local leave = {
{
["color"] = "15158332",
["title"] = "**"..steamname.."** Sunucudan Ayrıldı ;",
["description"] = "** [IP Adresi] : "..identifiers.ip.."\n [Discord ID] : "..identifiers.discord.."\n [Hex ID] : "..identifiers.steam.."**",
["footer"] = {
["text"] = SystemName,
["icon_url"] = SystemAvatar,
},
}
}
PerformHttpRequest(Config.GirisCikisLogu, function(err, text, headers) end, 'POST', json.encode({username = SystemName, embeds = leave}), { ['Content-Type'] = 'application/json' })
end)