1. Check out the Store if you're looking to Buy HL2RP or other schemas for your server. You can click Buy Schemas on the very top navigation bar to visit the store.
  2. Use the Plugin Center to easily subscribe to and auto-install Clockwork plugins to your server, or submit and share plugins you have developed.
  3. Having trouble setting up or developing with Clockwork? Check out the Wiki or post in the Support Forum for advice from fellow users.
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 Active Member

    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 Damn, okay. Active Member

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

    ○Frix Clockwork Customer Active Member

    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 Active Member

    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 Active Member

    @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 Active Member

    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)