I am running a server and I don't know exactly what add-on or where the permissions for this is, but none of my staff below admin can see the red "User has left the server with ____ slays left". It is vital to moderating and any help locating a place to give them permission to seeing that would be great.
SCREENSHOT: [url]http://gyazo.com/7780a2512ad99f3087ca9b3f4ad77204[/url]
The addons I have installed are:
extraulxcmds
hitnumbers
ilyamapvote2
joinmsg
leaderboards
pointshop-extras-master
pointshop-master
privatechat
pyro_hitmarker
qac
ragdoll-remover-master
riotshield
sawlauncher
scoreboardquickcommands
scorpyssimplechatbox
spraymon
stungun
traitorkills
troubleinterroristtownulxcommands
ttt banana bomb
ttt_killreveal
ulib
ulx
ulx auto promote
utime
veins
wyozitev
wyozitttadv
It more then likely uses IsAdmin() use GetUserGroup() instead like I did below.
[lua]
if player:GetUserGroup() == "Mod" or player:GetUserGroup() == "Admin" then
--Do shit here
end
[/lua]
Its not that I don't know how to do it, I don't know WHERE it is located.
Have you tried removing some addons to see what could be causing it?
Nothing is being "caused". I want to know where I could find who has access to see the leave messages displayed in the Gyazo Screenshot. I want the "moderator" group to be able to see those. Currently only admins and above can... I just don't know where the code for it is located.
[QUOTE=Frubbs;44414978]Nothing is being "caused". I want to know where I could find who has access to see the leave messages displayed in the Gyazo Screenshot. I want the "moderator" group to be able to see those. Currently only admins and above can... I just don't know where the code for it is located.[/QUOTE]
That's what I'm saying. Find out what addon is changing which usergroups messages are being sent to.
Wouldn't that be tedious and require excessive restarts of my populated server? :(
[QUOTE=Frubbs;44415162]Wouldn't that be tedious and require excessive restarts of my populated server? :([/QUOTE]
Take out half. If it still happens, or doesn't, you just eliminated half of the addons it could be. Rinse and repeat. Either do that, open up a separate test server, or look through the code. I have a feeling it's caused by a ULX addon, though.
[CODE]--Slaynr leave notifier
--[Start]----------------------------------------------------------------------------
function SlayNRLeaveInform (ply)
local slays_left = tonumber(ply:GetPData("slaynr_slays")) or 0 --Taken from Bender and Skillz' TTT module. Shortcut to their "slaynr" PData.
if slays_left > 0 then --Slays left need to be more than 0. Or else this will print to everyone that leaves.
for _, a in ipairs (player.GetAll()) do
if a:IsAdmin() then --Checks if there's an admin on.
ULib.tsayColor(a, true, Color(255, 255, 255), "The player ", Color(255, 0, 0), ply:Nick(), Color(255, 255, 255), " (", Color(255, 0, 0), ply:SteamID(), Color(255, 255, 255), ") left the server with ", Color(255, 0, 0), tostring(slays_left), Color(255, 255, 255), " slay(s) left.")
--Prints to admins that someone with slays left leaves. I like colors.
end
end
end
end
hook.Add("PlayerDisconnected", "SlayNRLeaveInform", SlayNRLeaveInform)
--[End]------------------------------------------------------------------------------[/CODE]
How to make this work for the "moderator" and "trusted" groups?
[QUOTE=Frubbs;44415921][CODE]--Slaynr leave notifier
--[Start]----------------------------------------------------------------------------
function SlayNRLeaveInform (ply)
local slays_left = tonumber(ply:GetPData("slaynr_slays")) or 0 --Taken from Bender and Skillz' TTT module. Shortcut to their "slaynr" PData.
if slays_left > 0 then --Slays left need to be more than 0. Or else this will print to everyone that leaves.
for _, a in ipairs (player.GetAll()) do
if a:IsAdmin() then --Checks if there's an admin on.
ULib.tsayColor(a, true, Color(255, 255, 255), "The player ", Color(255, 0, 0), ply:Nick(), Color(255, 255, 255), " (", Color(255, 0, 0), ply:SteamID(), Color(255, 255, 255), ") left the server with ", Color(255, 0, 0), tostring(slays_left), Color(255, 255, 255), " slay(s) left.")
--Prints to admins that someone with slays left leaves. I like colors.
end
end
end
end
hook.Add("PlayerDisconnected", "SlayNRLeaveInform", SlayNRLeaveInform)
--[End]------------------------------------------------------------------------------[/CODE]
How to make this work for the "moderator" and "trusted" groups?[/QUOTE]
I already said how to do it above.
[QUOTE=StonedPenguin;44416066]I already said how to do it above.[/QUOTE]
This code uses if a:IsAdmin() then
I dont know how to incorporate your code with that. I am VERY new to LUA
[editline]31st March 2014[/editline]
Okay so this is my code
[CODE]--Slaynr leave notifier
--[Start]----------------------------------------------------------------------------
function SlayNRLeaveInform (ply)
local slays_left = tonumber(ply:GetPData("slaynr_slays")) or 0 --Taken from Bender and Skillz' TTT module. Shortcut to their "slaynr" PData.
if slays_left > 0 then --Slays left need to be more than 0. Or else this will print to everyone that leaves.
for _, a in ipairs (player.GetAll()) do
if player:GetUserGroup() == "moderator" or player:GetUserGroup() == "admin" then --Checks if there's an admin on.
ULib.tsayColor(a, true, Color(255, 255, 255), "The player ", Color(255, 0, 0), ply:Nick(), Color(255, 255, 255), " (", Color(255, 0, 0), ply:SteamID(), Color(255, 255, 255), ") left the server with ", Color(255, 0, 0), tostring(slays_left), Color(255, 255, 255), " slay(s) left.")
--Prints to admins that someone with slays left leaves. I like colors.
end
end
end
end
hook.Add("PlayerDisconnected", "SlayNRLeaveInform", SlayNRLeaveInform)
--[End]------------------------------------------------------------------------------[/CODE]
How do I string like four groups together, like moderator, admin, staffchief, owner, dev, servermanager, trusted, superadmin
[url]http://wiki.garrysmod.com/page/Player/IsUserGroup[/url] This might help.
[CODE]function SlayNRLeaveInform (ply)
local slays_left = tonumber(ply:GetPData("slaynr_slays")) or 0 --Taken from Bender and Skillz' TTT module. Shortcut to their "slaynr" PData.
if slays_left > 0 then --Slays left need to be more than 0. Or else this will print to everyone that leaves.
for _, a in ipairs (player.GetAll()) do
if ( Player:IsUserGroup( "superadmin", "moderator", "admin", "staffchief", "servermanager", "trusted" ) ) then --Checks if there's an admin on.
ULib.tsayColor(a, true, Color(255, 255, 255), "The player ", Color(255, 0, 0), ply:Nick(), Color(255, 255, 255), " (", Color(255, 0, 0), ply:SteamID(), Color(255, 255, 255), ") left the server with ", Color(255, 0, 0), tostring(slays_left), Color(255, 255, 255), " slay(s) left.")
--Prints to admins that someone with slays left leaves. I like colors.
end
end
end
end
hook.Add("PlayerDisconnected", "SlayNRLeaveInform", SlayNRLeaveInform)
--[End]------------------------------------------------------------------------------
[/CODE]
It doesn't work, what did I do wrong?
[LUA]if table.HasValue( { "mod", "admin", "staffchief", "owner", "dev", "servermanager", "trusted", "superadmin" }, ply:GetUserGroup() ) then[/LUA]
it'd be better to create the table outside of the function but you get the idea
[QUOTE=rejax;44416316][LUA]if table.HasValue( { "mod", "admin", "staffchief", "owner", "dev", "servermanager", "trusted", "superadmin" }, ply:GetUserGroup() ) then[/LUA]
it'd be better to create the table outside of the function but you get the idea[/QUOTE]
Works like a charm, thank you
Sorry, you need to Log In to post a reply to this thread.