
   /*
   *  AMX Mod script.
   *
   * (c) Copyright 2003, ST4life
   * This file is provided as is (no warranties).
   */
   #include <amxmod>
   #include <csstats>
   /*
   *  "Say  Status"  is  a plugin to look some server-attitudes by typing
   "status" as say-message,
   * "mystatus" you get information about yourself and "report" your team
   get information about
   * you like your money etc..
   *
   * Cvar:
   * amx_saystatus_hud: 1 = Shows status by HUD-message
   *                    0 = Shows status by say-chat
   *
   *  amx_saystatus_stats:  1  =  Enable Stats-including (csstats have to
   run!)
   *                      0 = Disable Stats-including
   *
   *
   * History:
   *
   * v0.3: - add cvar "amx_saystatus_stats":
   *          if you're running csstats this cvar should be set to 1
   *       if not, set cvar to 0
   *       - add say message "report":
   *          players  in  your team get the following informations about
   you:
   *           weapon,  ammo,  health,  armor, money (thanks to SpaceDude
   about telling
   *                                               me  that i have to use
   "format" :P)
   * v0.2: - public release
   */
   public say_status(id){
       new mapname[32], nextmap[32], hostname[32]
       get_mapname(mapname,32)
       get_cvar_string("amx_nextmap",nextmap,32)
       get_cvar_string("hostname",hostname,32)
       new timeleft = get_timeleft()
       if (get_cvar_num("amx_saystatus_hud") == 1){
           set_hudmessage(255,255,0,0.05,0.4,0, 6.0, 12.0, 1.0, 2.0, 3)
           show_hudmessage(id,"%s^n^nCurrently  played  map: %s^nNext map
   will  be:  %s^nTime Remaining: %d:%02d^n^nFriendly Fire: %s^nC4 timer:
   %.0f sec.^nAlltalk: %s",
               hostname,mapname,nextmap,timeleft / 60, timeleft % 60,
               get_cvar_float("mp_friendlyfire")       ?      "on"      :
   "off",get_cvar_float("mp_c4timer"),get_cvar_float("sv_alltalk") ? "on"
   : "off")
       } else {
           client_print(id,print_chat,"[AMX] %s",hostname)
           client_print(id,print_chat,"[AMX]  Currently  played  map: %s;
   Next map will be: %s; Time Remaining: %d:%02d",
               mapname,nextmap,timeleft / 60, timeleft % 60)
           client_print(id,print_chat,"[AMX] Friendly Fire: %s; C4 timer:
   %.0f sec.; Alltalk: %s",
               get_cvar_float("mp_friendlyfire")       ?      "on"      :
   "off",get_cvar_float("mp_c4timer"),get_cvar_float("sv_alltalk") ? "on"
   : "off")
       }
       return PLUGIN_CONTINUE
   }
   public say_mystatus(id){
       new hostname[32], authid[32], stats[8], body[8]
       new rank_pos = get_user_stats(id,stats,body)
       get_cvar_string("hostname",hostname,32)
       get_user_authid(id,authid,31)
       get_user_wstats(id,0,stats,body)
       if              ((get_cvar_num("amx_saystatus_hud")             ==
   1)&&(get_cvar_num("amx_saystatus_stats") == 1)){
           set_hudmessage(255,255,0,0.05,0.4,0, 6.0, 12.0, 1.0, 2.0, 3)
           show_hudmessage(id,"Servername:  %s^nYour  AuthID:  %s^n^nYour
   Stats:^nKills: %d^nDeats: %d^nRank: %d of %d",
               hostname,authid,stats[0],stats[1],rank_pos,get_statsnum())
       }        else       if((get_cvar_num("amx_saystatus_hud")       ==
   1)&&(get_cvar_num("amx_saystatus_stats") == 0)){
           set_hudmessage(255,255,0,0.05,0.4,0, 6.0, 12.0, 1.0, 2.0, 3)
           show_hudmessage(id,"Servername: %s^nYour AuthID: %s",
               hostname,authid)
       }        else       if((get_cvar_num("amx_saystatus_hud")       ==
   0)&&(get_cvar_num("amx_saystatus_stats") == 1)){
           client_print(id,print_chat,"[AMX] You are playing on: %s, your
   AuthID is: %s",hostname,authid)
           client_print(id,print_chat,"[AMX]  Your  stats:  %d  kills, %d
   deaths and your rank is %d of %d",stats[0],
               stats[1],rank_pos,get_statsnum())
       }        else       if((get_cvar_num("amx_saystatus_hud")       ==
   0)&&(get_cvar_num("amx_saystatus_stats") == 0)){
           client_print(id,print_chat,"[AMX] You are playing on: %s, your
   AuthID is: %s",hostname,authid)
       }
       return PLUGIN_CONTINUE
   }
   public say_report(id){
       new param[2]
       param[0] = id
       set_task(1.0,"display_report",0,param,2)  //   against  anti-flood
   plugin
   }
   public display_report(param[]){
       new id = param[0]
       new wpn[32], reportstr[256], ammo, clip
       get_weaponname(id,wpn,31)
       get_user_weapon(id,clip,ammo)
       new health = get_user_health(id)
       new armor = get_user_armor(id)
       new money = get_user_money(id)
       format(reportstr,256,"say_team  weapon:  %s,  ammo: %d/%d, health:
   %d, armor: %d, money: %d",
           wpn,clip,ammo,health,armor,money)
       client_cmd(id, reportstr)
       return PLUGIN_CONTINUE
   }
   public plugin_init()
   {
       register_plugin("Say Status","0.3","ST4life")
       register_cvar("amx_saystatus_hud","1")
       register_cvar("amx_saystatus_stats","1")
       register_clcmd("say status","say_status",0,"- displays cvars")
       register_clcmd("say  mystatus","say_mystatus",0,"-  displays stats
   and some other stuff of the player")
       register_clcmd("say report","say_report",0,"- displays information
   about waepon etc to the own team")
       return PLUGIN_CONTINUE
   }
