mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
Add take out of vehicle
Add take out of vehicle
This commit is contained in:
+45
-35
@@ -57,10 +57,10 @@ function OpenCloakroomMenu()
|
||||
ESX.UI.Menu.CloseAll()
|
||||
|
||||
if Config.EnableNonFreemodePeds then
|
||||
table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'})
|
||||
table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'})
|
||||
table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'})
|
||||
end
|
||||
table.insert(elements, {label = _U('sheriff_wear'), value = 'sheriff_wear'})
|
||||
table.insert(elements, {label = _U('lieutenant_wear'), value = 'lieutenant_wear'})
|
||||
table.insert(elements, {label = _U('commandant_wear'), value = 'commandant_wear'})
|
||||
end
|
||||
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'cloakroom',
|
||||
@@ -75,14 +75,13 @@ function OpenCloakroomMenu()
|
||||
menu.close()
|
||||
|
||||
--Taken from SuperCoolNinja
|
||||
if data.current.value == 'citizen_wear' then --Ajout de tenue par grades
|
||||
if data.current.value == 'citizen_wear' then
|
||||
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
|
||||
if skin.sex == 0 then
|
||||
|
||||
local model = GetHashKey("mp_m_freemode_01") --[FR]--Pour changer de Skin Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Man
|
||||
local model = GetHashKey("mp_m_freemode_01")
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
RequestModel(model)
|
||||
@@ -93,8 +92,7 @@ function OpenCloakroomMenu()
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
TriggerEvent('skinchanger:loadSkin', skin)
|
||||
else
|
||||
local model = GetHashKey("mp_f_freemode_01") --[FR]--Pour changer de Femal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Girl
|
||||
local model = GetHashKey("mp_f_freemode_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
@@ -122,16 +120,15 @@ function OpenCloakroomMenu()
|
||||
|
||||
end)
|
||||
|
||||
end
|
||||
--Taken from SuperCoolNinja
|
||||
end
|
||||
|
||||
if data.current.value == 'sheriff_wear' then
|
||||
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
|
||||
if skin.sex == 0 then
|
||||
|
||||
local model = GetHashKey("s_m_y_sheriff_01") --[FR]--Pour changer de Mal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Man
|
||||
local model = GetHashKey("s_m_y_sheriff_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
@@ -142,8 +139,7 @@ end
|
||||
SetPlayerModel(PlayerId(), model)
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
else
|
||||
local model = GetHashKey("s_f_y_sheriff_01") --[FR]--Pour changer de Femal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Girl
|
||||
local model = GetHashKey("s_f_y_sheriff_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
@@ -157,14 +153,13 @@ end
|
||||
|
||||
end)
|
||||
end
|
||||
--Taken from SuperCoolNinja
|
||||
if data.current.value == 'lieutenant_wear' then --Ajout de tenue par grades
|
||||
|
||||
if data.current.value == 'lieutenant_wear' then
|
||||
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
|
||||
if skin.sex == 0 then
|
||||
local model = GetHashKey("s_m_y_swat_01") --[FR]--Pour changer de Mal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Man
|
||||
local model = GetHashKey("s_m_y_swat_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
@@ -175,8 +170,7 @@ end
|
||||
SetPlayerModel(PlayerId(), model)
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
else
|
||||
local model = GetHashKey("s_m_y_swat_01") --[FR]--Pour changer de Femal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Girl
|
||||
local model = GetHashKey("s_m_y_swat_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
@@ -190,14 +184,14 @@ end
|
||||
|
||||
end)
|
||||
end
|
||||
--Taken from SuperCoolNinja
|
||||
if data.current.value == 'commandant_wear' then --Ajout de tenue par grades
|
||||
|
||||
if data.current.value == 'commandant_wear' then
|
||||
|
||||
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
|
||||
|
||||
if skin.sex == 0 then
|
||||
local model = GetHashKey("ig_fbisuit_01") --[FR]--Pour changer de Mal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Man
|
||||
if skin.sex == 0 then
|
||||
local model = GetHashKey("s_m_y_swat_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
RequestModel(model)
|
||||
@@ -207,8 +201,7 @@ end
|
||||
SetPlayerModel(PlayerId(), model)
|
||||
SetModelAsNoLongerNeeded(model)
|
||||
else
|
||||
local model = GetHashKey("ig_fbisuit_01") --[FR]--Pour changer de Femal Male veuillez changer Ici !
|
||||
--[EN]--Here for change Ped Skin Model Here is for Girl
|
||||
local model = GetHashKey("s_m_y_swat_01")
|
||||
|
||||
RequestModel(model)
|
||||
while not HasModelLoaded(model) do
|
||||
@@ -223,6 +216,7 @@ end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
CurrentAction = 'menu_cloakroom'
|
||||
CurrentActionMsg = _U('open_cloackroom')
|
||||
CurrentActionData = {}
|
||||
@@ -277,12 +271,12 @@ function OpenArmoryMenu(station)
|
||||
end
|
||||
|
||||
if data.current.value == 'put_stock' then
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
OpenPutStocksMenu()
|
||||
end
|
||||
|
||||
if data.current.value == 'get_stock' then
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
if data.current.value == 'get_stock' then
|
||||
OpenGetStocksMenu()
|
||||
end
|
||||
|
||||
end,
|
||||
function(data, menu)
|
||||
@@ -445,6 +439,7 @@ function OpenPoliceActionsMenu()
|
||||
{label = _U('handcuff'), value = 'handcuff'},
|
||||
{label = _U('drag'), value = 'drag'},
|
||||
{label = _U('put_in_vehicle'), value = 'put_in_vehicle'},
|
||||
{label = _U('out_the_vehicle'), value = 'out_the_vehicle'},
|
||||
{label = _U('fine'), value = 'fine'}
|
||||
},
|
||||
},
|
||||
@@ -474,6 +469,10 @@ function OpenPoliceActionsMenu()
|
||||
TriggerServerEvent('esx_policejob:putInVehicle', GetPlayerServerId(player))
|
||||
end
|
||||
|
||||
if data2.current.value == 'out_the_vehicle' then
|
||||
TriggerServerEvent('esx_policejob:OutVehicle', GetPlayerServerId(player))
|
||||
end
|
||||
|
||||
if data2.current.value == 'fine' then
|
||||
OpenFineMenu(player)
|
||||
end
|
||||
@@ -623,7 +622,7 @@ function OpenIdentityCardMenu(player)
|
||||
|
||||
local jobLabel = nil
|
||||
local sexLabel = nil
|
||||
local sex = nil
|
||||
local sex = nil
|
||||
local dobLabel = nil
|
||||
local heightLabel = nil
|
||||
local idLabel = nil
|
||||
@@ -669,7 +668,7 @@ function OpenIdentityCardMenu(player)
|
||||
{label = dobLabel, value = nil},
|
||||
{label = heightLabel, value = nil},
|
||||
{label = jobLabel, value = nil},
|
||||
{label = idLabel, value = nil},
|
||||
{label = idLabel, value = nil},
|
||||
}
|
||||
|
||||
if data.drunk ~= nil then
|
||||
@@ -938,6 +937,17 @@ function OpenVehicleInfosMenu(vehicleData)
|
||||
|
||||
end
|
||||
|
||||
RegisterNetEvent('esx_policejob:OutVehicle')
|
||||
AddEventHandler('esx_policejob:OutVehicle', function(t)
|
||||
local ped = GetPlayerPed(t)
|
||||
ClearPedTasksImmediately(ped)
|
||||
plyPos = GetEntityCoords(GetPlayerPed(-1), true)
|
||||
local xnew = plyPos.x+2
|
||||
local ynew = plyPos.y+2
|
||||
|
||||
SetEntityCoords(GetPlayerPed(-1), xnew, ynew, plyPos.z)
|
||||
end)
|
||||
|
||||
function OpenGetWeaponMenu()
|
||||
|
||||
ESX.TriggerServerCallback('esx_policejob:getArmoryWeapons', function(weapons)
|
||||
|
||||
+188
-6
@@ -6,12 +6,13 @@ Config.MarkerColor = {r = 50, g = 50, b = 204}
|
||||
Config.EnablePlayerManagement = false
|
||||
Config.EnableArmoryManagement = false
|
||||
Config.EnableGCIdentity = false
|
||||
Config.EnableNonFreemodePeds = false
|
||||
Config.EnableNonFreemodePeds = false -- turn this on if you want custom peds
|
||||
Config.MaxInService = -1
|
||||
Config.Locale = 'en'
|
||||
|
||||
LSPD = {
|
||||
Config.PoliceStations = {
|
||||
|
||||
LSPD1 = {
|
||||
Blip = {
|
||||
Pos = {x = 425.130, y = -979.558, z = 30.711},
|
||||
Color = 29
|
||||
@@ -21,14 +22,12 @@ Config.Locale = 'en'
|
||||
{name = 'WEAPON_NIGHTSTICK', price = 200},
|
||||
{name = 'WEAPON_COMBATPISTOL', price = 300},
|
||||
{name = 'WEAPON_ASSAULTSMG', price = 1250},
|
||||
{name = 'WEAPON_ASSAULTRIFLE', price = 1500},
|
||||
{name = 'WEAPON_SPECIALCARBINE', price = 1500},
|
||||
{name = 'WEAPON_PUMPSHOTGUN', price = 600},
|
||||
{name = 'WEAPON_STUNGUN', price = 500},
|
||||
{name = 'WEAPON_FLASHLIGHT', price = 80},
|
||||
{name = 'WEAPON_FIREEXTINGUISHER', price = 120},
|
||||
{name = 'WEAPON_FLAREGUN', price = 60},
|
||||
{name = 'WEAPON_STICKYBOMB', price = 250},
|
||||
{name = 'GADGET_PARACHUTE', price = 300},
|
||||
},
|
||||
|
||||
AuthorizedVehicles = {
|
||||
@@ -73,6 +72,189 @@ Config.Locale = 'en'
|
||||
{x = 448.417, y = -973.208, z = 29.689}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
SASP1 = {
|
||||
Blip = {
|
||||
Pos = {x = 825.34204101563, y = -1290.0471191406, z = 28.240659713745 },
|
||||
Color = 40
|
||||
},
|
||||
|
||||
AuthorizedWeapons = {
|
||||
{name = 'WEAPON_NIGHTSTICK', price = 200},
|
||||
{name = 'WEAPON_COMBATPISTOL', price = 300},
|
||||
{name = 'WEAPON_ASSAULTSMG', price = 1250},
|
||||
{name = 'WEAPON_SPECIALCARBINE', price = 1500},
|
||||
{name = 'WEAPON_PUMPSHOTGUN', price = 600},
|
||||
{name = 'WEAPON_STUNGUN', price = 500},
|
||||
{name = 'WEAPON_FLASHLIGHT', price = 80},
|
||||
{name = 'WEAPON_FIREEXTINGUISHER', price = 120},
|
||||
{name = 'WEAPON_FLAREGUN', price = 60},
|
||||
},
|
||||
|
||||
AuthorizedVehicles = {
|
||||
{name = 'police' , label = 'Police Vehicle 1'},
|
||||
{name = 'police2', label = 'Police Vehicle 2'},
|
||||
{name = 'police3', label = 'Police Vehicle 3'},
|
||||
{name = 'police4', label = 'Police Vehicle 4'},
|
||||
{name = 'policeb', label = 'Motorcycle'},
|
||||
{name = 'policet', label = 'Transport Van'},
|
||||
},
|
||||
|
||||
Cloakrooms = {
|
||||
{x = 830.11590576172, y = -1311.4512939453, z = 28.13673210144 } -- state pd
|
||||
},
|
||||
|
||||
Armories = {
|
||||
{x = 858.25366210938, y = -1321.5992431641, z = 28.136734008789 } -- state pd
|
||||
},
|
||||
|
||||
Vehicles = {
|
||||
{
|
||||
Spawner = {x = 863.17700195313, y = -1346.2406005859, z = 26.039228439331 }, --state pd
|
||||
SpawnPoint = {x = 871.07720947266, y = -1350.00390625, z = 26.3092918396 }, -- state pd
|
||||
Heading = 90.0 --state pd
|
||||
}
|
||||
},
|
||||
|
||||
Helicopters = {
|
||||
{
|
||||
Spawner = {x = 466.477, y = -982.819, z = 42.691},
|
||||
SpawnPoint = {x = 450.04, y = -981.14, z = 42.691},
|
||||
Heading = 0.0
|
||||
}
|
||||
},
|
||||
|
||||
VehicleDeleters = {
|
||||
{x = 823.95031738281, y = -1371.1483154297, z = 26.136753082275 } --state pd
|
||||
},
|
||||
|
||||
BossActions = {
|
||||
{x = 850.228515625, y = -1284.50390625, z = 28.004758834839 } --state pd
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
LSPD2 = {
|
||||
Blip = {
|
||||
Pos = {x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 },
|
||||
Color = 29
|
||||
},
|
||||
|
||||
AuthorizedWeapons = {
|
||||
{name = 'WEAPON_NIGHTSTICK', price = 200},
|
||||
{name = 'WEAPON_COMBATPISTOL', price = 300},
|
||||
{name = 'WEAPON_ASSAULTSMG', price = 1250},
|
||||
{name = 'WEAPON_SPECIALCARBINE', price = 1500},
|
||||
{name = 'WEAPON_PUMPSHOTGUN', price = 600},
|
||||
{name = 'WEAPON_STUNGUN', price = 500},
|
||||
{name = 'WEAPON_FLASHLIGHT', price = 80},
|
||||
{name = 'WEAPON_FIREEXTINGUISHER', price = 120},
|
||||
{name = 'WEAPON_FLAREGUN', price = 60},
|
||||
},
|
||||
|
||||
AuthorizedVehicles = {
|
||||
{name = 'police' , label = 'Police Vehicle 1'},
|
||||
{name = 'police2', label = 'Police Vehicle 2'},
|
||||
{name = 'police3', label = 'Police Vehicle 3'},
|
||||
{name = 'police4', label = 'Police Vehicle 4'},
|
||||
{name = 'policeb', label = 'Motorcycle'},
|
||||
{name = 'policet', label = 'Transport Van'},
|
||||
},
|
||||
|
||||
Cloakrooms = {
|
||||
{x = -450.2878112793, y = 6016.482421875, z = 31.716369628906 },
|
||||
},
|
||||
|
||||
Armories = {
|
||||
{x = -448.04425048828, y = 6007.7104492188, z = 31.716369628906 },
|
||||
},
|
||||
|
||||
Vehicles = {
|
||||
{
|
||||
Spawner = {x = -452.30313110352, y = 6005.6704101563, z = 31.840929031372 },
|
||||
SpawnPoint = {x = -454.96899414063, y = 6001.8876953125, z = 31.340549468994 },
|
||||
Heading = 87.0
|
||||
}
|
||||
},
|
||||
|
||||
Helicopters = {
|
||||
{
|
||||
Spawner = {x = -462.88317871094, y = 5993.7685546875, z = 31.245756149292 },
|
||||
SpawnPoint = {x = -475.48043823242, y = 5988.326171875, z = 31.336708068848 },
|
||||
Heading = 270.0
|
||||
}
|
||||
},
|
||||
|
||||
VehicleDeleters = {
|
||||
{x = -447.64434814453, y = 5994.5024414063, z = 31.340551376343 },
|
||||
},
|
||||
|
||||
BossActions = {
|
||||
{x = -441.80764770508, y = 6012.5131835938, z = 31.716369628906 },
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
SASP2 = {
|
||||
Blip = {
|
||||
Pos = {x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 },
|
||||
Color = 40
|
||||
},
|
||||
|
||||
AuthorizedWeapons = {
|
||||
{name = 'WEAPON_NIGHTSTICK', price = 200},
|
||||
{name = 'WEAPON_COMBATPISTOL', price = 300},
|
||||
{name = 'WEAPON_ASSAULTSMG', price = 1250},
|
||||
{name = 'WEAPON_SPECIALCARBINE', price = 1500},
|
||||
{name = 'WEAPON_PUMPSHOTGUN', price = 600},
|
||||
{name = 'WEAPON_STUNGUN', price = 500},
|
||||
{name = 'WEAPON_FLASHLIGHT', price = 80},
|
||||
{name = 'WEAPON_FIREEXTINGUISHER', price = 120},
|
||||
{name = 'WEAPON_FLAREGUN', price = 60},
|
||||
},
|
||||
|
||||
AuthorizedVehicles = {
|
||||
{name = 'police' , label = 'Police Vehicle 1'},
|
||||
{name = 'police2', label = 'Police Vehicle 2'},
|
||||
{name = 'police3', label = 'Police Vehicle 3'},
|
||||
{name = 'police4', label = 'Police Vehicle 4'},
|
||||
{name = 'policeb', label = 'Motorcycle'},
|
||||
{name = 'policet', label = 'Transport Van'},
|
||||
},
|
||||
|
||||
Cloakrooms = {
|
||||
{x = 1857.2354736328, y = 3689.8408203125, z = 34.26708984375 }, -- state pd
|
||||
},
|
||||
|
||||
Armories = {
|
||||
{x = 1848.3413085938, y = 3690.1345214844, z = 34.26708984375 }, -- state pd
|
||||
},
|
||||
|
||||
Vehicles = {
|
||||
{
|
||||
Spawner = {x = 1866.208984375, y = 3693.8125, z = 33.737236022949 }, --state pd
|
||||
SpawnPoint = {x = 1872.9417724609, y = 3690.5759277344, z = 33.569362640381 }, -- state pd
|
||||
Heading = 90.0 --state pd
|
||||
}
|
||||
},
|
||||
|
||||
Helicopters = {
|
||||
{
|
||||
Spawner = {x = 466.477, y = -982.819, z = 42.691},
|
||||
SpawnPoint = {x = 450.04, y = -981.14, z = 42.691},
|
||||
Heading = 0.0
|
||||
}
|
||||
},
|
||||
|
||||
VehicleDeleters = {
|
||||
{x = 1866.4152832031, y = 3699.6052246094, z = 33.535938262939 }, --state pd
|
||||
},
|
||||
|
||||
BossActions = {
|
||||
{x = 1851.0972900391, y = 3683.7622070313, z = 34.26708984375 }, --state pd
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ Locales['en'] = {
|
||||
['handcuff'] = 'cuff / Uncuff',
|
||||
['drag'] = 'drag',
|
||||
['put_in_vehicle'] = 'put in Vehicle',
|
||||
['out_the_vehicle'] = 'take ou of vehicle',
|
||||
['fine'] = 'fine',
|
||||
['no_players_nearby'] = 'no players nearby',
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ Locales['fr'] = {
|
||||
['handcuff'] = 'menotter / Démenotter',
|
||||
['drag'] = 'escorter',
|
||||
['put_in_vehicle'] = 'mettre dans véhicule',
|
||||
['out_the_vehicle'] = 'sortir du véhicule',
|
||||
['fine'] = 'Amende',
|
||||
['no_players_nearby'] = 'aucun joueur à proximité',
|
||||
|
||||
|
||||
@@ -70,6 +70,11 @@ AddEventHandler('esx_policejob:putInVehicle', function(target)
|
||||
TriggerClientEvent('esx_policejob:putInVehicle', target)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_policejob:OutVehicle')
|
||||
AddEventHandler('esx_policejob:OutVehicle', function(target)
|
||||
TriggerClientEvent('esx_policejob:OutVehicle', target)
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_policejob:getStockItem')
|
||||
AddEventHandler('esx_policejob:getStockItem', function(itemName, count)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user