From c2772dbd560f7bb000cff68d85f0cd71a2ef1d69 Mon Sep 17 00:00:00 2001 From: thesysadmindev Date: Thu, 25 May 2023 20:17:39 +1000 Subject: [PATCH 1/4] feat(es_extended) Added in randomisation of default spawn coordinates Replaced Config.DefaultSpawn in [core]\es_extended\config.lua:L21 with a table of default spawn coordinates, and updated [core]\es_extended\server\main.lua:L254 to use new coordinates table. --- [core]/es_extended/config.lua | 8 +++++++- [core]/es_extended/server/main.lua | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index 70e2280d..9262e27b 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -18,7 +18,13 @@ Config.Accounts = { Config.StartingAccountMoney = {bank = 50000} -Config.DefaultSpawn = {x = -269.4, y = -955.3, z = 31.2, heading = 205.8} +Config.Spawns = { -- Default spawn locations are currently set to locations on San Andreas Avenue near the intersection of Strawberry Avenue at Legion Square + {x = 222.2027, y = -864.0162, z = 30.2922, heading = 1.0}, + {x = 224.9865, y = -865.0871, z = 30.2922, heading = 1.0}, + {x = 227.8436, y = -866.0400, z = 30.2922, heading = 1.0}, + {x = 230.6051, y = -867.1450, z = 30.2922, heading = 1.0}, + {x = 233.5459, y = -868.2626, z = 30.2922, heading = 1.0} +} Config.EnablePaycheck = true -- enable paycheck Config.LogPaycheck = false -- Logs paychecks to a nominated Discord channel via webhook (default is false) diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua index 889e9c94..2c85305b 100644 --- a/[core]/es_extended/server/main.lua +++ b/[core]/es_extended/server/main.lua @@ -251,7 +251,7 @@ function loadESXPlayer(identifier, playerId, isNew) end -- Position - userData.coords = json.decode(result.position) or Config.DefaultSpawn + userData.coords = json.decode(result.position) or Config.Spawns[math.random(#Config.Spawns)] -- Skin if result.skin and result.skin ~= '' then From b740fa187a536c1e10f18185819b3db9d2870acc Mon Sep 17 00:00:00 2001 From: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Thu, 25 May 2023 15:12:22 +0200 Subject: [PATCH 2/4] Hmm --- [core]/es_extended/config.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index 0608fbbf..9eac7f6d 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -19,12 +19,12 @@ Config.Accounts = { Config.StartingAccountMoney = {bank = 50000} -Config.Spawns = { -- Default spawn locations are currently set to locations on San Andreas Avenue near the intersection of Strawberry Avenue at Legion Square +Config.Spawns = { -- If you want to have more spawn positions and select them randomly uncomment commented code or add more locations {x = 222.2027, y = -864.0162, z = 30.2922, heading = 1.0}, - {x = 224.9865, y = -865.0871, z = 30.2922, heading = 1.0}, - {x = 227.8436, y = -866.0400, z = 30.2922, heading = 1.0}, - {x = 230.6051, y = -867.1450, z = 30.2922, heading = 1.0}, - {x = 233.5459, y = -868.2626, z = 30.2922, heading = 1.0} + --{x = 224.9865, y = -865.0871, z = 30.2922, heading = 1.0}, + --{x = 227.8436, y = -866.0400, z = 30.2922, heading = 1.0}, + --{x = 230.6051, y = -867.1450, z = 30.2922, heading = 1.0}, + --{x = 233.5459, y = -868.2626, z = 30.2922, heading = 1.0} } Config.AdminGroups = { From 3b06d8cf59d7a3dc17debb939888b178a1739da5 Mon Sep 17 00:00:00 2001 From: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Thu, 25 May 2023 15:12:59 +0200 Subject: [PATCH 3/4] DefaultSpawns --- [core]/es_extended/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/config.lua b/[core]/es_extended/config.lua index 9eac7f6d..a4245685 100644 --- a/[core]/es_extended/config.lua +++ b/[core]/es_extended/config.lua @@ -19,7 +19,7 @@ Config.Accounts = { Config.StartingAccountMoney = {bank = 50000} -Config.Spawns = { -- If you want to have more spawn positions and select them randomly uncomment commented code or add more locations +Config.DefaultSpawns = { -- If you want to have more spawn positions and select them randomly uncomment commented code or add more locations {x = 222.2027, y = -864.0162, z = 30.2922, heading = 1.0}, --{x = 224.9865, y = -865.0871, z = 30.2922, heading = 1.0}, --{x = 227.8436, y = -866.0400, z = 30.2922, heading = 1.0}, From 86270a3b1c59b2bef61e67f411ccaa378a340a59 Mon Sep 17 00:00:00 2001 From: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Thu, 25 May 2023 15:13:21 +0200 Subject: [PATCH 4/4] Forgot --- [core]/es_extended/server/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/[core]/es_extended/server/main.lua b/[core]/es_extended/server/main.lua index 2c85305b..87958fed 100644 --- a/[core]/es_extended/server/main.lua +++ b/[core]/es_extended/server/main.lua @@ -251,7 +251,7 @@ function loadESXPlayer(identifier, playerId, isNew) end -- Position - userData.coords = json.decode(result.position) or Config.Spawns[math.random(#Config.Spawns)] + userData.coords = json.decode(result.position) or Config.DefaultSpawns[math.random(#Config.DefaultSpawns)] -- Skin if result.skin and result.skin ~= '' then