halflife icon indicating copy to clipboard operation
halflife copied to clipboard

[BUG] Regain all weapons via "fullupdate" command

Open MPNumB opened this issue 13 years ago • 5 comments

At some maps like awp_india, cs_deagle5, scoutzknivez, ect... you spawn with specific set of weapons. After some time you can run out of bullets, and should use knife or find other weapons.

But not many know that you can type in console "fullupdate" command, and if server doesn't block it, than your entire weapon-list is refreshed. You are striped from all the weapons, and then all weapons are re-given to you with predefined ammo, as if you just respawned.

Note: I do not recommend blocking "fullupdate" command, since it is needed for demo recording. Just fix the weapon re-give.

MPNumB avatar Feb 17 '13 10:02 MPNumB

The problem is that game_playerspawn target is fired at the wrong place, it should be fired on player spawn, not HUD init. Here's the part of code in HLSDK that is responsible for this.

void CBasePlayer :: UpdateClientData( void )
{
    if (m_fInitHUD)
    {
        // [ ... ]

        FireTargets( "game_playerspawn", this, this, USE_TOGGLE, 0 );

        // [ ... ]
    }

    // [ ... ]
}

xPaw avatar Feb 17 '13 10:02 xPaw

i confirm it, sometimes you can even crash server.

hotactions avatar Feb 17 '13 16:02 hotactions

Changing this will break demos (because they will no longer get that event) and may have other unintended side effects.

alfred-valve avatar Feb 19 '13 02:02 alfred-valve

Well, just made an amxmodx plugin what fixes this glitch. All works fine - no problems. http://forums.alliedmods.net/showthread.php?t=209418

MPNumB avatar Feb 25 '13 12:02 MPNumB

@alfred-valve I think you are wrong. FireTargets sends no information to client, therefore it can't break demos. This function just finds all entities with same targetname and activates them. I still believe this FireTargets line should be moved to player's Spawn function.

In fact, plugin above proves that blocking this behavior doesn't break demos.

xPaw avatar Feb 25 '13 12:02 xPaw