Merge branch 'AstroNext_P3'

This commit is contained in:
Amir_Lynx
2022-11-01 00:30:00 +03:30
+36
View File
@@ -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()