View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-15-2016 , 19:54   Re: Static.cfg restoration
Reply With Quote #3

  • You should cache the contents of static.cfg so that it is only read once at plugin_init().
  • The first argument of set_task() is a floating point value. For example, 2 should be 2.0 and any variables that you use for that argument should have the "Float" tag (or convert the value to a float first).
  • The return value of register_cvar() is a pointer, not the cvar value. You should cache the value of the cvar in public plugin_cfg(). See here for how to properly use cvars.
  • For obtaining the length of a string variable (array), use charsmax() instead of sizeof()-1.
__________________

Last edited by fysiks; 02-15-2016 at 19:57.
fysiks is offline