Closed FrictionSource closed 7 years ago
This is causing a lot of random crashes. Only cs_get_user_model is returning correct values.
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <reapi>
public plugin_precache()
{
precache_model("models/player/vip/vip.mdl");
}
public plugin_init()
{
register_concmd("amx_setmodel", "CMD_SETMODEL", ADMIN_ALL);
register_concmd("amx_getmodel", "CMD_GETMODEL", ADMIN_ALL);
}
public CMD_SETMODEL(id)
{
rg_set_user_model(id, "vip", true)
}
public CMD_GETMODEL(id)
{
new SZModelReAPI[64], SZModelFM[64], SZModelCStrike[64];
get_entvar(id, var_model, SZModelReAPI, charsmax(SZModelReAPI));
pev(id, pev_model, SZModelFM, charsmax(SZModelFM));
cs_get_user_model(id, SZModelCStrike, charsmax(SZModelCStrike))
client_print(id, print_chat, "Current Model | ReAPI: %s", SZModelReAPI);
client_print(id, print_chat, "Current Model | FakeMeta: %s", SZModelFM);
client_print(id, print_chat, "Current Model | CStrike: %s", SZModelCStrike);
}
Connect -> Spawn -> Model is Leet -> amx_getmodel ->
Current Model | ReAPI: models/player/terror/terror.mdl. Current Model | FakeMeta: models/player/terror/terror.mdl. Current Model | CStrike: leet.
amx_setmodel -> amx_getmodel ->
Current Model | ReAPI: . Current Model | FakeMeta: . Current Model | CStrike: vip.
Do you use ReHLDS?
Yes, ReHLDS, pure version on Windows.
You should use bugfixed, this problem is fixed with it.
I can confirm the bug doesn't occur in the ReHLDS bugfixed version. However will it be fixed for the pure version? The bugfixed version contains a change that breaks a feature.
Only if it's will be fixed by Valve in the original HLDS.
This should be fixed in ReGameDLL API.
When setting update_index to true rg_set_user_model glitches. It does set the model however internally something is broken or overflowed. If you attempt to get the player model through (var/pev)_model you get random characters and they randomly change.
In the includes rg_reset_user_model does not contain the update_index argument yet the native in natives_misc.cpp seems to support it.