-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
25 lines (21 loc) · 775 Bytes
/
server.lua
File metadata and controls
25 lines (21 loc) · 775 Bytes
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
local ESX = exports['es_extended']:getSharedObject()
local targetPlayerId = nil
RegisterServerEvent('kaloudas:applyBagToTarget')
AddEventHandler('kaloudas:applyBagToTarget', function()
if targetPlayerId then
TriggerClientEvent('kaloudas:applyBagClient', targetPlayerId)
end
end)
RegisterServerEvent('kaloudas:setTargetPlayer')
AddEventHandler('kaloudas:setTargetPlayer', function(playerId)
targetPlayerId = playerId
end)
RegisterServerEvent('kaloudas:removeBagFromTarget')
AddEventHandler('kaloudas:removeBagFromTarget', function()
if targetPlayerId then
TriggerClientEvent('kaloudas:removeBagClient', targetPlayerId)
end
end)
ESX.RegisterUsableItem('headbag', function(source)
TriggerClientEvent('kaloudas:openMenu', source)
end)