
   /* AMX Mod script.
   *
   * (c) Copyright 2002-2003, OLO
   * This file is provided as is (no warranties).
   * Stop Killing Hossies --- By AssKicR
   *
   * Cvars::
   * sv_host_limit = How Many Hostage Kills Are Legal to kill (def=4)
   *  sv_host_ban  = If they reach Limit will there be a vote to Ban Them
   (def=0)
   *  sv_host_kick = If they reach Limit will there be a vote to Ban Them
   (def=1)
   * sv_host_slay = If they reach Limit will They be Autoslain (def=1)
   *  sv_host_slap  =  If  they  attack  a  hostage they get slapped with
   "sv_host_slappower" dmg
   * sv_host_slappower = Power of the "sv_host_slap"
   *
   */
   #include <amxmod>
   new HostageCount[33]
   new HostageKiller[33]
   public plugin_init() {
      register_plugin("Stop Killing The %&¤#ing
   Hostages","1.0","AssKicR")
      register_event("TextMsg","host_killed","b","2&#Killed_Hostage")
      register_event("TextMsg","host_injured","b","2&#Injured_Hostage")
      register_cvar("sv_host_limit","4")
      register_cvar("sv_host_ban","0")
      register_cvar("sv_host_kick","1")
      register_cvar("sv_host_slay","1")
      register_cvar("sv_host_slap","1")
      register_cvar("sv_host_slappower","2")
      set_cvar_num("mp_hostagepenalty",0)

      new mapname[4]
      get_mapname(mapname,3)
      if (!equali(mapname,"cs_",3))   pause("a")

      return PLUGIN_CONTINUE
   }
   public client_connect(id){
      HostageCount[id]=0
      HostageKiller[id]=0
   }
   public client_disconnect(id){
      HostageCount[id]=0
      HostageKiller[id]=0
   }
   public host_killed(id){
      new name[32]
      get_user_name(id,name,31)
      set_hudmessage(225,  25,  25,  -1.0,  0.32,  0, 2.0, 9.0, 0.8, 0.8,
   2)  // Vote ban or kick warning
      show_hudmessage(0,"God damned!!^n A hostage was killed by %s",name)
      client_print(0,print_chat,"[AMX]  God damned!! A hostage was killed
   by %s",name)

      if (HostageCount[id]>=(get_cvar_num("sv_host_limit"))){
         if (get_cvar_num("sv_host_ban")!=1 &&
   get_cvar_num("sv_host_kick")==1){
            votekick_player(id)
         }
         if (get_cvar_num("sv_host_ban")==1 &&
   get_cvar_num("sv_host_kick")!=1){
            voteban_player(id)
         }
         client_print(id,print_chat,"[Amx]   You   Where   Autoslain  For
   Killing a Hostage")
         if (get_cvar_num("sv_host_slay")==1){
            user_kill(id)
         }
      }else{
         HostageCount[id]=(HostageCount[id]+1)
         client_print(id,print_chat,"[Amx]  Warning::  You Have Killed %i
   of %i hostages",HostageCount[id],get_cvar_num("sv_host_limit"))
         if (HostageCount[id]==(get_cvar_num("sv_host_limit"))){
            if             (get_cvar_num("sv_host_ban")!=1             &&
   get_cvar_num("sv_host_kick")==1){
               votekick_player(id)
            }
            if             (get_cvar_num("sv_host_ban")==1             &&
   get_cvar_num("sv_host_kick")!=1){
               voteban_player(id)
            }
         }
      }
   }
   public host_injured(id){
      new name[32]
      get_user_name(id,name,31)
      client_print(id,print_chat,"[Amx]   You   Where   Autoslapped   For
   Injuring a Hostage")
      if (get_cvar_num("sv_host_slap")==1){
      user_slap(id,get_cvar_num("sv_host_slappower"))
      }
   }
   // Vote ban player
   public voteban_player(player){
      if (HostageKiller[player]==1) return PLUGIN_HANDLED
      HostageKiller[player]=1
      new Banname[33]
      get_user_name(player,Banname,32)
      //client_cmd(0,"spk ^"vox/warning^"")
      client_cmd(0, "spk ^"warning idiot has reached checkpoint^"")
      set_hudmessage(225,  25,  25,  -1.0,  0.32,  0, 2.0, 9.0, 0.8, 0.8,
   2)  // Vote ban or kick warning
      show_hudmessage(0,"WARNING!!^nVote  to  ban %s for multiple Hostage
   Kills",Banname)
      client_print(0,print_chat,"[AMX]   Vote  to  ban  %s  for  multiple
   Hostage Kills",Banname)
      server_cmd("amx_voteban %s", Banname) //set vote ban off
      return PLUGIN_CONTINUE
   }
   // Vote kick player
   public votekick_player(player){
      if (HostageKiller[player]==1) return PLUGIN_HANDLED
      HostageKiller[player]=1
      new Kickname[33]
      get_user_name(player,Kickname,32)
      //client_cmd(0,"spk ^"vox/warning^"")
      client_cmd(0, "spk ^"warning idiot has reached checkpoint^"")
      set_hudmessage(225,  25,  25,  -1.0,  0.32,  0, 2.0, 9.0, 0.8, 0.8,
   2)  // Vote ban or kick warning
      show_hudmessage(0,"WARNING!!^nVote  to kick %s for multiple Hostage
   Kills",Kickname)
      client_print(0,print_chat,"[AMX]  Vote  to  kick  %s  for  multiple
   Hostage Kills",Kickname)
      server_cmd("amx_votekick %s", Kickname) //set vote ban off
      return PLUGIN_CONTINUE
   }
