View Single Post
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