-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathserver.lua
28 lines (24 loc) · 947 Bytes
/
server.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local ESX = exports['es_extended']:getSharedObject()
local WebHook = "" -- Put your webhook
ESX.RegisterUsableItem("camera", function(source, item)
local src = source
TriggerClientEvent("wert-camera:client:use-camera", src)
end)
RegisterNetEvent("wert-camera:server:add-photo-item", function(url, location)
local time = os.date('*t')
local ply = ESX.GetPlayerFromId(source)
if ply then
local info = {
photourl = string.gsub(url, '\"', '"'),
description = 'Photo taken with Canon EOS M50 \n Date and Time: ' .. time.day .. '/' .. time.month .. '/' .. time.year .. ' - ' .. time.hour .. ':' .. time.min .. ' \n Location: ' .. location
}
exports.ox_inventory:AddItem(source, 'photo', 1, info)
end
end)
ESX.RegisterServerCallback("wert-camera:server:webhook",function(source,cb)
if WebHook ~= "" then
cb(WebHook)
else
cb(nil)
end
end)