mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
Merge pull request #1356 from Gellipapa/fix-random-default-spawn
🚑 Fix random default spawn coords
This commit is contained in:
@@ -23,3 +23,9 @@ function ESX.Math.Trim(value)
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function ESX.Math.Random(minRange, maxRange)
|
||||
math.randomseed(GetGameTimer())
|
||||
return math.random(minRange or 1, maxRange or 10)
|
||||
end
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ function loadESXPlayer(identifier, playerId, isNew)
|
||||
end
|
||||
|
||||
-- Position
|
||||
userData.coords = json.decode(result.position) or Config.DefaultSpawns[math.random(#Config.DefaultSpawns)]
|
||||
userData.coords = json.decode(result.position) or Config.DefaultSpawns[ESX.Math.Random(1,#Config.DefaultSpawns)]
|
||||
|
||||
-- Skin
|
||||
userData.skin = (result.skin and result.skin ~= "") and json.decode(result.skin) or { sex = userData.sex == "f" and 1 or 0 }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local mp_m_freemode_01 = `mp_m_freemode_01`
|
||||
local mp_f_freemode_01 = `mp_f_freemode_01`
|
||||
|
||||
local SpawnCoords = Config.Spawn[math.random(#Config.Spawn)]
|
||||
local SpawnCoords = Config.Spawn[ESX.Math.Random(1,#Config.Spawn)]
|
||||
|
||||
if ESX.GetConfig().Multichar then
|
||||
CreateThread(function()
|
||||
|
||||
Reference in New Issue
Block a user