forked from Simnation/Main
ed
This commit is contained in:
parent
6d22d5f77c
commit
63fbc60a00
86 changed files with 8352 additions and 3428 deletions
59
resources/[Developer]/mh_garage/server/log.lua
Normal file
59
resources/[Developer]/mh_garage/server/log.lua
Normal file
|
@ -0,0 +1,59 @@
|
|||
function sendToDiscord(Titel, Text, Color) ------ Sende Nachricht an Channel: Join/Left
|
||||
local embeds = {
|
||||
{
|
||||
["title"]=Text,
|
||||
["type"]="rich",
|
||||
["color"] =Config.Log.Color[Color],
|
||||
["footer"]= {
|
||||
["text"]= Config.Log.SystemName,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
PerformHttpRequest(Config.Log.Webhook, function(err, text, headers)
|
||||
if err and err ~= 204 and err ~= 200 then
|
||||
print("Fehler beim Discord Webhook [" .. tostring(err) .. "]: " .. tostring(text))
|
||||
end
|
||||
end, 'POST', json.encode({ username = Titel.." - Mîhó",avatar_url = Config.SystemAvatar, embeds = embeds, tts = TTS}), { ['Content-Type'] = 'application/json' })
|
||||
end
|
||||
|
||||
AddEventHandler('mh_garage:log')
|
||||
RegisterServerEvent('mh_garage:log', function(type)
|
||||
local Player = QBCore.Functions.GetPlayer(source)
|
||||
local PlyData = Player.PlayerData
|
||||
local Color = "purple"
|
||||
|
||||
Playerinfo = {
|
||||
name = PlyData.charinfo.firstname .. " ".. PlyData.charinfo.lastname,
|
||||
citizenid = PlyData.citizenid,
|
||||
}
|
||||
local user = Playerinfo.name.."[".. Playerinfo.citizenid .."]"
|
||||
|
||||
if type == "call" then
|
||||
Text = "Dr. Teddy wurde von " .. user .." gerufen."
|
||||
Color = "grey"
|
||||
elseif type == "cash" then
|
||||
Text = user.." hat Bar Bezahlt."
|
||||
Color = "green"
|
||||
elseif type == "bank" then
|
||||
Text = user .. "hat via Überweisung Bezahlt."
|
||||
Color = "green"
|
||||
elseif type == "noMoney" then
|
||||
Text = user .." Hatte nicht genug Geld."
|
||||
Color = "orange"
|
||||
elseif type == "noPlayer" then
|
||||
Text = user .. " Wurde nicht gefunden und abgebrochen!"
|
||||
Color = "red"
|
||||
elseif type == "storno" then
|
||||
Text = user .. " Hat die Behandlung doch Abgelehnt."
|
||||
Color = "red"
|
||||
elseif type == "heal" then
|
||||
Text = user.. " Wurde Geheilt."
|
||||
Color = "green"
|
||||
elseif type == "end" then
|
||||
Text = "NPC wurde wieder Entfernt..."
|
||||
Color = "blue"
|
||||
end
|
||||
|
||||
sendToDiscord("Garage", Text, Color)
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue