Skip to content

Default Model Configuration (Optional)

samyyc edited this page Jul 26, 2024 · 3 revisions

Default Model Configuration

Preparation

  1. create a DefaultModels.json in the addons/counterstrikesharp/configs/plugins/PlayerModelChanger/ dir.
  2. copy the basic structure into it

Basic structure

{
    "DefaultModels": {
        "all": {
        },
        "t": {
        },
        "ct": {
        }
    }
}

Player Selector

there are 4 types of player selector:

  • * for all player
  • #permission/group for all player in a permission group
  • @permission/flag for all player with a permission flag
  • 76561199XXXX for a certain player with SteamID64

Overwrite priority: steamid > perm flag > perm group > *

DefaultModels configuration

There are three section below it: all, t and ct, all of them are optional, if t and ct config conflicts with the all config, it will overwrite it.

The model config have a priority, order: steamid > perm flag > perm group > *

Content

The key of each row is a Player Selector, and the value is:

{
    "index": "model index",
    "force": true
}

If force is set to true, then the selected player can't change their model, default is false

example: In this example, the steamid "76561199XXXX" player will be force to have model4, other players will not be forced

"all": {
    "*": {
        "index": "model1"
    }
    "#permission/group": {
        "index": "model2"
    }
    "@permission/flag": {
        "index": "model3"
    }
    "76561199XXXX": {
        "index": "model4",
        "force": true
    }
},
"t": {
    "*": {
        "index": "model5"
    } // overwrite the "*" config in "all"
}