Skip to content

Commit

Permalink
Merge pull request #34 from Giferns/bugfix_variant
Browse files Browse the repository at this point in the history
Add cvar `rt_corpse_model_mode`
  • Loading branch information
Giferns authored Dec 18, 2024
2 parents 8cc5473 + 10fa00d commit d1d5738
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
6 changes: 5 additions & 1 deletion addons/amxmodx/configs/rt_configs/rt_core.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ rt_search_radius "64.0"
// Default: "0"
// Minimum: "0"
// Maximum: "1"
rt_force_fwd_mode "0"
rt_force_fwd_mode "0"

// Попробуйте установить 1, если трупы теряют нестандартную модель.
// Try set this to 1 if corpses lose their custom model.
rt_corpse_model_mode "0"
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.3.15";
public stock const VERSION[] = "2.3.16";
public stock const AUTHORS[] = "DEV-CS.RU Community";

/**
Expand Down
24 changes: 22 additions & 2 deletions addons/amxmodx/scripting/rt_core.sma
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ enum CVARS {
Float:ANTIFLOOD_TIME,
Float:CORPSE_TIME,
Float:SEARCH_RADIUS,
FORCE_FWD_MODE
FORCE_FWD_MODE,
CORPSE_MODEL_MODE
};

new g_eCvars[CVARS];
Expand Down Expand Up @@ -347,7 +348,15 @@ public MessageHook_ClCorpse() {
new szModelPath[MAX_RESOURCE_PATH_LENGTH];

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]);
if(!g_eCvars[CORPSE_MODEL_MODE]) {
formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", g_szModel[iPlayer], g_szModel[iPlayer]);
}
else {
new szModel[64];
rh_update_user_info(iPlayer);
get_user_info(iPlayer, "model", szModel, charsmax(szModel));
formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szModel, szModel);
}
set_entvar(iEnt, var_body, get_msg_arg_int(arg_body));
set_entvar(iEnt, var_skin, get_entvar(iPlayer, var_skin));
}
Expand Down Expand Up @@ -459,6 +468,17 @@ public CreateCvars() {
1.0),
g_eCvars[FORCE_FWD_MODE]
);
bind_pcvar_num(create_cvar(
"rt_corpse_model_mode",
"0",
FCVAR_NONE,
"Try set this to 1 if corpses lose their custom model.",
true,
0.0,
true,
1.0),
g_eCvars[CORPSE_MODEL_MODE]
);
}

/**
Expand Down

0 comments on commit d1d5738

Please sign in to comment.