Arkshine / AdminFreeLook

AMX Mod X module
GNU General Public License v2.0
10 stars 2 forks source link

Doesn't change the player after being killed by enemy #10

Closed 9iky6 closed 8 years ago

9iky6 commented 8 years ago

Doesn't change the player after death. The problem is in this place:

float CVarGetFloat(const char* cvarName)

The error occurs due to stop call.

RETURN_META_VALUE(result, 0);

Tried to rebuild the module returning MRES_OVERRIDE, but the problem still remained. Without stopping the call, it switches to another player even if the player is an administrator.

Please give me some advice where to look or I think about how you can solve this problem. P.S. Sorry I use a translator, I very bad know English language

9iky6 commented 8 years ago

As I understand it the idea is due to stop calling does not work here is the code:

if (m_hObserverTarget)
{
    CBasePlayer *pEnt = (CBasePlayer *)((CBaseEntity *)m_hObserverTarget);

    if (pEnt == this || !pEnt || pEnt->has_disconnected || pEnt->IsObserver() || (pEnt->pev->effects & EF_NODRAW) || (forcecamera != FORCECAMERA_SPECTATE_ANYONE && pEnt->m_iTeam != m_iTeam))
        m_hObserverTarget = NULL;
}

pev->iuser1 = iMode;

if (iMode != OBS_ROAMING)
{
    if (m_hObserverTarget == NULL)
    {
        Observer_FindNextPlayer(false);

        if (m_hObserverTarget == NULL)
        {
            ClientPrint(pev, HUD_PRINTCENTER, "#Spec_NoTarget");
            pev->iuser1 = OBS_ROAMING;
        }
    }
}
Arkshine commented 8 years ago

I don't really understand what issue you have.

You should give your configuration and elaborate step by step how to reproduce the issue.

9iky6 commented 8 years ago

Video?

9iky6 commented 8 years ago

Doesn't change the player after death. My team != target team!

Configurate: hlds 6153 Metamod-P (mm-p) v37 AMX Mod X 1.8.3-dev+4892

mp_forcecamera "2" mp_forcechasecam "2" amx_adminfreelook "1" amx_adminfreelookflag "cd" amx_adminfreelookmode "ad"

Video demonstracion: https://youtu.be/SssapXHr0Ww

Arkshine commented 8 years ago

Are you saying that you are not an admin in the video, and since mp_forcecamera is set to 2, you should only spectate your own team?

9iky6 commented 8 years ago

Yes, right

Arkshine commented 8 years ago

Alright, then there is a bug. Will try to check my shitty module code and CS as well.

Arkshine commented 8 years ago

Can you try 1.5.5 ? https://github.com/Arkshine/AdminFreeLook/releases/tag/1.5.5

I've tested it under windows, it works for me. Did not tested all possibilities though. So, don't hesitate to test.

Important note: cvar names have been changed, check README

9iky6 commented 8 years ago

linux

Admin Free Look RUN - adminfreelook_am v1.5.5-p pl3 ANY ANY

afl_enabled 1 afl_admin_access_flags a afl_user_override_mode bd

Everything works fine, many thanks