Skip to content

Commit

Permalink
Merge pull request #30 from Giferns/fix-cpm-compatibility
Browse files Browse the repository at this point in the history
Fix cpm compatibility
  • Loading branch information
Giferns authored Sep 11, 2024
2 parents 0a8ac01 + 473ed72 commit 7c24ce2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/amxmodx/scripting/include/rt_api.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#endif
#define _rt_api_included

public stock const VERSION[] = "2.2.11";
public stock const VERSION[] = "2.2.12";
public stock const AUTHORS[] = "DEV-CS.RU Community";

/**
Expand Down
16 changes: 13 additions & 3 deletions addons/amxmodx/scripting/rt_core.sma
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ public stock const CFG_FILE[] = "addons/amxmodx/configs/rt_configs/rt_core.cfg";

// Custom Player Models https://dev-cs.ru/resources/928/
native bool:custom_player_models_get_path(const player, path[] = "", length = 0);
native bool:custom_player_models_get_body(const player, const any:team, &body);
native bool:custom_player_models_get_skin(const player, const any:team, &skin);

enum CVARS {
Float:REVIVE_TIME,
Expand Down Expand Up @@ -325,19 +327,27 @@ public MessageHook_ClCorpse() {
formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szModel, szModel);*/
new szModelPath[MAX_RESOURCE_PATH_LENGTH];

if(!custom_player_models_get_path(iPlayer, szModelPath, charsmax(szModelPath)))
if(!custom_player_models_get_path(iPlayer, szModelPath, charsmax(szModelPath))) {
formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", g_szModel[iPlayer], g_szModel[iPlayer]);
set_entvar(iEnt, var_body, get_msg_arg_int(arg_body));
set_entvar(iEnt, var_skin, get_entvar(iPlayer, var_skin));
}
else {
new iBody, iSkin;
custom_player_models_get_body(iPlayer, iPlTeam, iBody);
custom_player_models_get_skin(iPlayer, iPlTeam, iSkin);
set_entvar(iEnt, var_body, iBody);
set_entvar(iEnt, var_skin, iSkin);
}

set_entvar(iEnt, var_modelindex, engfunc(EngFunc_ModelIndex, szModelPath));
set_entvar(iEnt, var_model, szModelPath);
//set_entvar(iEnt, var_renderfx, kRenderFxDeadPlayer);
//set_entvar(iEnt, var_renderamt, float(iPlayer));

set_entvar(iEnt, var_classname, DEAD_BODY_CLASSNAME);
set_entvar(iEnt, var_body, get_msg_arg_int(arg_body));
set_entvar(iEnt, var_sequence, get_entvar(iPlayer, var_sequence));
set_entvar(iEnt, var_frame, 255.0);
set_entvar(iEnt, var_skin, get_entvar(iPlayer, var_skin));
set_entvar(iEnt, var_owner, iPlayer);
set_entvar(iEnt, var_team, iPlTeam);

Expand Down

0 comments on commit 7c24ce2

Please sign in to comment.