ULX

Author Topic: Above Head Staff Tags  (Read 1520 times)

0 Members and 1 Guest are viewing this topic.

Offline Rain

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Above Head Staff Tags
« on: July 06, 2017, 08:26:28 AM »
So i've got this set for above head tags in the darkrp cl_hud.


    group = self:GetNWString("usergroup")

        draw.SimpleText(group,  "DarkRPHUD2", pos.x + 80, pos.y - 26, Color( 0, 140, 210, 255 ) )   


It shows tags but it shows all rank tags and i've been trying to figure out how to make it only show if the player is Moderator, Admin etc, but most commands like _p and ply dont work any help would be great TIA.   

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Above Head Staff Tags
« Reply #1 on: July 06, 2017, 07:57:16 PM »
I've no idea how your coding skills are, but, my suggestions in pseudo code/logic; YOU turn it into real code

Use a table to store groups you want, then an if statement to check the table and if matched, draw.

my_groups_I_want_to_see = { "moderator", "admin" }
group = self:GetNWString("usergroup")
if table.HasValue( my_groups_I_want_to_see, group ) then draw.SimpleText(group,  "DarkRPHUD2", pos.x + 80, pos.y - 26, Color( 0, 140, 210, 255 ) )   

(table.HasValue is not really efficient for frame by frame drawing like this likely does..you find the faster methods)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Rain

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Above Head Staff Tags
« Reply #2 on: July 07, 2017, 09:19:16 AM »
oh that would do the trick, thank you heaps!