mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2026-11-10 13:57:18 +01:00
Code modernize (#234)
* refactor: declare exports at runtime and drop the player-data provides alias Signed-off-by: Mathu-lmn <[email protected]> * refactor: pass handlers directly to RegisterNetEvent Signed-off-by: Mathu-lmn <[email protected]> * refactor: use CreateThread/Wait without the Citizen prefix Signed-off-by: Mathu-lmn <[email protected]> * chore: remove trailing whitespace, stray lines and unused locals Signed-off-by: Mathu-lmn <[email protected]> --------- Signed-off-by: Mathu-lmn <[email protected]>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
AddEventHandler('gameEventTriggered', function(eventName, args)
|
||||
if eventName == 'CEventNetworkEntityDamage' then
|
||||
local victim = args[1]
|
||||
local culprit = args[2]
|
||||
local isDead = args[6] == 1
|
||||
|
||||
if isDead then
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
local safePositions = {}
|
||||
|
||||
RegisterNetEvent('money:allowPickupNear')
|
||||
|
||||
AddEventHandler('money:allowPickupNear', function(pedId)
|
||||
RegisterNetEvent('money:allowPickupNear', function(pedId)
|
||||
local entity = NetworkGetEntityFromNetworkId(pedId)
|
||||
|
||||
Wait(250)
|
||||
@@ -19,9 +17,7 @@ AddEventHandler('money:allowPickupNear', function(pedId)
|
||||
safePositions[pedId] = coords
|
||||
end)
|
||||
|
||||
RegisterNetEvent('money:tryPickup')
|
||||
|
||||
AddEventHandler('money:tryPickup', function(entity)
|
||||
RegisterNetEvent('money:tryPickup', function(entity)
|
||||
if not safePositions[entity] then
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user