AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D]Unlock screen freeze (https://forums.alliedmods.net/showthread.php?t=335581)

ZBzibing 12-15-2021 15:56

[L4D]Unlock screen freeze
 
2 Attachment(s)
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.0:off 1:on"

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.

Silvers 12-15-2021 18:50

Re: [L4D]Unlock screen freeze
 
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.

ZBzibing 12-16-2021 13:31

Re: [L4D]Unlock screen freeze
 
Quote:

Originally Posted by Silvers (Post 2766154)
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

HarryPotter 12-16-2021 14:32

Re: [L4D]Unlock screen freeze
 
This bug also happens in l4d2. I will test it,
if your code works, I should add to my l4dinfectedbots.


Good job

AK978 12-17-2021 05:50

Re: [L4D]Unlock screen freeze
 
2 Attachment(s)
l4d2 version.

ZBzibing 12-18-2021 12:57

Re: [L4D]Unlock screen freeze
 
Quote:

Originally Posted by HarryPotter (Post 2766234)
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.

Gold Fish 01-25-2022 07:16

Re: [L4D]Unlock screen freeze
 
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?

Forgetest 01-25-2022 09:05

Re: [L4D]Unlock screen freeze
 
Quote:

Originally Posted by Gold Fish (Post 2769310)
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.

ZBzibing 01-25-2022 22:10

Re: [L4D]Unlock screen freeze
 
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

Forgetest 01-26-2022 15:01

Re: [L4D]Unlock screen freeze
 
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);




All times are GMT -4. The time now is 00:24.

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