
   /* AMX Mod script.
   *
   * (c) Copyright 2002, Written by Rav
   * This file is provided as is (no warranties).
   *
   * Changelog
   *
   * Version 1.10 - Initial Build
   * Version 1.12 - Added distance and body part.
   * Version 1.13 - Changed user flags for rpt[16]
   *  Version  1.14 - Changed commands to console "reporton" "reportoff",
   user can now set their own hplevel
   *
   */
   #include <amxmod>
   new   body_part[8][]  =  {"Whole  Body","Head","Chest","Stomach","Left
   Arm","Right Arm","Left Leg","Right Leg"}
   new hpLevel[33]
   new bool:rpt[33]
   public hit_reportoff( id ) {
      rpt[id] = false
      client_print(id,print_chat,"* Hit Report has been disabled")
      return PLUGIN_HANDLED
   }
   public hit_reporton( id ) {
      rpt[id] = true
      new arg1[8]
      read_argv(1,arg1,7)
      hpLevel[id] = strtonum(arg1)
      if (hpLevel[id] < 10)
         hpLevel[id] = 10
      client_print(id,print_chat,"*  Hit  Report  is  now enabled at dmg.
   level %i", hpLevel[id])
      return PLUGIN_HANDLED
   }
   public damage_event( victim ) {
      new damage = read_data(2)
      new weapon, hitplace
      new attacker = get_user_attacker(victim,weapon,hitplace)
      if ( !rpt[attacker] || damage < hpLevel[attacker])
         return PLUGIN_CONTINUE
      new start[3], end[3],  name[32], wpn[32],ammo, clip
      new myweapon = get_user_weapon(attacker,ammo,clip)
      get_weaponname(myweapon,wpn,31)
      get_user_name(victim,name,31)
      get_user_origin(victim,start)
      get_user_origin(attacker,end)
      set_hudmessage(220,80,0,0.05,0.15,0, 6.0, 12.0, 1.0, 2.0, 1)
      show_hudmessage(attacker,"ATTACK   REPORT:^n^nDAMAGE:  %ihp^nPLACE:
   %s^nWEAPON: %s^nDISTANCE: %dft^nVICTIM: %s^nHEALTH: %i",
         damage,  body_part[hitplace],  wpn[7], get_distance(start,end) /
   39, name, get_user_health(victim))
      return PLUGIN_CONTINUE
   }
   public report_info(id){
      show_motd(id,"This plugin will display on screen \
      what damage you have/are doing to your victim. \
      You will
   see:    ^n^nDAMAGE^nWEAPON^nDISTANCE^nVICTIM^nPLACE^nHEALTH^n^n\
      To enable the report use 'reporton < your damage level >' \
      to disable it use'reportoff'^n^nWritten by Rav",
      "Live Damage Report 1.14")
      return PLUGIN_HANDLED
   }
   public client_putinserver(id){
      rpt[id] = false
      return PLUGIN_CONTINUE
   }
   public plugin_init() {
      register_plugin("Live Damage Report","1.14","RVS")
      register_event("Damage", "damage_event", "b", "2>10")
      register_clcmd("reportoff","hit_reportoff")
      register_clcmd("reporton","hit_reporton")
      register_clcmd("say /reportinfo","report_info")
   /*     register_cvar("amx_rvs_report",     "Live     Damage     Report
   1.14",FCVAR_SERVER)  */
      return PLUGIN_CONTINUE
   }
