s1lentq / reapi

AMX Mod X module, using API regamedll & rehlds
GNU General Public License v3.0
161 stars 103 forks source link

rg_set_user_model update_index #53

Closed FrictionSource closed 7 years ago

FrictionSource commented 7 years ago
  1. 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.

  2. 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.

FrictionSource commented 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.

WPMGPRoSToTeMa commented 7 years ago

Do you use ReHLDS?

FrictionSource commented 7 years ago

Yes, ReHLDS, pure version on Windows.

WPMGPRoSToTeMa commented 7 years ago

You should use bugfixed, this problem is fixed with it.

FrictionSource commented 7 years ago

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.

theAsmodai commented 7 years ago

Only if it's will be fixed by Valve in the original HLDS.

WPMGPRoSToTeMa commented 7 years ago

This should be fixed in ReGameDLL API.