addEventHandler("onClientGUIClick",resourceRoot,
function()
if source == GUIEditor.button[6] then
triggerServerEvent("yasTeam",localPlayer)
elseif source == GUIEditor.button[7] then
triggerServerEvent("noTeam",localPlayer)
end
end)
Addno = false;
addEventHandler("onClientGUIClick",resourceRoot,
function()
if source == GUIEditor.button[8] and Addno == false then
Addno = true;
triggerServerEvent("AD",localPlayer)
elseif source == GUIEditor.button[8] and Addno == true then
Addno = false;
triggerServerEvent("noAD",localPlayer)
end
end)
addEvent("yasTeam",true)
addEventHandler("yesTeam", root,
function()
for i, player in pairs(getElementsByType("player")) do
unbindKey(player, "y", "down", "chatbox", "Teamsay")
end
end )
addEvent("noTeam",true)
addEventHandler("noTeam", root,
function()
for i, player in pairs(getElementsByType("player")) do
bindKey(player, "y", "down", "chatbox", "Teamsay")
end
end )
------------------------------------------
groups = {
"Console",
"Admin",
"SuperModerator",
"Moderator",
"Level 1",
"Level 2",
"Level 3",
"Level 4",
"Level 5",
"Level 6",
"Head.Admin",
"Owner",
"Leve16Plus",
"Level5Plus",
"Level4Plus",
"Level3Plus",
"Level2Plus",
"Level1Plus",
"AdminChat"
}
addCommandHandler("AdminChat",
function(player,cmd,...)
for theKey,theGroup in ipairs(groups) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup(theGroup)) then
for theKey,theGroup in ipairs(groups) do
for theKey,thePlayer in ipairs(getElementsByType("player")) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup(theGroup)) then
outputChatBox("(ADMIN) "..getPlayerName(player)..": #ffffff"..table.concat({...}," "),thePlayer,255,0,0,true)
end
end
return
end
end
end
end
)
addEventHandler("onResourceStart",root,
function()
for theKey,thePlayer in ipairs(getElementsByType("player")) do
bindKey(thePlayer,"[","down","chatbox","AdminChat")
end
end
)
---------------------------------------------------------------
addEvent("AD",true)
addEventHandler("AD", root,
function()
for i, player in pairs(getElementsByType("player")) do
unbindKey(player, "[", "down", "chatbox", "AdminChat")
end
end )
addEvent("noAD",true)
addEventHandler("noAD", root,
function()
for i, player in pairs(getElementsByType("player")) do
bindKey(player, "[", "down", "chatbox", "AdminChat")
end
end )