View Single Post
Forgetest
Member
Join Date: Aug 2020
Old 01-26-2022 , 15:01   Re: [L4D]Unlock screen freeze
Reply With Quote #10

I think it's not really needed to check the map, since every point_viewcontrol, point_deathfall_camera consistently raise view-locks on spectators in L4D1.
Moreover, this issue also happens on campaign intros according to Harry, so you might have to add more maps or make the deletion applied every map. (then better via Stripper)

I've updated the plugin linked above, which doesn't delete the entities and should take care of all intros / deathfall cameras. The following function can be used to reset players' views.

PHP Code:
// Hud Element hiding flags
#define HIDEHUD_WEAPONSELECTION     (1 << 0)    // Hide ammo count & weapon selection
#define HIDEHUD_FLASHLIGHT          (1 << 1)
#define HIDEHUD_ALL                 (1 << 2)
#define HIDEHUD_HEALTH              (1 << 3)    // Hide health & armor / suit battery
#define HIDEHUD_PLAYERDEAD          (1 << 4)    // Hide when local player's dead
#define HIDEHUD_NEEDSUIT            (1 << 5)    // Hide when the local player doesn't have the HEV suit
#define HIDEHUD_MISCSTATUS          (1 << 6)    // Hide miscellaneous status elements (trains, pickup history, death notices, etc)
#define HIDEHUD_CHAT                (1 << 7)    // Hide all communication elements (saytext, voice icon, etc)
#define HIDEHUD_CROSSHAIR           (1 << 8)    // Hide crosshairs
#define HIDEHUD_VEHICLE_CROSSHAIR   (1 << 9)    // Hide vehicle crosshair
#define HIDEHUD_INVEHICLE           (1 << 10)
#define HIDEHUD_BONUS_PROGRESS      (1 << 11)    // Hide bonus progress display (for bonus map challenges)
stock void ReleaseFromViewControl(int userid 0int client 0)
{
    if (
useridclient GetClientOfUserId(userid);
    if (!
client) return;
    
    
int flags GetEntityFlags(client);
    
SetEntityFlags(clientflags & ~FL_FROZEN); // CBasePlayer::EnableControl
    
SetEntData(clientm_bShowViewModel11); // not provided by sourcemod
    
SetViewEntity(client, -1); // SDKCall method
    
    // normally 2048 for all players, 2048 + 8 for all spectators.
    
if (GetClientTeam(client) == 1// flags 3961 if in deathfall cam
        
SetEntProp(clientProp_Send"m_iHideHUD"HIDEHUD_BONUS_PROGRESS HIDEHUD_HEALTH);
    else
        
SetEntProp(clientProp_Send"m_iHideHUD"HIDEHUD_BONUS_PROGRESS);


Last edited by Forgetest; 01-26-2022 at 15:03.
Forgetest is offline