From cd3e3ab21b72c129cbdd47e57c8a16cc0537d854 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Sun, 18 Sep 2022 01:15:08 +0200 Subject: [PATCH] Update server.lua --- ND_CharacterSelection/source/server.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ND_CharacterSelection/source/server.lua b/ND_CharacterSelection/source/server.lua index 9d613aa..7822639 100644 --- a/ND_CharacterSelection/source/server.lua +++ b/ND_CharacterSelection/source/server.lua @@ -34,6 +34,10 @@ end) RegisterNetEvent("ND_CharacterSelection:editCharacter", function(newCharacter) local player = source + -- check if player owns the character. + local characters = NDCore.Functions.GetPlayerCharacters(player) + if not characters[newCharacter.id] then return end + -- validate that the person has permission to use the department. local departmentCheck = validateDepartment(player, newCharacter.job) if not departmentCheck then return end @@ -76,4 +80,4 @@ if config.departmentPaychecks then end end end) -end \ No newline at end of file +end