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)) == 0 || strcmp(Removeview, "point_deathfall_camera") == 0 )
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.
__________________