1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Faction hidden on scoreboard?

Discussion in 'Discussion' started by bender971, Jun 19, 2013.

  1. bender971

    bender971 condescending, self important teenage boy

    I'm making a special admin whitelist so admins can get on a character with bright baby blue name, but I don't want to faction to show up on the scoreboard
     
  2. bender971

    bender971 condescending, self important teenage boy

    Sorry, here's the code.


    Code:
    --[[
    	? 2013 CloudSixteen.com do not share, re-distribute or modify
    	without permission of its author ([email protected]).
    --]]
    
    local CLASS = Clockwork.class:New("Moderator");
    	CLASS.color = Color(0, 255, 255, 255);
    	CLASS.wages = 1000;
    	CLASS.factions = {FACTION_AOD};
    	CLASS.isDefault = true;
    	CLASS.wagesName = "Allowance";
    	CLASS.description = "An admin on duty.";
    	CLASS.defaultPhysDesc = "An admin on duty.";
    CLASS_ADMIN = CLASS:Register();
     
  3. CLASS_ADMIN is assigned to the Administrator faction in HL2 RP, so if you're using HL2RP it should not be that.

    And you need to use

    Code:
    Clockwork:PlayerShouldShowOnScoreboard(player)
    and use some if statements to check if their faction or class or whatever is a certain thing.

    Code:
    function PLUGIN:PlayerShouldShowOnScoreboard(player)
       if(player:GetFaction() == FACTION_WHATEVER) then
           return false;
       else
           return true;
       end;
    end;
     
  4. kurozael

    kurozael Cloud Sixteen Director Staff Member Administrator Investor

    This is absolutely correct. The only thing is that it returns true by default. In hooks, you should only return a value if it is not the same as the default return. So here, you should only return false if they are the faction to be hidden, but not return true otherwise. This allows other plugins to get a say, too.

    So:

    Code:
    function PLUGIN:PlayerShouldShowOnScoreboard(player)
       if(player:GetFaction() == FACTION_WHATEVER) then
           return false;
       end;
    end;
    
     
  5. bender971

    bender971 condescending, self important teenage boy

    So do I just put

    Code:
    function PLUGIN:PlayerShouldShowOnScoreboard(player)
       if(player:GetFaction() == FACTION_WHATEVER) then
           return false;
       end;
    end;
     
    below the faction code?
     
  6. sants1

    sants1 I'm an asshole. That's all.

    See the FACTION_WHATEVER ? Set that to whatever the factions FACTION_SOMETHING is
     

Previous Readers (Total: 0)