
   /* AMX Mod script.
   *
   * (c) 2003, OLO
   * This file is provided as is (no warranties).
   *
   * Scroll Message made with center typed text.
   * Frequency is set to 5 minutes and message is set
   * by amx_cscrollmsg cvar (set to "" disables plugin)
   */
   #include <amxmod>
   #define SPEED 0.3
   #define FREQUENCY 300.0
   new g_message[64]
   new g_dest[32]
   new g_ipos
   new g_imax
   new g_iframe
   new g_ioffset
   public plugin_init()
   {
     register_plugin("Center Scroll Msg","0.1","default")
     register_cvar(  "amx_cscrollmsg",  "This  server is using AMX! Visit
   http://amxmod.net"  )
     set_task( FREQUENCY ,  "cmdMsg" , 0 , "" , 0 , "b" )
   }
   public cmdMsg()
   {
     g_imax  =  g_ipos  =  get_cvar_string( "amx_cscrollmsg" , g_message,
   63  )

     if ( g_imax ) // if cvar is not set to null string
     {
       g_iframe = 32
       g_ioffset = 0
       setc( g_dest, 31 , ' ' ) // initialize var with spaces
       set_task( SPEED , "scrollMsg", 0 , "" , 0 , "a" , g_ipos + 31 )
     }
   }
   public scrollMsg()
   {
     if ( g_iframe  )
       --g_iframe
     else
       ++g_ioffset
     new a = copy( g_dest[ g_iframe ] , g_imax - g_ioffset
       - g_ipos-- , g_message[ g_ioffset ] ) + g_iframe

     if ( a < 31 ) g_dest[ a ] = ' '

     client_print( 0 , print_center , g_dest )
   }
