Skip to content

Main Configuration

samyyc edited this page Jan 27, 2025 · 15 revisions

This page is for the configs in PlayerModelChanger.json. (Except Models part)

Basic Structure

{
  "Models": { // See Models Configuration Wiki for this part
   },
  "StorageType": "sqlite",
  "MySQL_IP": "",
  "MySQL_Port": "",
  "MySQL_User": "",
  "MySQL_Password": "",
  "MySQL_Database": "",
  "MySQL_Table": "playermodelchanger",
  "ModelForBots": {
    "CT": "@random", // for all random models
    "T": ["model_index1", "model_index2"] // for specific random multiple model
  },
  "ModelChangeCooldownSecond": 0,
  "Inspection": {
    "Enable": true,
    "Mode": "rotation"
  },
  "BasicPermission": "",
  "DisableDefaultModelLeg": false,
  "DisableInstantChange": false,
  "DisablePrecache": false,
  "DisableRandomModel": false, 
  "DisableAutoCheck": false,
  "DisablePlayerSelection": false,
  "AutoResyncCache": false,
  "ConfigVersion": 1
}

Configs

Models

See Models Configuration Wiki

StorageType

  • Value: "sqlite" or "mysql"
  • Default: "sqlite"
  • Decide what database to use.
  • If you choose sqlite, the data.db is located at your plugins folder.
  • If you choose mysql, you must fill in MySQL credentials.

MySQL Credentials

  • Optional
  • MySQL_IP, MySQL_Port, MySQL_User, MySQL_Password, MySQL_Database, MySQL_Table must be filled if your StorageType is set to mysql.

ModelChangeCooldownSecond

  • Value Type: float
  • Default: 0
  • Controls the cooldown time (unit: second) for changing models.

Inspection

See example. Two configuration:

  • Enable: Control the inspection feature. Default: true
  • Mode: "rotation" or "thirdperson". Default: "rotation"

NOTICE: Only works if instant change is enabled.

BasicPermission

  • Value Type: string
  • Default: ""
  • The minimal permission requirement for player to change their model or open the menu. Should be a permission flag or a group.

DisableDefaultModelLeg

  • Value: true or false
  • Default: false
  • Control whether vanilla models have model or not.

DisableInstantChange

  • Value: true or false
  • Default: false
  • If set to true, player have to wait for next respawn for the model change.

Warning

In most case, player will have a short immunity time after instantly changing model.

ModelForBots

  • Structure:
    "ModelForBots": {
      "CT": "@random", // for all random models
      "T": ["model_index1", "model_index2"] // for specific random multiple model
    },
    
  • Set the models for bots. model_index is from Models configuration.

DisablePrecache

  • Value: true or false
  • Default: false
  • If your plugin works good, don't change it.
  • This is used to solve a precache problem existed before, but it should have been solved in latest counterstrikesharp.

DisableRandomModel

  • Value: true or false
  • Default: false
  • If you set this to true, then the random model feature will be disabled.

DisableAutoCheck

  • Value: true or false
  • Default: false
  • Don't change it if you don't have any permission problem.
  • If you set this to true, there won't be a permission check before player respawn.

DisablePlayerSelection

  • Value: true or false
  • Default: false
  • Ccontrol whether player can change their model.
  • If it is set to true, commands !md, !model, !models will be disabled.

AutoResyncCache

  • Value: true or false
  • Default: false
  • If you set this to true, the cache will be synchronized from database automatically when player respawn.
  • Will be useful if you are using a external website or program to modify data in database.

Warning

If you are using a remote database, there might be a severe lag. Generally it's not recommended to use a remote database, you can use sqlite instead.