Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

Commit 54b39bc

Browse files
authored
Merge pull request #18 from majormarcin/update
Update
2 parents 516eba2 + 2ea3dac commit 54b39bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2825
-2108
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,4 @@ Licencje i informacje o prawach autorskich:
102102
[esx_weashops](https://github.com/ESX-Org/esx_weashops)
103103
[esx_drugs](https://github.com/ESX-Org/esx_drugs)
104104
[esx_animations](https://github.com/ESX-Org/esx_animations)
105-
[esx_voice](https://github.com/ESX-Org/esx_voice)
106-
107-
108-
109-
## Jeśli chcesz dołączyć zajrzyj na discorda lub poprostu zaproponuj zmiany w repozytorium jeśli potrzebujesz pomocy technicznej lub jakichś zmian w plikach daj znać.
105+
[esx_voice](https://github.com/ESX-Org/esx_voice)

server-data/resources/[essential]/es_extended/LICENSE.txt renamed to server-data/resources/[essential]/es_extended/LICENSE

File renamed without changes.

server-data/resources/[essential]/es_extended/__resource.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ server_scripts {
1616
'locales/fi.lua',
1717
'locales/sv.lua',
1818
'locales/pl.lua',
19+
'locales/cs.lua',
1920

2021
'config.lua',
2122
'config.weapons.lua',
@@ -39,6 +40,7 @@ client_scripts {
3940
'locales/fi.lua',
4041
'locales/sv.lua',
4142
'locales/pl.lua',
43+
'locales/cs.lua',
4244

4345
'config.lua',
4446
'config.weapons.lua',

server-data/resources/[essential]/es_extended/client/functions.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ ESX.Game.SpawnVehicle = function(modelName, coords, heading, cb)
397397
SetNetworkIdCanMigrate(id, true)
398398
SetEntityAsMissionEntity(vehicle, true, false)
399399
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
400+
SetVehicleNeedsToBeHotwired(vehicle, false)
400401
SetModelAsNoLongerNeeded(model)
401402

402403
RequestCollisionAtCoord(coords.x, coords.y, coords.z)
@@ -432,6 +433,7 @@ ESX.Game.SpawnLocalVehicle = function(modelName, coords, heading, cb)
432433

433434
SetEntityAsMissionEntity(vehicle, true, false)
434435
SetVehicleHasBeenOwnedByPlayer(vehicle, true)
436+
SetVehicleNeedsToBeHotwired(vehicle, false)
435437
SetModelAsNoLongerNeeded(model)
436438

437439
RequestCollisionAtCoord(coords.x, coords.y, coords.z)
@@ -661,6 +663,12 @@ ESX.Game.GetVehicleInDirection = function()
661663
return vehicle
662664
end
663665

666+
ESX.Game.IsSpawnPointClear = function(coords, radius)
667+
local vehicles = ESX.Game.GetVehiclesInArea(coords, radius)
668+
669+
return #vehicles == 0
670+
end
671+
664672
ESX.Game.GetPeds = function(ignoreList)
665673

666674
local ignoreList = ignoreList or {}

server-data/resources/[essential]/es_extended/client/main.lua

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ AddEventHandler('playerSpawned', function()
6060
Citizen.Wait(1)
6161
end
6262

63-
local playerPed = GetPlayerPed(-1)
63+
local playerPed = PlayerPedId()
6464

6565
-- Restore position
6666
if ESX.PlayerData.lastPosition ~= nil then
@@ -134,7 +134,7 @@ AddEventHandler('skinchanger:modelLoaded', function()
134134
end)
135135

136136
AddEventHandler('esx:restoreLoadout', function()
137-
local playerPed = GetPlayerPed(-1)
137+
local playerPed = PlayerPedId()
138138

139139
RemoveAllPedWeapons(playerPed, true)
140140

@@ -206,7 +206,7 @@ end)
206206

207207
RegisterNetEvent('esx:addWeapon')
208208
AddEventHandler('esx:addWeapon', function(weaponName, ammo)
209-
local playerPed = GetPlayerPed(-1)
209+
local playerPed = PlayerPedId()
210210
local weaponHash = GetHashKey(weaponName)
211211

212212
GiveWeaponToPed(playerPed, weaponHash, ammo, false, false)
@@ -215,7 +215,7 @@ end)
215215

216216
RegisterNetEvent('esx:removeWeapon')
217217
AddEventHandler('esx:removeWeapon', function(weaponName, ammo)
218-
local playerPed = GetPlayerPed(-1)
218+
local playerPed = PlayerPedId()
219219
local weaponHash = GetHashKey(weaponName)
220220

221221
RemoveWeaponFromPed(playerPed, weaponHash)
@@ -239,12 +239,12 @@ AddEventHandler('esx:teleport', function(pos)
239239

240240
RequestCollisionAtCoord(pos.x, pos.y, pos.z)
241241

242-
while not HasCollisionLoadedAroundEntity(GetPlayerPed(-1)) do
242+
while not HasCollisionLoadedAroundEntity(PlayerPedId()) do
243243
RequestCollisionAtCoord(pos.x, pos.y, pos.z)
244244
Citizen.Wait(1)
245245
end
246246

247-
SetEntityCoords(GetPlayerPed(-1), pos.x, pos.y, pos.z)
247+
SetEntityCoords(PlayerPedId(), pos.x, pos.y, pos.z)
248248

249249
end)
250250

@@ -300,7 +300,7 @@ AddEventHandler('esx:playEmote', function(emote)
300300

301301
Citizen.CreateThread(function()
302302

303-
local playerPed = GetPlayerPed(-1)
303+
local playerPed = PlayerPedId()
304304

305305
TaskStartScenarioInPlace(playerPed, emote, 0, false);
306306
Citizen.Wait(20000)
@@ -313,7 +313,7 @@ end)
313313
RegisterNetEvent('esx:spawnVehicle')
314314
AddEventHandler('esx:spawnVehicle', function(model)
315315

316-
local playerPed = GetPlayerPed(-1)
316+
local playerPed = PlayerPedId()
317317
local coords = GetEntityCoords(playerPed)
318318

319319
ESX.Game.SpawnVehicle(model, coords, 90.0, function(vehicle)
@@ -325,7 +325,7 @@ end)
325325
RegisterNetEvent('esx:spawnObject')
326326
AddEventHandler('esx:spawnObject', function(model)
327327

328-
local playerPed = GetPlayerPed(-1)
328+
local playerPed = PlayerPedId()
329329
local coords = GetEntityCoords(playerPed)
330330
local forward = GetEntityForwardVector(playerPed)
331331
local x, y, z = table.unpack(coords + forward * 1.0)
@@ -384,7 +384,7 @@ end)
384384
RegisterNetEvent('esx:pickupWeapon')
385385
AddEventHandler('esx:pickupWeapon', function(weaponPickup, weaponName,ammo)
386386

387-
local ped = GetPlayerPed(-1)
387+
local ped = PlayerPedId()
388388
local playerPedPos = GetEntityCoords(ped, true)
389389
CreateAmbientPickup(GetHashKey(weaponPickup), playerPedPos.x + 2.0, playerPedPos.y, playerPedPos.z + 0.5, 0, ammo, 1, false, true)
390390

@@ -394,7 +394,7 @@ RegisterNetEvent('esx:spawnPed')
394394
AddEventHandler('esx:spawnPed', function(model)
395395

396396
model = (tonumber(model) ~= nil and tonumber(model) or GetHashKey(model))
397-
local playerPed = GetPlayerPed(-1)
397+
local playerPed = PlayerPedId()
398398
local coords = GetEntityCoords(playerPed)
399399
local forward = GetEntityForwardVector(playerPed)
400400
local x, y, z = table.unpack(coords + forward * 1.0)
@@ -403,7 +403,7 @@ AddEventHandler('esx:spawnPed', function(model)
403403

404404
RequestModel(model)
405405

406-
while not HasModelLoaded(model) do
406+
while not HasModelLoaded(model) do
407407
Citizen.Wait(1)
408408
end
409409

@@ -415,22 +415,16 @@ end)
415415

416416
RegisterNetEvent('esx:deleteVehicle')
417417
AddEventHandler('esx:deleteVehicle', function()
418+
local playerPed = PlayerPedId()
419+
local vehicle = ESX.Game.GetVehicleInDirection()
418420

419-
local playerPed = GetPlayerPed(-1)
420-
local coords = GetEntityCoords(playerPed)
421-
422-
if IsPedInAnyVehicle(playerPed, false) then
423-
424-
local vehicle = GetVehiclePedIsIn(playerPed, false)
425-
ESX.Game.DeleteVehicle(vehicle)
426-
427-
elseif IsAnyVehicleNearPoint(coords.x, coords.y, coords.z, 5.0) then
428-
429-
local vehicle = GetClosestVehicle(coords.x, coords.y, coords.z, 5.0, 0, 71)
430-
ESX.Game.DeleteVehicle(vehicle)
431-
432-
end
421+
if IsPedInAnyVehicle(playerPed, false) then
422+
vehicle = GetVehiclePedIsIn(playerPed, false)
423+
end
433424

425+
if DoesEntityExist(vehicle) then
426+
ESX.Game.DeleteVehicle(vehicle)
427+
end
434428
end)
435429

436430

@@ -457,7 +451,7 @@ Citizen.CreateThread(function()
457451

458452
Citizen.Wait(1)
459453

460-
local playerPed = GetPlayerPed(-1)
454+
local playerPed = PlayerPedId()
461455
local loadout = {}
462456
local loadoutChanged = false
463457

@@ -566,7 +560,7 @@ Citizen.CreateThread(function()
566560

567561
Citizen.Wait(0)
568562

569-
local playerPed = GetPlayerPed(-1)
563+
local playerPed = PlayerPedId()
570564
local coords = GetEntityCoords(playerPed)
571565

572566
-- if there's no nearby pickups we can wait a bit to save performance
@@ -607,7 +601,7 @@ Citizen.CreateThread(function()
607601

608602
if ESX ~= nil and ESX.PlayerLoaded and PlayerSpawned then
609603

610-
local playerPed = GetPlayerPed(-1)
604+
local playerPed = PlayerPedId()
611605
local coords = GetEntityCoords(playerPed)
612606

613607
if not IsEntityDead(playerPed) then
@@ -626,7 +620,7 @@ Citizen.CreateThread(function()
626620

627621
Citizen.Wait(1000)
628622

629-
local playerPed = GetPlayerPed(-1)
623+
local playerPed = PlayerPedId()
630624

631625
if IsEntityDead(playerPed) and PlayerSpawned then
632626
PlayerSpawned = false

server-data/resources/[essential]/es_extended/config.weapons.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ Config.Weapons = {
9191
{ name = 'WEAPON_HEAVYSNIPER_MK2', label = _U('weapon_heavysniper_mk2') },
9292
{ name = 'WEAPON_PISTOL_MK2', label = _U('weapon_pistol_mk2') },
9393
{ name = 'WEAPON_SMG_MK2', label = _U('weapon_smg_mk2') },
94-
}
94+
}

0 commit comments

Comments
 (0)