Ulysses
General => Developers Corner => Topic started by: PaperMoney on July 13, 2015, 05:30:13 PM
-
I want to know how to add icons to chat, like icon16/shield.png next to a players name if they're super admin, admin, or owner (ULX of course)
I know this is part of the code
if ply:IsSuperAdmin() then
icon = "icon16/shield_add.png"
elseif ply:IsAdmin() then
icon = "icon16/shield.png"
elseif ply:IsUserGroup("owner") then
icon = "icon16/shield_rainbow.png"
elseif ply:IsUserGroup("moderator") then
icon = "icon16/shield_silver.png"
elseif ply:IsUserGroup("vip") then
icon = "icon16/rosette_blue.png"
end
end
But what else do i got to add to tell the server that I want certain ulx groups to get icons I select, please help!
-
You need a custom chatbox. Are you at least that far?
-
You need a custom chatbox. Are you at least that far?
Okay, well I am using a custom chat box that works indeed. Now I found this code,
local UserManagement = {
["owner"] = {Icon = "icon16/shield_rainbow.png"},
["superadmin"] = {Icon = "icon16/shield.png"},
["admin"] = {Icon = "icon16/shield_silver.png"},
["vip"] = {Icon = "icon16/rosette_blue.png"}
}
function util.GetUserIcon(ply)
if !ply then return end
local group = ply:GetNWString( "UserGroup" )
local icon = UserManagement[group]
if icon then
return icon.Icon
end
return ""
end
Of course trying this, I got no errors but it did not show the icons next to my name in the chat box. I am very stuck and need help, anyone?
EDIT: Figured it out, just need to make my own chatbox or edit someones to add it all in, gonna have to search around and all. Forget it now, hehe :P