1. Post #1
    Justin37111's Avatar
    July 2008
    263 Posts
    I got this, I want people to make the SuperAdministrator tag flash. Flash blue to be exact, I set the color but I can't figure out how to make it flash, can you please help me.

    local function OnPlayerChat( pl, text )  
          
        if( !pl:IsSuperAdmin( ) ) then return; end  
          
        local clr = team.GetColor( pl:Team( ) );  
        chat.AddText( clr, pl:Name( ), clr, " (Owner)", color_blue, ": "..text );  
          
        return true;  
          
    end  
    hook.Add( "OnPlayerChat", "AddSuperTag", OnPlayerChat );
    

    Then for the Admin one I need to work I got

    local function OnPlayerChat( pl, text )  
          
        if( !pl:IsAdmin( ) ) then return; end  
          
        local clr = team.GetColor( pl:Team( ) );  
        chat.AddText( clr, pl:Name( ), clr, " (Admin)", color_red, ": "..text );  
          
        return true;  
          
    end  
    hook.Add( "OnPlayerChat", "AddOwnerTag", OnPlayerChat );
    

    If someone could help that would be great, thanks.

    --Edit-- I don't want it to flash but Fade in and out on a moderator scale, like how you see in Darkland.

  2. Post #2
    Emz
    Gold Member
    Emz's Avatar
    October 2008
    2,318 Posts
    Manipulate the alpha channel of the colour on a sine wave and it will pulsate in and out.

    I'm sorry but not reading the code because it needs Lua tags, right now it is too messy for anyone to want to read it.

  3. Post #3
    Justin37111's Avatar
    July 2008
    263 Posts
    I am new, don't understand, need a little bit more explained. I am not asking you to, but if you could help a bit more.

  4. Post #4
    Retirsch's Avatar
    July 2009
    182 Posts
    I am new, don't understand, need a little bit more explained. I am not asking you to, but if you could help a bit more.
    math.sin

    Will normally be between 1 and 0 - so do math.sin(number) * 255

  5. Post #5
    Justin37111's Avatar
    July 2008
    263 Posts
    Still need help, like I said I haven't been doing it for long.

    Edited:

    I need the math.sin explained a bit more, I will check gmod wiki too.