mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
(fix) Fixed Chat and Jailing
-Fixed chat for framework -Fixed jailing and lil speling mistake
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -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 = "<img src='data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxz%0D%0AdmcKICB2aWV3Ym94PSIwIDAgMjAwMCAxNjI1LjM2IgogIHdpZHRoPSIyMDAwIgogIGhlaWdodD0i%0D%0AMTYyNS4zNiIKICB2ZXJzaW9uPSIxLjEiCiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAv%0D%0Ac3ZnIj4KICA8cGF0aAogICAgZD0ibSAxOTk5Ljk5OTksMTkyLjQgYyAtNzMuNTgsMzIuNjQgLTE1%0D%0AMi42Nyw1NC42OSAtMjM1LjY2LDY0LjYxIDg0LjcsLTUwLjc4IDE0OS43NywtMTMxLjE5IDE4MC40%0D%0AMSwtMjI3LjAxIC03OS4yOSw0Ny4wMyAtMTY3LjEsODEuMTcgLTI2MC41Nyw5OS41NyBDIDE2MDku%0D%0AMzM5OSw0OS44MiAxNTAyLjY5OTksMCAxMzg0LjY3OTks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gogICAgc3R5bGU9ImZpbGw6IzAwYWNlZCIv%0D%0APgo8L3N2Zz4K' height='16'> <b>{0}</b>: {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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
author "Andyyy#7666"
|
||||
description "ND Framework Jailing"
|
||||
version "2.1.0"
|
||||
version "2.2.0"
|
||||
|
||||
fx_version "cerulean"
|
||||
game "gta5"
|
||||
|
||||
@@ -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, {
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
</select>
|
||||
|
||||
<label class="text" for="jailtime">Time</label>
|
||||
<input id="time" class="input" type="number" placeholder="In seconds" name="jailtime" min="10" required>
|
||||
<input id="time" class="input" type="number" placeholder="In Seconds" name="jailtime" min="10" required>
|
||||
|
||||
<label class="text" for="fine">Fine</label>
|
||||
<input id="fine" class="input" type="number" placeholder="In seconds" name="fine" max="" required>
|
||||
<input id="fine" class="input" type="number" placeholder="$1000" name="fine" max="" required>
|
||||
|
||||
<label class="text" for="reason">Reason</label>
|
||||
<input id="reason" class="input" type="text" placeholder="short reason" name="reason" required>
|
||||
<input id="reason" class="input" type="text" placeholder="Short Reason" name="reason" required>
|
||||
</div>
|
||||
<hr id="line" style="position: absolute; margin: auto; left: 0; right: 0; bottom: 15%;">
|
||||
<p id="error"></p>
|
||||
|
||||
Reference in New Issue
Block a user