• Murder Admin Help
    2 replies, posted
So I am trying to do is set ULX groups as Admin for the Murder Gamemode, so the red marking on the scoreboard indicating that player is an Admin and being able to access the Admin panel as other ranks, I think it is possible through this area of gamemodes/murder/gamemode/cl_adminpanel.lua but I am not sure :/ Lines 30-39 [code] if IsValid(ply) && ply:IsPlayer() then local s = 0 if showAdmins && ply:IsAdmin() then surface.SetMaterial(admin) surface.SetDrawColor(color_white) surface.DrawTexturedRect(s + 4, h / 2 - 16, 32, 32) s = s + 32 end [/code] I tried doing this to see if it would work, but still didn't work :/ [code] if IsValid(ply) && ply:IsPlayer() then local s = 0 if showAdmins && ply:IsUserGroup("coder", "owner", "admin", "superadmin", "moderator") then surface.SetMaterial(admin) surface.SetDrawColor(color_white) surface.DrawTexturedRect(s + 4, h / 2 - 16, 32, 32) s = s + 32 end [/code] Any suggestions?
Well for one, [lua]ply:IsUserGroup("coder", "owner", "admin", "superadmin", "moderator") [/lua] only accepts one argument, which is the string usergroup. So you'll have to separate it into different checks, like so: [lua]if showAdmins && ply:IsUserGroup("coder") || ply:IsUserGroup("owner") || ply:IsUserGroup("admin")[/lua] etc, for the rest of your ranks. Also, are you getting any errors?
[QUOTE=Wolf1375;44272515]So I am trying to do is set ULX groups as Admin for the Murder Gamemode, so the red marking on the scoreboard indicating that player is an Admin and being able to access the Admin panel as other ranks, I think it is possible through this area of gamemodes/murder/gamemode/cl_adminpanel.lua but I am not sure :/ Lines 30-39 [code] if IsValid(ply) && ply:IsPlayer() then local s = 0 if showAdmins && ply:IsAdmin() then surface.SetMaterial(admin) surface.SetDrawColor(color_white) surface.DrawTexturedRect(s + 4, h / 2 - 16, 32, 32) s = s + 32 end [/code] I tried doing this to see if it would work, but still didn't work :/ [code] if IsValid(ply) && ply:IsPlayer() then local s = 0 if showAdmins && ply:IsUserGroup("coder", "owner", "admin", "superadmin", "moderator") then surface.SetMaterial(admin) surface.SetDrawColor(color_white) surface.DrawTexturedRect(s + 4, h / 2 - 16, 32, 32) s = s + 32 end [/code] Any suggestions?[/QUOTE] You can't just treat IsUserGroup as a table. You'll have to do [code]if showAdmins && ( ply:IsUserGroup( "coder" ) || ply:IsUserGroup( "owner" ) || ply:IsUserGroup( "moderator" ) || ply:IsAdmin ) then[/code] [editline]17th March 2014[/editline] [QUOTE=crazyscouter;44272637]Well for one, [lua]ply:IsUserGroup("coder", "owner", "admin", "superadmin", "moderator") [/lua] only accepts one argument, which is the string usergroup. So you'll have to separate it into different checks, like so: [lua]if showAdmins && ply:IsUserGroup("coder") || ply:IsUserGroup("owner") || ply:IsUserGroup("admin")[/lua] etc, for the rest of your ranks. Also, are you getting any errors?[/QUOTE] You can just do IsAdmin for admin instead of IsUserGroup("admin"). IsAdmin will also return true for superadmins.
Sorry, you need to Log In to post a reply to this thread.