
   /* AMX Mod script.
   *
   * (c) Copyright 2002-2003, OLO
   * This file is provided as is (no warranties).
   *
   */

   #include <amxmod>
   #include <amxmisc>
   #include <csstats>
   new bool:g_specMode[33]
   public plugin_init()
   {
     register_plugin("Spec. Rank Info.","0.9","default")
     register_event("TextMsg","setSpecMode","bd","2&ec_Mod")
     register_event("StatusValue","showRank","bd","1=2")
   }
   public showRank(id){
     if ( !g_specMode[id] ) return
     new a = read_data(2)
     if ( !is_user_connected( a ) ) return // not valid target
     new name[32], data[8]
     get_user_name( a ,name,31)
     new pos = get_user_stats( a ,data,data)
     set_hudmessage(255,255,255,0.02,0.9,2, 1.5, 3.0, 0.02, 5.0, 1)
     show_hudmessage(id,"%s's rank is %d of %d",name,pos,get_statsnum())
   }
   public setSpecMode(id)
   {
     new arg[12]
     read_data( 2 , arg , 11 )
     g_specMode[ id ] = ( arg[10] == '2' ) ? true : false
   }
   public client_connect(id)
     g_specMode[id] = false
   public client_disconnect(id)
     g_specMode[id] = false
