Custom Player Models

amxx reapi Custom Player Models 11.09.2024-01

Нет прав для скачивания
Установка
  1. Разместите файлы из архива на сервере согласно иерархии архива
  2. Произведите настройки в конфиге custom_player_models.ini
  3. Скомпилируйте плагины (инструкция).
  4. Переместите скомпилированные плагины в директорию /amxmodx/plugins/
Настройки
Поддержка субмоделей, custom_player_models_api.sma
Внимание! SUPPORT_BODY может вызывать проблему с отображением бомбы/дефузера на игроке (игра со сценарием 'бомба')

Код:
// Support submodels (body). Comment to disable and save some CPU.
#define SUPPORT_BODY
Поддержка скинов, custom_player_models_api.sma
Внимание! В данный момент SUPPORT_SKIN не поддерживается на трупах игроков, т.е. у трупов скин всегда 0. Если вы используете SUPPORT_SKIN, и не используете совместимый плагин Revive Teammates (rt_core.amxx или revive_teammates.amxx), рекомендуется установить квар cpm_no_corpses в значение 1).

Код:
// Support skins (skin). Comment to disable and save some CPU.
#define SUPPORT_SKIN
Поддержка автоконфига, custom_player_models_api.sma
Код:
// Autoconfig filename in 'amxmodx/configs/plugins', excluding the .cfg extension.
// Comment to disable autoconfig.
#define CONFIG_FILENAME "custom_player_models"
Автоконфиг amxmodx/configs/plugins/custom_player_models.cfg (создаётся при первом запуске)
Код:
// Set to 1 to disable corpses
// -
// Default: "0"
cpm_no_corpses "0"
Команды переключения видимости моделей, custom_player_models_toggle.sma:
Код:
new const CLCMDS[][] = {
    "say /models",
    "say_team /models"
};
custom_player_models.ini:
Код:
; 'Custom Player Models CFG' plugin configuration file
;
; Format: "access" "key" "tt_model" "tt_body" "tt_skin" "ct_model" "ct_body" "ct_skin" "expiration_time"
; Access can be:
; #%name% - For specified nickname. Example: #mx?! will set model for nickname 'mx?!' (w/o quotes)
; STEAM_... or VALVE_... or BOT for access by authid
; @ - For steam players
; * - For all
; Any other string - access flags ('any of' requirement)
;
; You can use empty access for external purpose (setting models by native from other plugins)
; Key MUST be unique for every row!
; 'Body' means submodel. Just set it to "0" if not sure.
; 'Skin' means skin. Just set it to "0" if not sure.
; You can view model submodels/skin using 'Paranoia 2 Model Viewer'
; Note that auth by nickname is not password protected. Use auth by nickname+password in your admin loader.
; Use format '%d.%m.%Y %H:%M' for expiration time, or set it to "" to disable it.
;
; Note that comparing will work until first match, so rows with higher priority should be placed first (see example)
;
; Examples:
; "#mx?!" "maximka" "models/cpm/max.mdl" "0" "0" "models/cpm/max.mdl "1" "0" ""
; "STEAM_0:0:1234567" "splinter" "models/cpm/splinter_tt.mdl" "0" "0" "models/cpm/splinter_ct.mdl" "0" "0" ""
; "abcd" "krang" "models/cpm/krang_tt.mdl" "0" "0" "models/cpm/krang_ct.mdl" "0" "0" ""
; "@" "shreder" "models/cpm/shreder_tt.mdl" "0" "0" "models/cpm/shreder_ct.mdl" "0" "0" "20.04.2025"
; "*" "ninja_turtle" "models/cpm/ninja_turtle_tt.mdl" "0" "0" "models/cpm/ninja_turtle_ct.mdl" "0" "0" "20.04.2025 13:00"
API
Код:
#if defined _custom_player_models_included
    #endinput
#endif

#define _custom_player_models_included

#define CPM_MAX_KEY_LENGTH 32
#define CPM_MAX_MODEL_LENGTH 64

forward custom_player_models_init();

native bool:custom_player_models_register(const key[], const model_tt[], const body_tt, const skin_tt, const model_ct[], const body_ct, const skin_ct);
native bool:custom_player_models_has(const player, key[] = "", length = 0);
native bool:custom_player_models_set(const player, const key[]);
native bool:custom_player_models_set_body(const player, const any:team, const body);
native bool:custom_player_models_get_body(const player, const any:team, &body);
native bool:custom_player_models_set_skin(const player, const any:team, const skin);
native bool:custom_player_models_get_skin(const player, const any:team, &skin);
native bool:custom_player_models_reset(const player);
native bool:custom_player_models_enable(const player, const bool:value);
native bool:custom_player_models_is_enable(const player);
native bool:custom_player_models_get_path(const player, path[] = "", length = 0);
Сверху Снизу