
   /* AMX Mod script.
   *
   * (c) Copyright 2003, written by For3st
   * This file is provided as is (no warranties).
   *
   *
   * ADVANCED DAMAGE REPORT
   *[2003 / 07 / 08 -- last change]
   *
   * Changelog:
   *    v1.00 -- Initial build
   *    v1.05 -- cleaned up code and Description
   *    v1.06 -- fixed wrong frags info
   *    v1.10 -- bug fixed; added console msg
   *    v1.12 -- bug fixed; added complex console msg
   *    v1.15  --  added  TA  &  TK announce to VICTIM/DEATH/ATTACK/ KILL
   REPORT
   *    v1.20  -- added Plural "s" to e.g. Hits (if more than 1) and some
   code rewrite
   *    v1.40 -- added Client commands
   *    v1.42 -- some little changes
   *
   * ADVANCED DAMAGE REPORT DESCRIPTION
   * =================================
   * Description:
   *
   * Advanced Damage Report is mainly able to do 4 things
   * (can be enabled/disabled with cvar, individualy):
   *
   *  -  shows  some information (about damage, hits, distance etc.) just
   after you killed somebody.
   *
   *  -  shows  ,from  a  level  of  damage you can set, many infos about
   attacked/ killed player.
   * (similar as live_damage_report)
   *
   * - shows ,from a level of damage you can set, many infos about enemy,
   who attacked/ killed you.
   *
   *  - writes info about victim into console or when you die, info about
   killer.
   *
   *  The idea is ,that you can set a damage level (with cvar) from which
   report will show you
   * information about attacker/victim
   *  (depending on which flag you have set). I recommend that you set it
   on a value higher than 50
   * because if you set a lower
   *  value it will appear constantly and this really sucks! It shows you
   infos about:
   * how many hp left and how many bullets victim/attacker has, so
   *  it isn't suitable for "serious" servers(except: SIMPLE DEATH REPORT
   and when you set damage level
   * higher than 100: These wouldn't make any real advance).
   *=====================================================================
   =============
   *
   * CVARS:
   * ----------------------
   *amx_damage_level  <value>  --with  this  cvar  you can set from which
   damage level ADVANCED DAMAGE REPORT
   *                will show you information about attacker/victim
   *                (does not affect SIMPLE DEATH REPORT);
   *                default is 50
   *
   *amx_adv_report  <flags>  --with  these flags you can set which report
   will be showed and what options are allowed.
   *                Possible  are  "a, OR b, OR c ,d,e,f,g,h"; Default is
   "adeh"
   *
   *FLAGS:
   *    "a"    --when  you  set this flag, report shows  only information
   about
   *        player  whom  you  attacked/ killed (if damage is higher than
   amx_damage_level)
   *        (= ADVANCED KILL/ATTACK REPORT)
   *
   *        Information you get:
   *        -----------------------------------------
   *        name of victim,if he is a bot, Damage on last shot,
   *        where    you   hit   him(head,chest..),weapon   and   bullets
   left(victim), health and
           armor left (if enemy wasn't killed by shot)
   *        and if you killed enemy with this shot: also total damage and
   hits you've
   *            done to him. Default: set
   *
   *    "b"    --when  you  set this flag, report shows  only information
   about player
   *        who   attacked/   killed  you.  (if  damage  is  higher  than
   amx_damage_level)
   *        (=  DEATH/ VICTIM REPORT)
   *
   *        Information you get, if enemy KILLED you:
   *        -----------------------------------------
   *        name of attacker, if he is a bot, frags and kills
   *        (of  enemy),total  damage and hits he has done to you, Damage
   on last shot,
   *        where    he    hit   you(head,chest..),weapon   and   bullets
   left(enemy), killer's health
   *
   *
   *        Information you get if enemy  ATTACKED you:
   *        -----------------------------------------------
   *        name of attacker, if he is a bot, Damage on last shot,
   *        where    he    hit   you(head,chest..),weapon   and   bullets
   left(enemy),
   *        health and armor left (enemy)
   *
   *        NOTE: flag a and b CAN'T be set together on the same time!
   *
   *        Default: not set
   *
   *    "c"    --shows  both,  attacker and attacked info (like you set a
   and b);
   *        Default: not set
   *
   *    "d"    --when  you  set this flag you get the few infos about the
   enemy you just killed.
   *        (=SIMPLE DEATH REPORT)
   *
   *        Information you get:
   *        -----------------------------------
   *        NAME(VICTIM)/ TOTAL DAMAGE/ TOTAL HITS/ DISTANCE
   *
   *        On  Teamkill,  it  adds  the  line  "YOU  HAVE  KILLED A TEAM
   MEMEBER!"
   *
   *        It  appears  EVERY  time  you  killed  somebody  but it won't
   appear when damage is
   *        higher than (on last shot) amx_damage_level
   *        (because  then  already  ADVANCED  KILL  REPORT shows you the
   info)
   *        Default: set
   *
   *    "e"    --if  this  flag  is  set  a  message  in  console will be
   written, when you kill somebody (special msg for TK)
   *        A normal kill msg looks like this:
   *        Player A  killed Player B with the sig552
   *        Plugin adds following msg:
   *        from  a distance of DISTANCE with Total Damge of DMG hp and X
   hit(s). Victim had WEAPON with (x/y) Bullets.
   *
   *        The whole looks like:
   *        -------------------------------
   *        For3st killed slid with the sig552
   *        from a distance of 3.21 meters with Total Damge of 234 hp and
   4 hit(s). Victim had aug with (5/34) Bullets.
   *
   *    "f"    --when  you  set  this flag, feet instat of meters will be
   shown as distance.
   *        Default: not set
   *
   *    "g"    --    when    you    set    this    flag,    sucides   and
   self-damaging-events will be reportet.
   *        Default: not set
   *
   *    "h"    --  when  this  flag  is set , Client Commands are allowed
   (/rpton, /rptoff). see CLIENT COMMANDS
   *
   *
   *
   * To disable Plugin set amx_adv_report "".
   *
   * Summary: amx_adv_report <a OR b OR c,d,e,f,g,h>
   *
   *
   * CLIENT COMMANDS
   * ----------------------
   *
   *say  /rptoff    --  Disables  the whole plugin if client commands are
   allowed by cvar.
   *        (Note:Type  /rptoff  into the chat or "say  /rptoff" into the
   console.)
   *
   *say /rpton    -- Enables allowed parts of the Plugin.
   *        (Note:Type  /rpton  into  the  chat or "say  /rpton" into the
   console.)
   *
   *say  /rpt_status  -- Tells you if plugin is enabled and which options
   are allowed.
   *
   *=====================================================================
   =============
   *
   * NOTE: DEATH/ VICTIM REPORT is only usefull on clan practise.
   *  It  provides similar info about death like stats.amx or statsX.amx!
   So dont mix both!
   *  ADVANCED  KILL/ATTACK  REPORT  should be on a high level (over 50),
   because it should only
   * "reward" you if you've done a good shot.
   *On  awp-maps  it  should  be  higher than 200, cos a normal awp- shot
   makes at least 100 damage.
   *=====================================================================
   =============
   *
   *HUDMESSAGE properties are:
   *
   *    DEATH  MESSAGE:  on the left side on screen with red color (stays
   about 6 secs)
   *    KILL MESSAGE: on the left side on screen with orange color (stays
   about 5 secs)
   *    ATTACK  MESSAGE:  on  the  left  side on screen with bright-green
   color (stays about 3 secs)
   *    VICTIM MESSAGE: on the left side on screen with bright-blue color
   (stays about 3 secs)
   *    SIMPLE KILL MESSAGE: in the middle of the screen with white color
   (stays about 2 -3 secs)
   *=====================================================================
   =============
   */
   #include <amxmod>
   #include <csstats>
   new   body_part[8][]  =  {"Whole  Body","Head","Chest","Stomach","Left
   Arm","Right Arm","Left Leg","Right Leg"}
   new bool:adv_rep[33]
   getflags() {
   //Checks cvar
      new uniflagstring[129]
      get_cvar_string ("amx_adv_report",uniflagstring,129)
      new allflagstringbits = read_flags(uniflagstring)
      return allflagstringbits
      }
   public damage_event( victim ) {

     //Damage on last shot
      new damage = read_data(2)
      new weapon, hitplace
      new attacker = get_user_attacker(victim,weapon,hitplace)
   //if no flags are set, plugin stops (saves cpu time)
      if  (  (!(getflags() &1) && !(getflags() &2) && !(getflags() &4) &&
   !(getflags()  &8)  &&  !(getflags()  &16))  ||  !adv_rep[attacker]  ||
   !adv_rep[victim])    return PLUGIN_CONTINUE
   //defines suicide rule
      if (! (getflags() & 64)) {
      if  (attacker  ==  victim)  return PLUGIN_CONTINUE    // In case of
   self-kill, abort report if Flag is set
      }
   //Checks  Information  about  Atttacker  and  Victim  and defines most
   important variables
      //Variables
      new  start[3],  end[3],  name[32],  name2[32],  wpn[32],  wpn2[32],
   ammo, ammo2, clip, clip2
      //Weapons
      new vweapon = get_user_weapon(victim,ammo,clip)
      new aweapon = get_user_weapon (attacker,ammo2,clip2)
      // Names
      get_weaponname(vweapon,wpn,31)
      get_weaponname(aweapon,wpn2,31)
      get_user_name(victim,name,31)
      get_user_name(attacker,name2,31)
      // Distance
      get_user_origin(victim,start)
      get_user_origin(attacker,end)
      new distance = get_distance(start,end)
      // Frags
      new vdeaths = get_user_deaths(victim)
      new vfrags = get_user_frags(victim)
      new adeaths = get_user_deaths(attacker)
      new afrags = get_user_frags(attacker)
   //Checks Stats

      new vname[32], vstats[8] ,vbody[8], vwpn[8]
      //new aname[32], astats[8] ,abody[8], awpn[8]

      get_user_astats(victim,vname[31],vstats,vbody,vwpn,31)
      //get_user_vstats(attacker,aname[31],astats,abody,awpn,31)

       // SUB MESSAGES
   //----------------------------------------------------------
   //Checks Bots
      new pmsg [11], pmsg2[11]
      //new ping[5], vloss[5], ping2[5], aloss[5]
      //get_user_ping(victim,ping[4],vloss[4])
      //return ping[4]
      //get_user_ping(attacker,ping2[4],aloss[4])
      //return ping2[4]
      if (is_user_bot(victim)) {
      format (pmsg,10,"[BOT] ")
      }
      //else if (ping[victim] >= 100 ) {
      //format (pmsg,19,"[%d ms]",ping)
      //}
      else {
      format (pmsg,1,"")
      }
      if (is_user_bot(attacker)) {
      format (pmsg2,10,"[BOT] ")
      }
      //else if (ping2[attacker] >= 100 ) {
      //format (pmsg2,19,"[%d ms]",ping2)
      //}
      else {
      format (pmsg2,1,"")
      }
       //Defines Distance
      new dismsg[16]
      if  (getflags() & 32) {            //when flag is set then distance
   will be shown in feet
      format(dismsg,10,"%.1f ft", float (distance) / 12)
      }
      else {
      format(dismsg,15,"%.2f meter", float (distance) / 42)
      }


   //Checks Armor
      new varmor_msg[21], aarmor_msg[21]
       //VICTIM's Armor:
      if (get_user_armor(victim) == 0) {
      format (varmor_msg,2,"")
      }
      else if (get_user_armor(victim) != 0) {
      format (varmor_msg,20,"and %i Armor",get_user_armor(victim))
      }
       //ATTACKER's Armor:
      if (get_user_armor(attacker) == 0) {
      format (aarmor_msg,2,"")
      }
      else if (get_user_armor(attacker) != 0) {
      format (aarmor_msg,20,"and %i Armor",get_user_armor(attacker))
      }
   //Checks Bullets
      new vbulmsg[21], abulmsg[21]
       //VICTIM's Bullets:
      if  ( vweapon == 4 || vweapon == 6 || vweapon == 9 || vweapon == 25
   || vweapon == 29 ) {
      //bullets left won't appear if victim has knife,C4,Greanades
      format (vbulmsg,2,"")
      }
      else  if  ( vweapon != 4 || vweapon != 6 || vweapon != 9 || vweapon
   != 25 || vweapon != 29 ) {
      format (vbulmsg,20,"(%d/%d) Bullet(s)",ammo, clip)
      }
       //ATTACKER's Bullets
      if  ( aweapon == 4 || aweapon == 6 || aweapon == 9 || aweapon == 25
   || aweapon == 29 ) {
      //bullets left won't appear if attacker has knife,C4,Greanades
      format (abulmsg,2,"")
      }
      else  if  ( aweapon != 4 || aweapon != 6 || aweapon != 9 || aweapon
   != 25 || aweapon != 29 ) {
      format (abulmsg,20,"(%d/%d) Bullet(s)",ammo2, clip2)
      }
   //Checks TA or TK
      new TKTAmsg[11], TKTAmsg2[19]
      if  (get_user_team(victim)  == get_user_team(attacker) && (attacker
   != victim)) {
      format (TKTAmsg,10,"TEAM^n")
      format (TKTAmsg2,18,"^n(TEAMMEMBER!)")
      }
      else{
      format (TKTAmsg,2,"")
      format (TKTAmsg2,2,"")
      }
   /*MAIN REPORT MESSAGE CODE
   ======================================================================
   ============
   ======================================================================
   ============*/

       //SIMPLE KILL REPORT
   //----------------------------------------------------------
      if  (get_user_health(victim)  <=  0  &&  (damage  <  get_cvar_float
   ("amx_damage_level")  || (getflags() &2)) /* ||get_user_health(victim)
   <= 0 && (! (getflags() &1))*/)  {

      new       deathmsg[100],      deathmsg2[100],      consolemsg[150],
   consolemsg2[130]
      if (getflags() & 8) {
      //when flag is set simple death msg will appear

      format  (consolemsg,149,"from  a distance of %s with Total Damge of
   %d HP and %d hit%s. Victim had %s %s.",dismsg, vstats[6], vstats[5], (
   vstats[5]==1) ?"":"s", wpn[7], vbulmsg)
      format  (consolemsg2,129,"from a distance of %s with Total Damge of
   %d  HP  and  %d  hit%s.Last  Hit  Place:  %s  (made %d dmg) .",dismsg,
   vstats[6], vstats[5], ( vstats[5]==1)
   ?"":"s",     body_part[hitplace], damage)
      if (get_user_team(victim) == get_user_team(attacker)) {
      if (getflags() & 16) {
      client_print(attacker,print_console,"from  a  distance  of  %s with
   Total  Damge  of %d HP and %d hit%s. Victim was a TEAMMEMBER!",dismsg,
   vstats[6], vstats[5], ( vstats[5]==1) ?"":"s")
      client_print(victim,print_console,"from a distance of %s with Total
   Damge  of  %d  HP  and  %d  hit%s.  Victim  was a TEAMMEMBER!",dismsg,
   vstats[6], vstats[5], ( vstats[5]==1) ?"":"s")
      }
      format  (deathmsg2,99,"YOU  HAVE  KILLED A TEAM MEMEBER!^n%s %s/ %d
   dmg/  %d hit%s/ %s",name, pmsg, vstats[6] , vstats[5], ( vstats[5]==1)
   ?"":"s", dismsg)
      set_hudmessage(255,50,0,-1.0,0.25,1, 0.01, 3.75, 0.01, 0.01, 10)
      show_hudmessage(attacker,deathmsg2)
      }
      else  {
      if (getflags() & 16) {
      client_print(attacker,print_console,consolemsg)
      client_print(victim,print_console,consolemsg2)
      }
      format  (deathmsg,99,"%s  %s/  %d  dmg/  %d  hit%s/ %s",name, pmsg,
   vstats[6] , vstats[5], ( vstats[5]==1) ?"":"s", dismsg)
      set_hudmessage(170,170,170,-1.0,0.25,2, 0.1, 3.0, 0.02, 0.1, 10)
      show_hudmessage(attacker,deathmsg)
      }
     }
   }
       //ADVANCED KILL/ DEATH REPORT
   //----------------------------------------------------------
      else  if ( get_user_health(victim) <= 0 && damage >= get_cvar_float
   ("amx_damage_level")) {
      new      reportmsg[250],      reportmsg2[350],     consolemsg[150],
   consolemsg2[130]
      format  (reportmsg,249,"%sKILL  REPORT:^n^nVICTIM:  %s  %s^nDAMAGE:
   %ihp^nPLACE: %s^nWEAPON: %s %s^nDISTANCE:
   %s^n---------------------^n%d  FRAGS  /  %d  DEATHS^nTOTAL: %d dmg/ %d
   Hit%s",
         TKTAmsg,name,   pmsg,   damage,   body_part[hitplace],   wpn[7],
   vbulmsg,     dismsg,  vfrags,    vdeaths,vstats[6],    vstats[5],    (
   vstats[5]==1) ?"":"s")

      format  (reportmsg2,349,"DEATH REPORT:^n^nKILLER: %s %s%s^n%d FRAGS
   /  %d  DEATHS^nTOTAL: %d dmg/ %d Hit%s^n---------------------^nDAMAGE:
   %ihp^nPLACE: %s^nWEAPON: %s %s^nDISTANCE:
   %s^n---------------------^nKILLER HEALTH: %d",
         name2, pmsg2, TKTAmsg2, afrags, adeaths, vstats[6], vstats[5], (
   vstats[5]==1)  ?"":"s", damage, body_part[hitplace], wpn2[7], abulmsg,
   dismsg,get_user_health(attacker))

      if (getflags() & 1)  {
      //when Flag is set then Report will only show up on attacker's hud
      if (getflags() & 16) {
      format  (consolemsg,149,"from  a distance of %s with Total Damge of
   %d HP and %d hit%s. Victim had %s %s.",dismsg, vstats[6], vstats[5], (
   vstats[5]==1) ?"":"s", wpn[7], vbulmsg)
      format  (consolemsg2,129,"from a distance of %s with Total Damge of
   %d  HP  and  %d  hit%s.Last  Hit  Place:  %s  (made %d dmg) .",dismsg,
   vstats[6], vstats[5], ( vstats[5]==1)
   ?"":"s",     body_part[hitplace], damage)
      client_print(attacker,print_console,consolemsg)
      client_print(victim,print_console,consolemsg2)
      }
      set_hudmessage(240,80,20,0.05,0.325,0, 0.25, 4.0, 0.75, 1.5, 3)
      show_hudmessage(attacker,reportmsg)
      }
      else  if  (getflags()  & 2) {        //when Flag is set then Report
   will only show up on victim's hud

      if (getflags() & 16) {
      client_print(victim,print_console,"from a distance of %s with Total
   Damge  of  %d  HP  and  %d  hit%s.Last  shot  hit  in  %s  and made %d
   dmg.",dismsg,   vstats[6],   vstats[5],   (   vstats[5]==1)   ?"":"s",
   body_part[hitplace], damage)
      client_print(victim,print_console,"Killer  still  has %d HP%s left.
   Killer's  Score:  Frags: %d -- Deaths: %d", get_user_health(attacker),
   aarmor_msg,  afrags, adeaths)
      }
      set_hudmessage(200,1,0,0.05,0.375,0, 0.25, 7.0, 0.75, 1.0, 3)
      show_hudmessage(victim,reportmsg2)
      }

      else if (getflags() & 4)  {
      //when  Flag  is  set then Report will  show up both: on attacker's
   and victim's hud
      set_hudmessage(240,80,20,0.05,0.325,0, 0.25, 4.0, 0.75, 1.5, 3)
      show_hudmessage(attacker,reportmsg)
      set_hudmessage(200,0,0,0.05,0.375,0, 0.25, 7.0, 0.75, 1.0, 3)
      show_hudmessage(victim,reportmsg2)
      }

   }
       //ATTACK/ VICTIM REPORT
   //----------------------------------------------------------
      else  if  ( get_user_health(victim) > 0 && damage >= get_cvar_float
   ("amx_damage_level")) {
      new reportmsg[200], reportmsg2[200]

      format (reportmsg,199,"%sATTACK REPORT:^n^nVICTIM: %s^nDAMAGE: %ihp
   (%d  hit%s)^nPLACE:  %s^nWEAPON:  %s  %s^nDISTANCE:  %s^nHEALTH  LEFT:
   %i  hp %s",
         TKTAmsg,  name,  damage,  vstats[5],  (  vstats[5]==1)  ?"":"s",
   body_part[hitplace],  wpn[7], vbulmsg, dismsg, get_user_health(victim)
   ,varmor_msg)

      format  (reportmsg2,199,"VICTIM  REPORT:^n^nATTACKER: %s%s^nDAMAGE:
   %ihp^nPLACE: %s^nWEAPON: %s %s^nDISTANCE:
   %s^n---------------------^nATTACKER HEALTH: %i  hp %s",
         name2,TKTAmsg2,  damage,  body_part[hitplace], wpn2[7], abulmsg,
   dismsg, get_user_health(attacker) ,aarmor_msg)
      if (getflags() & 1)  {
      //when Flag is set then Report will only show up on attacker's hud
      set_hudmessage(150,240,100,0.05,0.325,0, 0.25, 2.5, 0.25, 0.25, 3)
      show_hudmessage(attacker,reportmsg)
      }
      else if (getflags() & 2) {
      //when Flag is set then Report will only show up on victim's hud
      set_hudmessage(30,75,200,0.05,0.325,0, 0.25, 2.5, 0.25, 0.25, 3)
      show_hudmessage(victim,reportmsg2)
      }
      else if (getflags() & 4)  {
      //when  Flag  is  set then Report will  show up both: on attacker's
   and victim's hud
      set_hudmessage(150,240,100,0.05,0.325,0, 0.25, 2.5, 0.25, 0.25, 3)
      show_hudmessage(attacker,reportmsg)
      set_hudmessage(30,75,200,0.05,0.325,0, 0.25, 2.5, 0.25, 0.25, 4)
      show_hudmessage(victim,reportmsg2)
      }
   }
      else  if  (  get_user_health(victim) > 0 && damage < get_cvar_float
   ("amx_damage_level")) {
      return PLUGIN_CONTINUE
   }
      return PLUGIN_CONTINUE
   }
   /*MAIN CLIENT COMMAND CODE
   ======================================================================
   ============*/
   public client_putinserver(id){
      adv_rep[id] = true
      //client_print(id,print_chat,"[*REPORT  INFO] Type /rpt_status into
   the  chat to check which Mode is set. Type /rptoff to disable Advanced
   Damage Report")
      return PLUGIN_CONTINUE
   }
   // say commands
   public hit_report_off(id){
      if (!adv_rep[id] && (getflags() &128)) {
      client_print(id,print_chat,"[*REPORT   INFO]  Advanced  Report  has
   already been disabled! Enable it by typing /rpton.")
      }
      else if (!(getflags() &128)) {
      client_print(id,print_chat,"[*REPORT  INFO] Client commands are not
   allowed.")
      return PLUGIN_CONTINUE
      }
      else {
      client_print(id,print_chat,"[*REPORT INFO] Advanced Report has been
   disabled. Enable it by typing /rpton.")
      }
      adv_rep[id] = false
      return PLUGIN_HANDLED
   }
   public hit_report_on(id){
      if  (  !(getflags()  &1) && !(getflags() &2) && !(getflags() &4) &&
   !(getflags() &8) && !(getflags() &16) && (getflags() &128)) {
      client_print(id,print_chat,"[*REPORT  INFO] Advanced Report can not
   be enabled. (Server does not allow Report)")
      }
      else if (adv_rep[id] && (getflags() &128)){
      client_print(id,print_chat,"[*REPORT   INFO]  Advanced  Report  has
   already been enabled! Disable it, by typing /rptoff.")
      }
      else if (!(getflags() &128)) {
      client_print(id,print_chat,"[*REPORT  INFO] Client commands are not
   allowed.")
      return PLUGIN_CONTINUE
      }
      else {
      client_print(id,print_chat,"[*REPORT INFO] Advanced Report has been
   enabled. Disable it, by typing /rptoff.")
      }
      adv_rep[id] = true
      return PLUGIN_HANDLED
   }
   public hit_status(id){
      new msg1[33],msg2[33],msg3[33],msg4[33]
      if ( (getflags() &1) && !(getflags() &2) && !(getflags() &4)) {
      format(msg1,32,"MODE: Kill/ Attack Report")
      }
      else  if ( !(getflags() &1) && (getflags() &2) && !(getflags() &4))
   {
      format(msg1,32,"MODE: Death/ Victim Report")
      }
      else  if ( !(getflags() &1) && !(getflags() &2) && (getflags() &4))
   {
      format(msg1,32," MODE: Kill/ Attack and Death/ Victim Report")
      }
      else  {
      format(msg1,32," MODE:Advanced Damge Report is disabled")
      }
      if  (getflags() &8) {
      format (msg2,32,"Simple Kill Report is enabled")
      }
      else {
      format (msg2,32,"Simple Kill Report is disabled")
      }
      if  (getflags() &16) {
      format (msg3,32,"and Console Message is enabled.")
      }
      else {
      format (msg3,32,"and Console Message is disabled.")
      }
      if  (getflags() &32) {
      format (msg4,32," (Unit of length: feet)")
      }
      else {
      format (msg4,32," (Unit of length: meter)")
      }
      if  (  !(getflags()  &1) && !(getflags() &2) && !(getflags() &4) &&
   !(getflags() &8) && !(getflags() &16)) {
      client_print(id,print_chat,"[ADVANCED   REPORT   STATUS]   Advanced
   Damage  Report  is  disabled  generally  and  can  not  be  enabled by
   client.")
      }
      else  if  (adv_rep[id]  &&  ( (getflags() &1) || (getflags() &2) ||
   (getflags() &4) || (getflags() &8) || (getflags() &16))){
      client_print(id,print_chat,"[ADVANCED   REPORT  STATUS]  Plugin  is
   enabled. Disable it, by typing /rptoff into the chat.")
      client_print(id,print_chat,"%s %s; %s %s",msg1,msg4,msg2,msg3)
      }
      else  if  (!adv_rep[id]  && ( (getflags() &1) || (getflags() &2) ||
   (getflags() &4) || (getflags() &8) || (getflags() &16))){
      client_print(id,print_chat,"[ADVANCED   REPORT   STATUS]   Advanced
   Damage Report is disabled. Enable it by typing /rpton.")
      }
   }
   public plugin_init() {
      register_plugin("Advanced Damage Report","1.42","For3st")
      register_event("Damage", "damage_event", "b", "2>10")
      register_clcmd("say /rpt_status","hit_status")
      register_clcmd("say_team /rpt_status","hit_status")
      register_clcmd("say /rptoff","hit_report_off")
      register_clcmd("say_team /rptoff","hit_report_off")
      register_clcmd("say /rpton","hit_report_on")
      register_clcmd("say_team /rpton","hit_report_on")
      register_cvar("amx_adv_report","adeh")
      register_cvar("amx_damage_level","50.0")
      return PLUGIN_CONTINUE
   }
   //register_cvar(const  name[],const  string[],flags = 0,Float:fvalue =
   0.0)
   //register_srvcmd(const     server_cmd[],const    function[],flags=-1,
   info[]="")
