Added AFK functionality to head tags.
+ Updated Head-Tags.
This commit is contained in:
@@ -4,6 +4,7 @@ local showTags = true
|
||||
local seeTags = false
|
||||
local isDriver = false
|
||||
local staffTable = { 0 }
|
||||
local afkTable = { 0 }
|
||||
|
||||
RegisterNetEvent('staffTag')
|
||||
AddEventHandler('staffTag', function(playerID)
|
||||
@@ -21,6 +22,22 @@ AddEventHandler('sendStaff', function(_staffTable)
|
||||
staffTable = _staffTable
|
||||
end)
|
||||
|
||||
RegisterNetEvent('afkTag')
|
||||
AddEventHandler('afkTag', function(playerID)
|
||||
if afkTag then
|
||||
afkTag = false
|
||||
TriggerEvent('chat:addMessage', {color = { 255, 0, 0},multiline = false,args = {"[SYSTEM]", "Afk tag ^*^1Disabled^0"}})
|
||||
else
|
||||
afkTag = true
|
||||
TriggerEvent('chat:addMessage', {color = { 255, 0, 0},multiline = false,args = {"[SYSTEM]", "Afk tag ^*^2Enabled^0"}})
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterNetEvent('sendAfk')
|
||||
AddEventHandler('sendAfk', function(_afkTable)
|
||||
afkTable = _afkTable
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('showTags')
|
||||
AddEventHandler('showTags', function()
|
||||
@@ -63,6 +80,9 @@ function ManageHeadLabels()
|
||||
if has_value(staffTable,GetPlayerServerId(i)) then
|
||||
SetMpGamerTagName(headDisplayId,DisplayStaffTag.." "..GetPlayerServerId(i).." | "..GetPlayerName(i))
|
||||
SetMpGamerTagColour(headDisplayId, 0, 6)
|
||||
elseif has_value(afkTable,GetPlayerServerId(i)) then
|
||||
SetMpGamerTagName(headDisplayId,DisplayAfkTag.." "..GetPlayerServerId(i).." | "..GetPlayerName(i))
|
||||
SetMpGamerTagColour(headDisplayId, 0, 6)
|
||||
else
|
||||
SetMpGamerTagColour(headDisplayId, 0, 0)
|
||||
SetMpGamerTagName(headDisplayId,GetPlayerServerId(i).." | "..GetPlayerName(i))
|
||||
@@ -103,4 +123,4 @@ Citizen.CreateThread(function()
|
||||
ManageHeadLabels()
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Config = {}
|
||||
|
||||
DisplayStaffTag = "Staff |"
|
||||
DisplayAfkTag = "Afk | "
|
||||
disPlayerNames = 10
|
||||
@@ -1,8 +1,22 @@
|
||||
local staffTag = false
|
||||
local staffTable = { 0 }
|
||||
local afkTag = false
|
||||
local afkTable = { 0 }
|
||||
|
||||
--print(table.unpack(staffTable))
|
||||
|
||||
RegisterCommand("afktag", function(source, args, rawCommand)
|
||||
-- Add player to Staff table
|
||||
TriggerClientEvent("afkTag", source, source)
|
||||
if has_value(afkTable, source) then
|
||||
removebyKey(afkTable, source)
|
||||
else
|
||||
table.insert(afkTable, source)
|
||||
end
|
||||
--print(table.unpack(staffTable))
|
||||
TriggerClientEvent("sendAfk", -1, afkTable)
|
||||
end)
|
||||
|
||||
RegisterCommand("stafftag", function(source, args, rawCommand)
|
||||
if IsPlayerAceAllowed(source, "jd.staff") then
|
||||
-- Add player to Staff table
|
||||
|
||||
Reference in New Issue
Block a user