if config["/me"] then
RegisterCommand("me", function(source, args, rawCommand)
local player = source
local players = exports["ND_Core"]:getCharacterTable()
local playerCoords = GetEntityCoords(GetPlayerPed(player))
for serverPlayer, _ in pairs(players) do
local targetCoords = GetEntityCoords(GetPlayerPed(serverPlayer))
if (#(playerCoords - targetCoords) < 20.0) then
TriggerClientEvent("chat:addMessage", serverPlayer, {
color = {255, 0, 0},
args = {"^*ME | ^0" .. players[player].firstName .. " " .. players[player].lastName .. " (#" .. player .. ")", table.concat(args, " ")}
})
end
end
end, false)
end
if config["/gme"] then
RegisterCommand("gme", function(source, args, rawCommand)
local player = source
local players = exports["ND_Core"]:getCharacterTable()
TriggerClientEvent("chat:addMessage", -1, {
color = {255, 0, 0},
args = {"^*GME | ^0" .. players[player].firstName .. " " .. players[player].lastName .. " (#" .. player .. ")", table.concat(args, " ")}
})
end, false)
end
if config["/ooc"] then
RegisterCommand("ooc", function(source, args, rawCommand)
local player = source
TriggerClientEvent("chat:addMessage", -1, {
color = {150, 150, 150},
args = {"^*OOC | ^0" .. GetPlayerName(player) .. " (#" .. player .. ")", table.concat(args, " ")}
})
end, false)
end
if config["/twt"] then
RegisterCommand("twt", function(source, args, rawCommand)
local player = source
local players = exports["ND_Core"]:getCharacterTable()
TriggerClientEvent("chat:addMessage", -1, {
template = "
{0}: {1}",
multiline = true,
args = {"^4@" .. players[player].twt .. " (#" .. player .. ")", table.concat(args, " ")}
})
end, false)
end
function hasDarkWebPermission(player, players, args)
for _, department in pairs(config["/darkweb"].canNotSee) do
if players[player].dept == department then
TriggerClientEvent("chat:addMessage", player, {
color = {255, 0, 0},
args = {"^*Error", players[player].dept .. " 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
return false
end
end
TriggerClientEvent("chat:addMessage", serverPlayer, {
color = {0, 0, 0},
args = {"^*Dark web | ^0Anonymous (#" .. player .. ")", table.concat(args, " ")}
})
end
end
if config["/darkweb"].enabled then
RegisterCommand("darkweb", function(source, args, rawCommand)
local player = source
local players = exports["ND_Core"]:getCharacterTable()
hasDarkWebPermission(player, players, args)
end, false)
end
if config["/911"].enabled then
RegisterCommand("911", function(source, args, rawCommand)
local player = source
TriggerClientEvent("ND_Chat:911", -1, GetEntityCoords(GetPlayerPed(player)), table.concat(args, " "))
end, false)
end