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:
@@ -12,14 +12,14 @@ local function refreshResources()
|
||||
if GetNumResourceMetadata(resource, 'resource_type') > 0 then
|
||||
local type = GetResourceMetadata(resource, 'resource_type', 0)
|
||||
local params = json.decode(GetResourceMetadata(resource, 'resource_type_extra', 0))
|
||||
|
||||
|
||||
local valid = false
|
||||
|
||||
|
||||
local games = GetNumResourceMetadata(resource, 'game')
|
||||
if games > 0 then
|
||||
for j = 0, games - 1 do
|
||||
local game = GetResourceMetadata(resource, 'game', j)
|
||||
|
||||
|
||||
if game == GetConvar('gamename', 'gta5') or game == 'common' then
|
||||
valid = true
|
||||
end
|
||||
@@ -313,3 +313,11 @@ function doesMapSupportGameType(gameType, map)
|
||||
|
||||
return maps[map].gameTypes[gameType]
|
||||
end
|
||||
|
||||
exports('getCurrentGameType', getCurrentGameType)
|
||||
exports('getCurrentMap', getCurrentMap)
|
||||
exports('changeGameType', changeGameType)
|
||||
exports('changeMap', changeMap)
|
||||
exports('doesMapSupportGameType', doesMapSupportGameType)
|
||||
exports('getMaps', getMaps)
|
||||
exports('roundEnded', roundEnded)
|
||||
|
||||
Reference in New Issue
Block a user