mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 15:01:32 +00:00
Add dv
This commit is contained in:
@@ -346,6 +346,27 @@ AddEventHandler('esx:spawnPed', function(model)
|
||||
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx:deleteVehicle')
|
||||
AddEventHandler('esx:deleteVehicle', function()
|
||||
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
local coords = GetEntityCoords(playerPed)
|
||||
|
||||
if IsPedInAnyVehicle(playerPed, false) then
|
||||
|
||||
local vehicle = GetVehiclePedIsIn(playerPed, false)
|
||||
ESX.Game.DeleteVehicle(vehicle)
|
||||
|
||||
elseif IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then
|
||||
|
||||
local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71)
|
||||
ESX.Game.DeleteVehicle(vehicle)
|
||||
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
|
||||
-- Pause menu disable HUD display
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
|
||||
@@ -47,6 +47,13 @@ end, function(source, args, user)
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
||||
end, {help = _U('spawn_car'), params = {{name = "car", help = _U('spawn_car_param')}}})
|
||||
|
||||
TriggerEvent('es:addGroupCommand', 'dv', 'admin', function(source, args, user)
|
||||
TriggerClientEvent('esx:deleteVehicle', source)
|
||||
end, function(source, args, user)
|
||||
TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Insufficient Permissions.")
|
||||
end)
|
||||
|
||||
|
||||
TriggerEvent('es:addGroupCommand', 'spawnped', 'admin', function(source, args, user)
|
||||
TriggerClientEvent('esx:spawnPed', source, args[2])
|
||||
end, function(source, args, user)
|
||||
|
||||
Reference in New Issue
Block a user