• Scoreboard help plesss
    6 replies, posted
[CODE]local Columns = {} Columns[1] = {name="Name", command=function(self, arg) return tostring(arg:Name()) end} Columns[2] = {name="Rank", command=function(self, arg) return tostring(arg:ply:IsUserGroup("superadmin") then surface.SetImage( "gui/silkicons/star")) end} Columns[3] = {name="Level", command=function(self, arg) return tostring(arg:GetLevel()) end} Columns[4] = {name="Deaths", command=function(self, arg) return tostring(arg:Deaths()) end} Columns[5] = {name="Ping", command=function(self, arg) return tostring(arg:Ping()) end} [/CODE] Can some 1 fixe it for me and also tell me if the player is not admin Exe donator sets it to a other icon
It's hard to fix something that isn't actually testable... could you post whatever code you're actually using the Columns table in?
t
[QUOTE=gaminghunters;50400926]-code-[/QUOTE] Instead of doing this: [CODE]Columns[2] = {name="Rank", command=function(self, arg) return tostring(arg:ply:IsUserGroup("superadmin") then surface.SetImage( "gui/silkicons/star")) end}[/CODE] You could use an 'either' kind of statement like this: [CODE]Columns[2] = {name="Rank", command=function(self, arg) return arg:ply:IsUserGroup("superadmin") and surface.SetImage( "gui/silkicons/star") or surface.SetImage( "gui/silkicons/some_other_icon") end}[/CODE] [editline]27th May 2016[/editline] Not sure if that'd work though [editline]27th May 2016[/editline] If it doesn't work, try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/Either]Either[/url] instead (even though it's technically the same thing, it might make more sense)
[QUOTE=MPan1;50400939]Instead of doing this: [CODE]Columns[2] = {name="Rank", command=function(self, arg) return tostring(arg:ply:IsUserGroup("superadmin") then surface.SetImage( "gui/silkicons/star")) end}[/CODE] You could use an 'either' kind of statement like this: [CODE]Columns[2] = {name="Rank", command=function(self, arg) return arg:ply:IsUserGroup("superadmin") and surface.SetImage( "gui/silkicons/star") or surface.SetImage( "gui/silkicons/some_other_icon") end}[/CODE] [editline]27th May 2016[/editline] Not sure if that'd work though [editline]27th May 2016[/editline] If it doesn't work, try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/Either]Either[/url] instead (even though it's technically the same thing, it might make more sense)[/QUOTE] [ERROR] gamemodes/underdone/gamemode/core/clientfiles/cl_scoreboard.lua:34: attempt to call field 'SetImage' (a nil value) 1. command - gamemodes/underdone/gamemode/core/clientfiles/cl_scoreboard.lua:34 2. unknown - gamemodes/underdone/gamemode/core/clientfiles/cl_scoreboard.lua:119
Try doing [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/surface/SetMaterial]surface.SetMaterial[/url] instead surface.SetImage doesn't exist
[CODE]Columns[2] = {name="Rank", command=function(self, arg) return tostring(arg:IsUserGroup("superadmin") and surface.SetMaterial(Material( "icon16/palette.png" ))) end}[/CODE] [T]http://i.imgur.com/AZE03e4.png[/T]
Sorry, you need to Log In to post a reply to this thread.