View Single Post
Antithasys
Moderator
Join Date: Apr 2008
Old 03-06-2009 , 18:16   Re: Show Health v1.0.0
Reply With Quote #4

Few suggestions:
  • Use MaxClients instead of setting a global with GetMaxClients() on map load.
  • Hook the change of your cvars with HookConVarChange()
  • Call AutoExecConfig(true, "plugin.showhealth") to create and load your convars in a .cfg file
  • Use FCVAR_DONTRECORD on your public cvar so its not written to the .cfg file.
  • Use OnConfigsExecuted() to load some globals for your convars
  • Use your globals instead of GetConVarBool() and GetConVarInt() in your timer callback.

The reason for these suggestions is because you don't really want to have to query the convar every 2 seconds in your timer call back for each client. There are times when code like this is better, but being used in a repeating timer is not one of them. Additionally, loading your convars into your own config file makes it very easy for a server admin to set the settings.

Lastly, if your plugin had a lot of support files and such a .zip file would be better. Since you only have the plugin itself, and it can be compiled on the forums, please upload only the .sp file.

__________________
[my plugins]

When you think about asking a question... consider what have you tried?

Last edited by Antithasys; 03-06-2009 at 18:33.
Antithasys is offline