mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
Merge branch 'AstroNext_P3'
This commit is contained in:
@@ -18,6 +18,42 @@ RegisterNetEvent('esx_lscustom:stopModing', function(plate)
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:playerDropped', function(src)
|
||||
src = tostring(src)
|
||||
local playersCount = #ESX.GetExtendedPlayers()
|
||||
if Customs[src] then
|
||||
for k,v in pairs(Customs[src]) do
|
||||
local entity = NetworkGetEntityFromNetworkId(v.netId)
|
||||
if DoesEntityExist(entity) then
|
||||
if players > 0 then
|
||||
TriggerClientEvent('esx_lscustom:restoreMods', -1, v.netId, v.props)
|
||||
else
|
||||
DeleteEntity(entity)
|
||||
end
|
||||
end
|
||||
end
|
||||
Customs[src] = nil
|
||||
end
|
||||
end)
|
||||
local Customs = {}
|
||||
|
||||
RegisterNetEvent('esx_lscustom:startModing', function(props, netId)
|
||||
local src = tostring(source)
|
||||
if Customs[src] then
|
||||
Customs[src][props.plate] = {props = props, netId = netId}
|
||||
else
|
||||
Customs[src] = {}
|
||||
Customs[src][props.plate] = {props = props, netId = netId}
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_lscustom:stopModing', function(plate)
|
||||
local src = tostring(source)
|
||||
if Customs[src] then
|
||||
Customs[src][tostring(plate)] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
AddEventHandler('esx:playerDropped', function(src)
|
||||
src = tostring(src)
|
||||
local playersCount = #ESX.GetExtendedPlayers()
|
||||
|
||||
Reference in New Issue
Block a user