беда с Custom Player Models

Сообщения
17
Реакции
1
Ошибка
Не работают модели
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5294
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
ReGamedll
ReGameDLL_CS 5.26.0.668
Версия Metamod
Metamod-r 1.3.0.131
Список метамодулей
[ 1] AMX Mod X     RUN   -    amxmodx_mm_i386.so        v1.9.0.5294      ini  Start ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 4] ReSemiclip RUN - resemiclip_mm_i386.so v2.4.3 ini Chlvl ANY
[ 5] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.2 ini Start ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.684 ini Chlvl ANY
[ 7] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[ 8] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[ 9] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[10] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[11] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl1 ANY Never
[13] CSX RUN - csx_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
Список плагинов
[  1] Admin Base              1.9.0.5294  AMXX Dev Team     admin.amxx       running  
[ 2] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5294 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 0.2 Polymorph mapchooser.amxx running
[ 18] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 21] StatsX 1.9.0.5294 AMXX Dev Team statsx.amxx running
[ 22] Polymorph: RockTheVote 1.0 Fysiks poly_rtv.amxx running
[ 23] Polymorph: Mod Manager 1.1.2 Fysiks polymorph.amxx running
[ 24] Reklama 20.05.2020 mx?! reklama.amxx running
[ 25] Admin Prefixes 4.1 m0skVi4a ;] admin_prefixes. running
[ 26] mute menu 1.0 cheap_suit mutemenu.amxx running
[ 27] Parachute for ALL [ReA 3.0 Leo_[BH] parachute_for_a running
[ 28] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 29] VoteBan Menu 1.1 Author + ApXuTek voteban_menu_1. running
[ 30] GameName Changer 1.0 mx?! re_gamename.amx running
[ 31] custom.hpk Control 1.0 Northon customhpk_contr running
[ 32] Team Select 1.6.0 F@nt0M teamselect.amxx running
[ 33] [CSO LIKE] Costumes 1.0 RaZzoR cso_like_costum running
[ 34] Block Radio Commands 1.0 d3m37r4 block_radiocmd. running
[ 35] Block command vote 1.0 6u3oH block_cmd_vote. running
[ 36] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 37] Server Menu [INI] 1.0 Leo_[BH] server_menu.amx running
[ 38] Custom Player Models A 0.2.5 F@nt0M & BlackSi custom_player_m running
[ 39] Custom Player Models C 0.2.2 BlackSignature custom_player_m running
[ 40] Custom Player Models T 0.2.1 BlackSignature custom_player_m running
[ 41] AFK Control 1.0 mx?! afk_control.amx running
[ 42] Back Weapons 1.1 Cheap_Suit backweapons.amx running
[ 43] Team Grenade Trails 1.0.0 fl0wer grenade_trails_ running
[ 44] Knife Duel with Telepo 1.5 neygomon knife_duel_with running
[ 45] Knife Aim 1.0 Chrescoe1 (Next2 next21_knife_ai running
[ 46] C4 Timer 0.1 Lightman bombtimer.amxx running
Автор плагина
BlackSignature
Версия плагина
0.2.5
Исходный код
#include <amxmodx>
#include <fakemeta>
#include <reapi>
#include "include/custom_player_models.inc"

// Support submodels (body). Comment to disable and save some CPU.
#define SUPPORT_BODY

#define CHECK_NATIVE_ARGS_NUM(%1,%2,%3) \
if (%1 < %2) { \
log_error(AMX_ERR_NATIVE, "Invalid num of arguments %d. Expected %d", %1, %2); \
return %3; \
}

#define CHECK_NATIVE_PLAYER(%1,%2) \
if (!is_user_connected(%1)) { \
log_error(AMX_ERR_NATIVE, "Invalid player %d", %1); \
return %2; \
}

enum _:model_s {
MODEL_INDEX_TT,
MODEL_TT[CPM_MAX_MODEL_LENGTH],
MODEL_BODY_TT,
MODEL_INDEX_CT,
MODEL_CT[CPM_MAX_MODEL_LENGTH],
MODEL_BODY_CT
};

enum _:player_s {
bool:PLAYER_HAS_MODEL,
bool:PLAYER_SEE_MODEL,
PLAYER_MODEL_KEY[CPM_MAX_KEY_LENGTH],
PLAYER_MODEL[model_s],
}

new Trie:Models = Invalid_Trie, Model[model_s];
new Players[MAX_PLAYERS + 1][player_s];

new Receiver;

public plugin_natives() {
register_native("custom_player_models_register", "NativeRegister");
register_native("custom_player_models_has", "NativeHas");
register_native("custom_player_models_set", "NativeSet");
register_native("custom_player_models_set_body", "NativeSetBody");
register_native("custom_player_models_get_body", "NativeGetBody");
register_native("custom_player_models_reset", "NativeReset");
register_native("custom_player_models_enable", "NativeEnable");
register_native("custom_player_models_is_enable", "NativeIsEnable");
}

public plugin_precache() {
register_plugin("Custom Player Models API", "0.2.5", "F@nt0M & BlackSignature");

new ret, fwd = CreateMultiForward("custom_player_models_init", ET_IGNORE);
ExecuteForward(fwd, ret);
DestroyForward(fwd);
}

public plugin_init() {
if (Models != Invalid_Trie) {
RegisterHookChain(RH_SV_WriteFullClientUpdate, "SV_WriteFullClientUpdate_Pre", false);
register_forward(FM_AddToFullPack, "AddToFullPack_Post", true);

if(find_plugin_byfile("rt_core.amxx", .ignoreCase = 0) == INVALID_PLUGIN_ID && find_plugin_byfile("revive_teammates.amxx", .ignoreCase = 0) == INVALID_PLUGIN_ID) {
register_message(get_user_msgid("ClCorpse"), "MsgHookClCorpse")
}
else {
log_amx("Plugin 'Revive Teammates' detected, ClCorpse message will not be registered!")
}
}
}

public plugin_end() {
if (Models != Invalid_Trie) {
TrieDestroy(Models);
}
}

public client_connect(id) {
clearPlayer(id);
}

public client_disconnected(id) {
clearPlayer(id);
}

public SV_WriteFullClientUpdate_Pre(const client, const buffer, const receiver) {
if(Receiver && receiver != Receiver) {
return HC_SUPERCEDE;
}

if (Players[receiver][PLAYER_SEE_MODEL] && is_user_connected(client) && Players[client][PLAYER_HAS_MODEL]) {
set_key_value(buffer, "model", "");
}

return HC_CONTINUE;
}

public AddToFullPack_Post(const handle, const e, const ent, const host, const hostflags, const player, const pSet) {
if (!player || !Players[ent][PLAYER_HAS_MODEL] || !Players[host][PLAYER_SEE_MODEL] || !get_orig_retval()) {
return;
}

switch (get_member(ent, m_iTeam)) {
case TEAM_TERRORIST: {
set_es(handle, ES_ModelIndex, Players[ent][PLAYER_MODEL][MODEL_INDEX_TT]);
#if defined SUPPORT_BODY
set_es(handle, ES_Body, Players[ent][PLAYER_MODEL][MODEL_BODY_TT]);
#endif
}

case TEAM_CT: {
set_es(handle, ES_ModelIndex, Players[ent][PLAYER_MODEL][MODEL_INDEX_CT]);
#if defined SUPPORT_BODY
set_es(handle, ES_Body, Players[ent][PLAYER_MODEL][MODEL_BODY_CT]);
#endif
}
}
}

public MsgHookClCorpse() {
enum {
arg_model = 1,
arg_origin_x,
arg_origin_y,
arg_origin_z,
arg_angles_x,
arg_angles_y,
arg_angles_z,
arg_delay,
arg_sequence,
arg_body,
arg_team,
arg_player,
};

new player = get_msg_arg_int(arg_player);
if (!Players[player][PLAYER_HAS_MODEL]) {
return PLUGIN_CONTINUE;
}

new team = get_msg_arg_int(arg_team);

new key;

#if defined SUPPORT_BODY
new custom_body;
#endif

switch (team) {
case TEAM_TERRORIST: {
key = MODEL_TT;
#if defined SUPPORT_BODY
custom_body = Players[player][PLAYER_MODEL][MODEL_BODY_TT];
#endif
}

case TEAM_CT: {
key = MODEL_CT;
#if defined SUPPORT_BODY
custom_body = Players[player][PLAYER_MODEL][MODEL_BODY_CT];
#endif
}

default: {
return PLUGIN_CONTINUE;
}
}

new model[CPM_MAX_MODEL_LENGTH], origin[3], Float:angles[3];
get_msg_arg_string(arg_model, model, charsmax(model));

origin[0] = get_msg_arg_int(arg_origin_x);
origin[1] = get_msg_arg_int(arg_origin_y);
origin[2] = get_msg_arg_int(arg_origin_z);

angles[0] = get_msg_arg_float(arg_angles_x);
angles[1] = get_msg_arg_float(arg_angles_y);
angles[2] = get_msg_arg_float(arg_angles_z);

new delay = get_msg_arg_int(arg_delay);
new sequence = get_msg_arg_int(arg_sequence);

new default_body = get_msg_arg_int(arg_body);

static msgClCorpse;

if(!msgClCorpse) {
msgClCorpse = get_user_msgid("ClCorpse");
}

for (new id = 1; id <= MaxClients; id++) {
if (!is_user_connected(id)) {
continue;
}

message_begin(MSG_ONE, msgClCorpse, .player = id);
if (Players[id][PLAYER_SEE_MODEL]) {
write_string(Players[player][PLAYER_MODEL][key]);
} else {
write_string(model);
}
write_long(origin[0]);
write_long(origin[1]);
write_long(origin[2]);
write_coord_f(angles[0]);
write_coord_f(angles[1]);
write_coord_f(angles[2]);
write_long(delay);
write_byte(sequence);
#if defined SUPPORT_BODY
if (Players[id][PLAYER_SEE_MODEL]) {
write_byte(custom_body);
} else {
write_byte(default_body);
}
#else
write_byte(default_body);
#endif
write_byte(team);
write_byte(player);
message_end();
}

return PLUGIN_HANDLED;
}

public bool:NativeRegister(const plugin, const argc) {
enum { arg_key = 1, arg_model_tt, arg_body_tt, arg_model_ct, arg_body_ct };
CHECK_NATIVE_ARGS_NUM(argc, arg_body_ct, false)

new key[CPM_MAX_KEY_LENGTH];
get_string(arg_key, key, charsmax(key));

if (Models != Invalid_Trie && TrieKeyExists(Models, key)) {
return true;
}

new model[CPM_MAX_MODEL_LENGTH];
get_string(arg_model_tt, model, charsmax(model));

if (!loadModel(model, MODEL_INDEX_TT, MODEL_TT)) {
log_error(AMX_ERR_NATIVE, "Error precache %s", model);
return false;
}

get_string(arg_model_ct, model, charsmax(model));

if (!loadModel(model, MODEL_INDEX_CT, MODEL_CT)) {
log_error(AMX_ERR_NATIVE, "Error precache %s", model);
return false;
}

if (Models == Invalid_Trie) {
Models = TrieCreate();
}

Model[MODEL_BODY_TT] = get_param(arg_body_tt);
Model[MODEL_BODY_CT] = get_param(arg_body_ct);

TrieSetArray(Models, key, Model, sizeof Model);
return true;
}

public bool:NativeHas(const plugin, const argc) {
enum { arg_player = 1, arg_key, arg_length };
CHECK_NATIVE_ARGS_NUM(argc, arg_length, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

if (!Players[player][PLAYER_HAS_MODEL]) {
return false;
}

set_string(arg_key, Players[player][PLAYER_MODEL_KEY], get_param(arg_length));
return true;
}

public bool:NativeSet(const plugin, const argc) {
enum { arg_player = 1, arg_key };
CHECK_NATIVE_ARGS_NUM(argc, arg_key, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

new key[CPM_MAX_KEY_LENGTH];
get_string(arg_key, key, charsmax(key));
if (!TrieGetArray(Models, key, Model, sizeof Model)) {
log_error(AMX_ERR_NATIVE, "Invalid key %s", key);
return false;
}

Players[player][PLAYER_HAS_MODEL] = true;
copy(Players[player][PLAYER_MODEL_KEY], CPM_MAX_KEY_LENGTH - 1, key);
Players[player][PLAYER_MODEL] = Model;
rh_update_user_info(player);
return true;
}

public bool:NativeSetBody(const plugin, const argc) {
enum { arg_player = 1, arg_team, arg_body };
CHECK_NATIVE_ARGS_NUM(argc, arg_body, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

new any:iTeam = get_param(arg_team);

if( !(TEAM_SPECTATOR > iTeam > TEAM_UNASSIGNED) ) {
log_error(AMX_ERR_NATIVE, "Invalid team %d", iTeam);
return false;
}

new body = get_param(arg_body);

new iSetTo = (iTeam == TEAM_TERRORIST) ? MODEL_BODY_TT : MODEL_BODY_CT;

Players[player][PLAYER_MODEL][iSetTo] = body;
return true;
}

public bool:NativeGetBody(const plugin, const argc) {
enum { arg_player = 1, arg_team, arg_body };
CHECK_NATIVE_ARGS_NUM(argc, arg_body, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

new any:iTeam = get_param(arg_team);

if( !(TEAM_SPECTATOR > iTeam > TEAM_UNASSIGNED) ) {
log_error(AMX_ERR_NATIVE, "Invalid team %d", iTeam);
return false;
}

if(!Players[player][PLAYER_HAS_MODEL]) {
return false;
}

new iGetFrom = (iTeam == TEAM_TERRORIST) ? MODEL_BODY_TT : MODEL_BODY_CT;

set_param_byref(arg_body, Players[player][PLAYER_MODEL][iGetFrom]);

return true;
}

public bool:NativeReset(const plugin, const argc) {
enum { arg_player = 1 };
CHECK_NATIVE_ARGS_NUM(argc, arg_player, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

Players[player][PLAYER_HAS_MODEL] = false;
rh_update_user_info(player);
return true;
}

public bool:NativeEnable(const plugin, const argc) {
enum { arg_player = 1, arg_value };
CHECK_NATIVE_ARGS_NUM(argc, arg_value, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

Players[player][PLAYER_SEE_MODEL] = bool:get_param(arg_value);

Receiver = player;

for (new id = 1; id <= MaxClients; id++) {
if (is_user_connected(id) && Players[id][PLAYER_HAS_MODEL] && is_entity(id)) { // is_entity() as botfix
rh_update_user_info(id);
}
}

Receiver = 0;

return true;
}

public bool:NativeIsEnable(const plugin, const argc) {
enum { arg_player = 1 };
CHECK_NATIVE_ARGS_NUM(argc, arg_player, false)

new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)

return Players[player][PLAYER_SEE_MODEL];
}

bool:loadModel(const model[], const key_index, const key_model) {
if (!file_exists(model, true)) {
return false;
}
Model[key_index] = precache_model(model);
copy(Model[key_model], CPM_MAX_MODEL_LENGTH - 1, model);
return true;
}

clearPlayer(const id) {
Players[id][PLAYER_HAS_MODEL] = false;
Players[id][PLAYER_SEE_MODEL] = true;
arrayset(Players[id][PLAYER_MODEL_KEY], 0, CPM_MAX_KEY_LENGTH - 1);
}

// https://github.com/ufame/ReviveTeammates --->

/**
* Called after the creation of the corpse is completed
*
* @param iEnt corpse entity index
* @param id id of the player whose corpse
* @param vOrigin coordinates of the corpse
*
*/
public rt_creating_corpse_end(const iEnt, const id, const vOrigin[3]) {
if(!Players[id][PLAYER_HAS_MODEL] || !is_entity(iEnt)) {
return;
}

switch (get_member(id, m_iTeam)) {
case TEAM_TERRORIST: {
engfunc(EngFunc_SetModel, iEnt, Players[id][PLAYER_MODEL][MODEL_TT]);
#if defined SUPPORT_BODY
set_entvar(iEnt, var_body, Players[id][PLAYER_MODEL][MODEL_BODY_TT]);
#endif
}

case TEAM_CT: {
engfunc(EngFunc_SetModel, iEnt, Players[id][PLAYER_MODEL][MODEL_CT]);
#if defined SUPPORT_BODY
set_entvar(iEnt, var_body, Players[id][PLAYER_MODEL][MODEL_BODY_CT]);
#endif
}
}
}
"latelyjustwannadream" "metamorph" "models/cpm/metamorph.mdl" "0" "models/cpm/metamorph.mdl "0" ""
по примеру "#mx?!" "maximka" "models/cpm/max.mdl" "0" "models/cpm/max.mdl "1" ""
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
855
Реакции
532
Помог
13 раз(а)
Консоль сервера проверяли? Скорее всего модель неверно указали
 
Сообщения
17
Реакции
1
BalbuR,
Error precache models/cpm/metamorph.mdl
менять модельку уже пробовал, путь менять?
26 Май 2024
и путь менял и модель менял
поставил модель которая у меня на 1.8.2 с Player Model by commonbullet работала
и та же ошибка

05/26/2024 - 09:14:48: Error precache models/player/ya/ya.mdl
05/26/2024 - 09:14:48: [AMXX] Displaying debug trace (plugin "custom_player_models_cfg.amxx", version "unknown")
05/26/2024 - 09:14:48: [AMXX] Run time error 10: native error (native "custom_player_models_register")
05/26/2024 - 09:14:48: [AMXX] [0] custom_player_models_cfg.sma::custom_player_models_init (line 69)
 
Сообщения
264
Реакции
132
Помог
13 раз(а)
Ну и ник в конфиге ты неправильно указал :
Код:
; #%name% - For specified nickname. Example: #mx?! will set model for nickname 'mx?!' (w/o quotes)
 
Сообщения
17
Реакции
1
заменил на плагин Custom Models 1.6.1 от
neugomon’a
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу