Files
ND_Core/ND_Chat/source/client.lua

51 lines
2.1 KiB
Lua
Raw Normal View History

NDCore = exports["ND_Core"]:GetCoreObject()
2022-07-09 00:06:36 +02:00
if config["/me"] then
2022-07-09 16:13:33 -06:00
TriggerEvent("chat:addSuggestion", "/me", "Send message in the third person (Proximity).", {{ name="Action", help="Describe your action."}})
2022-07-09 00:06:36 +02:00
end
if config["/gme"] then
2022-07-09 16:13:33 -06:00
TriggerEvent("chat:addSuggestion", "/gme", "Send message in the third person (Global).", {{ name="Action", help="Describe your action."}})
2022-07-09 00:06:36 +02:00
end
if config["/ooc"] then
2022-07-09 16:13:33 -06:00
TriggerEvent("chat:addSuggestion", "/ooc", "Out of Character chat message (Global).", {{name="Message", help="Put your questions or help request."}})
2022-07-09 00:06:36 +02:00
end
if config["/twt"] then
2022-07-09 16:13:33 -06:00
TriggerEvent("chat:addSuggestion", "/twt", "Send a Twotter in game. (Global)", {{name="Message", help="Twotter Message."}})
2022-07-09 00:06:36 +02:00
end
if config["/darkweb"].enabled then
2022-07-09 16:13:33 -06:00
TriggerEvent("chat:addSuggestion", "/darkweb", "Send a anonymous message in game (Global).", {{ name="Message", help=""}})
2022-07-09 00:06:36 +02:00
end
if config["/911"].enabled then
RegisterNetEvent("ND_Chat:911")
AddEventHandler("ND_Chat:911", function(coords, callDescription)
local selectedCharacter
NDCore.functions:getSelectedCharacter(function(character)
selectedCharacter = character
end)
2022-07-09 00:06:36 +02:00
for _, department in pairs(config["/911"].callTo) do
if selectedCharacter.job == department then
2022-07-09 00:06:36 +02:00
local location = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords.x, coords.y, coords.z))
TriggerEvent("chat:addMessage", {
color = {255, 0, 0},
args = {"^*[911] ^3Location: " .. location .. " ^1| Call infomation^0", callDescription}
})
local blip = AddBlipForCoord(coords.x, coords.y, coords.z)
SetBlipSprite(blip, 817)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
SetBlipColour(blip, 1)
AddTextComponentString("911 CALL: " .. location)
EndTextCommandSetBlipName(blip)
Citizen.Wait(60 * 1000)
RemoveBlip(blip)
break
end
end
end)
2022-07-09 16:13:33 -06:00
end