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 How can i make model choose for MPF? [Solved]

Discussion in 'Development' started by TheSijay, Mar 23, 2018.

  1. TheSijay

    TheSijay Clockwork Customer

    Hello, i wonder how to make model choosing for MPF when creating character.(like in the citizen faction)

    I have tried to do this in sh_mpf.lua but it doesn't work. There are no errors in console. And i'm using HL2RP 1.2
    Code:
    local FACTION = Clockwork.faction:New("Metropolice");
    
    FACTION.isCombineFaction = true;
    FACTION.whitelist = true;
    FACTION.material = "hl2rp2/factions/mpf";
    FACTION.models = {
      female = {
      "models/hl2rp/metropolice/hl2_femalecp5.mdl",
      "models/hl2rp/metropolice/hl2_femalecp3.mdl",
      "models/hl2rp/metropolice/hl2_femalecp4.mdl"
    
    },
    
      male = {
      "models/hl2rp/metropolice/hl2_malecp2.mdl",
      "models/hl2rp/metropolice/hl2_malecp7.mdl",
      "models/hl2rp/metropolice/hl2_elitmalecp8.mdl"
    };
    };
    Any help? Thank you
     
  2. Aspect

    Aspect =) Legend Clockwork Customer

    Remove the semicolon from the last bracket.
     
  3. TheSijay

    TheSijay Clockwork Customer

    It doesn't work. Models not appeared and it is like in the past - no model choosing for mpf
     
  4. Aspect

    Aspect =) Legend Clockwork Customer

    That's what @RJ told me to do to fix mine. Didn't try it out to see. ¯\_(ツ)_/¯
     
  5. RJ

    RJ no pay Legend Clockwork Customer

    The 2nd last semi colon is supposed to be removed, not the very last one. ;)
     
  6. Aspect

    Aspect =) Legend Clockwork Customer

    O h
     
  7. RJ

    RJ no pay Legend Clockwork Customer

    Actually, I don't think removing that semi-colon would make a difference. I checked the Administrator faction in HL2RP and that file is using the semi-colon like you are @TheSijay.

    If you want player's to choose their MPF model, remove this from the MPF faction file:
    Code:
    -- Called when a player's model should be assigned for the faction.
    function FACTION:GetModel(player, character)
        if (character.gender == GENDER_MALE) then
            return self.models.male[1];
        else
            return self.models.female[1];
        end;
    end;
    That function assigns the player's model to the 1st index in the models table, so "models/police.mdl" respectively.
     
    • Good Coder Good Coder x 1
  8. TheSijay

    TheSijay Clockwork Customer

    That works! Thank you very much,you saved my life.
     
    • Like Like x 1
    • Agree Agree x 1

Previous Readers (Total: 0)