Raised This Month: $12 Target: $400
 3% 

[L4D]Unlock screen freeze


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ZBzibing
Senior Member
Join Date: Dec 2012
Plugin ID:
7882
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Audience view freeze unlock
    Old 12-15-2021 , 15:56   [L4D]Unlock screen freeze
    Reply With Quote #1

    I am really excited. This is my first plugin. To be honest, I don’t understand the program at all. I just want to try to complete it after reading countless works on the forum. If there are any bugs, I may not be able to fix it, I hope someone Can improve it on this basis.

    Title:
    Unlock screen freeze

    Description
    After the rescue was initiated, all players failed. When restarting, the perspective of the bystander was permanently frozen.This is an official bug that has existed for more than ten years. Especially on 4+ servers, many bystanders have this trouble

    BUG request
    https://forums.alliedmods.net/showthread.php?t=335392

    CVAR/Command list
    "l4d_REC_Swich", "1" "Plug-in switch.0ff 1n"

    Changelog

    Maps with known bugs
    Code:
    l4d_hospital04_interior
    l4d_hospital05_rooftop
    l4d_smalltown05_houseboat
    l4d_airport05_runway
    l4d_farm01_hilltop
    l4d_farm05_cornfield
    Stripper:source is a very great program. Without it to test the success of this method, I would not consider it, and take the first step in writing a plug-in program. Why can't the forum create a zone for stripper:source, because there are many more Features are waiting for mining and sharing of some scripts. I hope that the community administrators can provide support.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_freezesrceen unlock.sp - 293 views - 2.1 KB)
    File Type: smx l4d_freezesrceen unlock.smx (3.9 KB, 136 views)
    __________________
    Please forgive, If I'm not describing it accurately. I use google translate
    Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:

    Last edited by ZBzibing; 12-15-2021 at 16:11.
    ZBzibing is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 12-15-2021 , 18:50   Re: [L4D]Unlock screen freeze
    Reply With Quote #2

    Congrats on your first plugin!

    Some notes:
    - SMX not required in first post since it compiles fine on the forum.
    - Using old syntax, suggest converting to new and learning that instead.
    - You can put "#pragma newdecls required" at the top of the source to require new syntax.
    - StrContains is inefficient for something like this, better to use strcmp or strncmp. For example:
    PHP Code:
    if ( ( strncmp(Removeview"point_viewcontrol"17)) == || strcmp(Removeview"point_deathfall_camera") == 
    You have various warnings when compiling, for example: "FCVAR_PLUGIN" is marked as deprecated.
    - Delete the "FCVAR_PLUGIN" parts.

    Also the warning: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable instead.
    - So switch GetMaxClients() with MaxClients as the warning says.
    - When you do that change the for loop to start from "MaxClients + 1".

    - It might be faster to use "FindEntityByClassname" for "point_viewcontrol*" and "point_deathfall_camera" instead of looping every entity. Would have to benchmark and test but I heard this is faster than looping all ents.


    Edit: I think it's possible to fix this issue without deleting the entity or completely removing the effect. I'll have a look in a few days when I have time.
    __________________

    Last edited by Silvers; 12-17-2021 at 03:34.
    Silvers is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 12-16-2021 , 13:31   Re: [L4D]Unlock screen freeze
    Reply With Quote #3

    Quote:
    Originally Posted by Silvers View Post
    Congrats on your first plugin!

    Some notes:
    - SMX not required in first post since it compiles fine on the forum.
    - Using old syntax, suggest converting to new and learning that instead.
    - You can put "#pragma newdecls required" at the top of the source to require new syntax.
    - StrContains is inefficient for something like this, better to use strcmp or strncmp. For example:
    PHP Code:
    if ( ( strncmp(Removeview"point_viewcontrol"17)) == || strcmp(Removeview"point_deathfall_camera") == 
    You have various warnings when compiling, for example: "FCVAR_PLUGIN" is marked as deprecated.
    - Delete the "FCVAR_PLUGIN" parts.

    Also the warning: symbol "GetMaxClients" is marked as deprecated: Use MaxClients variable instead.
    - So switch GetMaxClients() with MaxClients as the warning says.
    - When you do that change the for loop to start from "MaxClients + 1".

    - It might be faster to use "FindEntityByClassname" for "point_viewcontrol*" and "point_deathfall_camera" instead of looping every entity. Would have to benchmark and test but I heard this is faster than looping all ents.
    Thank you for your congratulations. Unfortunately, I still don’t have the ability to solve these problems you told me. I don’t understand some of them, and I have found some problems again, but I don’t know any way to delete hammerid, if I Understand this method, I can control the screen freezing problem more accurately
    __________________
    Please forgive, If I'm not describing it accurately. I use google translate
    Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
    ZBzibing is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 12-16-2021 , 14:32   Re: [L4D]Unlock screen freeze
    Reply With Quote #4

    This bug also happens in l4d2. I will test it,
    if your code works, I should add to my l4dinfectedbots.


    Good job
    __________________
    HarryPotter is offline
    AK978
    Senior Member
    Join Date: Jun 2018
    Old 12-17-2021 , 05:50   Re: [L4D]Unlock screen freeze
    Reply With Quote #5

    l4d2 version.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_freezesrceen_unlock.sp - 187 views - 2.3 KB)

    Last edited by AK978; 12-18-2021 at 21:41.
    AK978 is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 12-18-2021 , 12:57   Re: [L4D]Unlock screen freeze
    Reply With Quote #6

    Quote:
    Originally Posted by HarryPotter View Post
    This bug also happens in l4d2. I will test it,
    if your code works, I should add to my l4dinfectedbots.
    Good job

    Yes. Your plug-in allows players to enter the team of infected people will have this problem. A more precise way is to use hammerid. But currently I can't write the program, but I will use stripper:source to control it perfectly.
    __________________
    Please forgive, If I'm not describing it accurately. I use google translate
    Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
    ZBzibing is offline
    Gold Fish
    Senior Member
    Join Date: Mar 2020
    Old 01-25-2022 , 07:16   Re: [L4D]Unlock screen freeze
    Reply With Quote #7

    This problem also often bothers me on the l4d2 server , is there a solution to the problem without deleting the point_ entity ? what provokes this bug? can the number of players exceed 4 people?
    __________________
    -

    PHP Code:
    public OnClientConnect(int Client) {
        
    KickClient(Client"sorry");

    Gold Fish is offline
    Forgetest
    Member
    Join Date: Aug 2020
    Old 01-25-2022 , 09:05   Re: [L4D]Unlock screen freeze
    Reply With Quote #8

    Quote:
    Originally Posted by Gold Fish View Post
    This problem also often bothers me on the l4d2 server , is there a solution to the problem without deleting the point_ entity ? what provokes this bug? can the number of players exceed 4 people?
    https://github.com/Target5150/MoYu_S..._deathfall_cam

    Maybe this is somewhat you want.
    Unfortunately I didn't notice that some other point_viewcontrol* lead to the same issue, plus not sure how to make the solution globally applicable. Would be nice if anyone can provide some good ideas.
    Forgetest is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 01-25-2022 , 22:10   Re: [L4D]Unlock screen freeze
    Reply With Quote #9

    Only specific maps will have this bug, just filter out the hummerid of these map cameras to solve the globally affected problem, so if someone knows how to write it, you can tell me, and I will update
    __________________
    Please forgive, If I'm not describing it accurately. I use google translate
    Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
    ZBzibing is offline
    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
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 01:58.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode