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!

HL2RP Making some clothing Faction restricted.

Discussion in 'Development' started by ○Frix, Jan 7, 2019.

  1. ○Frix

    ○Frix Clockwork Customer

    Howdy folks, me and my couple of friends are creating a new HL2RP server, i'm the main developer of the server, and what i wanted to ask was, is there any way or is it even possible, to make certain clothing certain Factions only?

    Say i have a "Cloth Clothing" clothing item, and i would want it to be Vortigaunt faction only, so that any other factions can't use it, to prevent item transfers and exploiting/minging.

    Thank you for your attention.
     
  2. Aspect

    Aspect =) Legend Clockwork Customer

    Code:
    player:GetFaction()
    
     
    • Disagree Disagree x 1
    • Funny Funny x 1
  3. ○Frix

    ○Frix Clockwork Customer

    Got some help by a great folk called Vortix, much appreciation for your time bud
     
    • Friendly Friendly x 1
  4. Viz

    Viz Legend Clockwork Customer

    For anyone else needing help, adding this to your item file should work:
    Code:
    ITEM.whitelist = {"Vortigaunt"};
    Vortigaunt being the name defined in the faction file.
     
    • Like Like x 2
  5. ○Frix

    ○Frix Clockwork Customer

    @Viz
    I got this working by using this
    Code:
    function ITEM:CanPlayerWear(player, itemEntity)
        if (player:GetFaction() == FACTION_CITIZEN) then
        return true;
    else
        Clockwork.player:Notify(player, "You can't wear this!");
            return false;
    end;
    end;
     
  6. Viz

    Viz Legend Clockwork Customer

    That will also work, but ITEM.whitelist is something defined in the clothes base which will do the same thing without any extra code.
     

Previous Readers (Total: 0)