-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
41 lines (32 loc) · 1.64 KB
/
server.lua
File metadata and controls
41 lines (32 loc) · 1.64 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
Framework = nil
if Customize.Framework == 'QBCore' then
Framework = exports['qb-core']:GetCoreObject()
RegisterServerEvent("esc_carkey:newcarkey", function(plate, model)
local Player = Framework.Functions.GetPlayer(source)
Player.Functions.AddItem("carkey", 2, false, { plate = plate, model = model })
TriggerClientEvent('inventory:client:ItemBox', source, Framework.Shared.Items["carkey"], "add")
end)
RegisterCommand(Customize.AdminGiveCommand, function(source, args)
if Customize.AdminGiveKey then
if Customize.AdminList[GetPlayerIdentifier(source)] then
local Player = Framework.Functions.GetPlayer(source)
Player.Functions.AddItem("carkey", 2, false, { plate = args[1], model = args[2] })
TriggerClientEvent('inventory:client:ItemBox', source, Framework.Shared.Items["carkey"], "add")
end
end
end)
elseif Customize.Framework == 'ESX' then
TriggerEvent('esx:getSharedObject', function(obj) Framework = obj end)
RegisterCommand(Customize.AdminGiveCommand, function(source, args)
if Customize.AdminGiveKey then
if Customize.AdminList[GetPlayerIdentifier(source)] then
local xPlayer = Framework.GetPlayerFromId(source)
xPlayer.addInventoryItem("carkey", 2, true, { plate = args[1], model = args[2] })
end
end
end)
RegisterServerEvent("esc_carkey:newcarkey", function(plate, model)
local xPlayer = Framework.GetPlayerFromId(source)
xPlayer.addInventoryItem("carkey", 2, true, { plate = args[1], model = args[2] })
end)
end