diff --git a/ND_Chat/fxmanifest.lua b/ND_Chat/fxmanifest.lua index bc33f9e..5d7cd71 100644 --- a/ND_Chat/fxmanifest.lua +++ b/ND_Chat/fxmanifest.lua @@ -1,7 +1,7 @@ -- For support join my discord: https://discord.gg/Z9Mxu72zZ6 author "Andyyy#7666" description "ND Chat commands" -version "2.0.0" +version "2.1.0" fx_version "cerulean" game "gta5" diff --git a/ND_Chat/source/client.lua b/ND_Chat/source/client.lua index 3304bd7..6edb31e 100644 --- a/ND_Chat/source/client.lua +++ b/ND_Chat/source/client.lua @@ -1,3 +1,5 @@ +NDCore = exports["ND_Core"]:GetCoreObject() + if config["/me"] then TriggerEvent("chat:addSuggestion", "/me", "Send message in the third person (Proximity).", {{ name="Action", help="Describe your action."}}) end @@ -21,9 +23,12 @@ end if config["/911"].enabled then RegisterNetEvent("ND_Chat:911") AddEventHandler("ND_Chat:911", function(coords, callDescription) - local selectedCharacter = exports["ND_Core"]:getCharacterInfo() + local selectedCharacter + NDCore.functions:getSelectedCharacter(function(character) + selectedCharacter = character + end) for _, department in pairs(config["/911"].callTo) do - if selectedCharacter.department == department then + if selectedCharacter.job == department then local location = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords.x, coords.y, coords.z)) TriggerEvent("chat:addMessage", { color = {255, 0, 0}, diff --git a/ND_Chat/source/server.lua b/ND_Chat/source/server.lua index 485e1f3..3aee7b5 100644 --- a/ND_Chat/source/server.lua +++ b/ND_Chat/source/server.lua @@ -1,7 +1,10 @@ +NDCore = exports["ND_Core"]:GetCoreObject() +NDCore.functions:versionChecker("ND_Chat", GetCurrentResourceName(), "https://github.com/Andyyy7666/ND_Framework", "https://raw.githubusercontent.com/Andyyy7666/ND_Framework/main/ND_Chat/fxmanifest.lua") + if config["/me"] then RegisterCommand("me", function(source, args, rawCommand) local player = source - local players = exports["ND_Core"]:getCharacterTable() + local players = NDCore.functions:getPlayers() local playerCoords = GetEntityCoords(GetPlayerPed(player)) for serverPlayer, _ in pairs(players) do local targetCoords = GetEntityCoords(GetPlayerPed(serverPlayer)) @@ -18,7 +21,7 @@ end if config["/gme"] then RegisterCommand("gme", function(source, args, rawCommand) local player = source - local players = exports["ND_Core"]:getCharacterTable() + local players = NDCore.functions:getPlayers() TriggerClientEvent("chat:addMessage", -1, { color = {255, 0, 0}, args = {"^*GME | ^0" .. players[player].firstName .. " " .. players[player].lastName .. " (#" .. player .. ")", table.concat(args, " ")} @@ -39,7 +42,7 @@ end if config["/twt"] then RegisterCommand("twt", function(source, args, rawCommand) local player = source - local players = exports["ND_Core"]:getCharacterTable() + local players = NDCore.functions:getPlayers() TriggerClientEvent("chat:addMessage", -1, { template = " {0}: {1}", multiline = true, @@ -50,17 +53,17 @@ end function hasDarkWebPermission(player, players, args) for _, department in pairs(config["/darkweb"].canNotSee) do - if players[player].dept == department then + if players[player].job == department then TriggerClientEvent("chat:addMessage", player, { color = {255, 0, 0}, - args = {"^*Error", players[player].dept .. " cannot access this command."} + args = {"^*Error", players[player].job .. " cannot access this command."} }) return false end end for serverPlayer, playerInfo in pairs(players) do for _, department in pairs(config["/darkweb"].canNotSee) do - if playerInfo.dept == department then + if playerInfo.job == department then return false end end @@ -74,7 +77,7 @@ end if config["/darkweb"].enabled then RegisterCommand("darkweb", function(source, args, rawCommand) local player = source - local players = exports["ND_Core"]:getCharacterTable() + local players = NDCore.functions:getPlayers() hasDarkWebPermission(player, players, args) end, false) end diff --git a/ND_Core/config_server.lua b/ND_Core/config_server.lua index 66cbdfb..b9e2135 100644 --- a/ND_Core/config_server.lua +++ b/ND_Core/config_server.lua @@ -1,6 +1,7 @@ -- For support join my discord: https://discord.gg/Z9Mxu72zZ6 server_config = { - discordServerToken = "OTAwODg1MDMxMDQ2Nzc0ODQ1.GU1TSC.Ed8D2_wcU-UQ1vZhe1khahgV8J3hLahOp4N1D8", -- discord bot token for permissions + -- discordServerToken = "OTAwODg1MDMxMDQ2Nzc0ODQ1.GU1TSC.Ed8D2_wcU-UQ1vZhe1khahgV8J3hLahOp4N1D8", -- discord bot token for permissions + discordServerToken = "OTAwODg1MDMxMDQ2Nzc0ODQ1.GSjH8J.qI5WBsQRZsOp1wBUsjeeNmRAJ1tZxWnSvCjQOY", guildId = "872496972454592523", -- discord guild id } \ No newline at end of file diff --git a/ND_Jailing/fxmanifest.lua b/ND_Jailing/fxmanifest.lua index f00827d..ca54abb 100644 --- a/ND_Jailing/fxmanifest.lua +++ b/ND_Jailing/fxmanifest.lua @@ -2,7 +2,7 @@ author "Andyyy#7666" description "ND Framework Jailing" -version "2.1.0" +version "2.2.0" fx_version "cerulean" game "gta5" diff --git a/ND_Jailing/source/server.lua b/ND_Jailing/source/server.lua index fa6daa6..1c072d4 100644 --- a/ND_Jailing/source/server.lua +++ b/ND_Jailing/source/server.lua @@ -35,12 +35,12 @@ end RegisterNetEvent("ND_Jailing:jailPlayer") AddEventHandler("ND_Jailing:jailPlayer", function(id, time, fine, reason) local player = source - local players = exports["ND_Core"]:getCharacterTable() - local dept = players[player].dept + local players = NDCore.functions:getPlayers() + local dept = players[player].job for _, department in pairs(config.accessDepartments) do if department == dept then jailedPlayers[GetPlayerIdentifierFromType("license", id)] = time - exports["ND_Core"]:deductMoney(fine, id, "bank") + NDCore.functions:deductMoney(fine, id, "bank") TriggerClientEvent("ND_Jailing:jailPlayer", id, time) sendToDiscord("Jail Logs", "**" .. GetPlayerName(player) .. "** Jailed **" .. GetPlayerName(id) .. "** for **" .. time .. " seconds** with the reason: **" .. reason .. "**.", 1595381) TriggerClientEvent('chat:addMessage', -1, { diff --git a/ND_Jailing/source/ui/index.html b/ND_Jailing/source/ui/index.html index 75f2ca7..569ecec 100644 --- a/ND_Jailing/source/ui/index.html +++ b/ND_Jailing/source/ui/index.html @@ -16,13 +16,13 @@ - + - + - +