
   /* AMX Mod script.
   *
   * (c) Copyright 2002-2003, f117bomb
   * This file is provided as is (no warranties).
   */
   #include <amxmod>
   #include <amxmisc>
   /*
   * Usage: amx_slap2 <authid, nick, @team or #userid> [damage]
   * Examples:
   * amx_slap2 @CT 50
   * amx_slap2 @TERRORIST 1
   * amx_slap2 #213
   *
   */
   new bloodspray, blooddrop
   slap_player(id,victim,damage) {
       new origin[3], name[32]
       get_user_name(victim,name,31)
       get_user_origin(victim,origin)
       blood(origin)
       // Avoid user being slapped dead
       new userheath = get_user_health(victim)
       if (damage < userheath)
           user_slap(victim,damage)
       else{
           userheath -= damage
           user_slap(victim, damage + userheath - 1 )
       }
       console_print(id,"Client ^"%s^" has been slapped",name)
   }
   public admin_slap(id,level,cid) {
       if (!cmd_access(id,level,cid,2))
           return PLUGIN_HANDLED
       new arg[32], arg2[3], damage
       read_argv(1,arg,31)
       read_argv(2,arg2,2)
       damage = strtonum(arg2)
       if (arg[0]=='@'){
           new players[32], inum , name[32]
           get_players(players,inum,"ae",arg[1])
           if (inum==0){
               console_print(id,"No clients in such team")
               return PLUGIN_HANDLED
           }
           for(new a=0;a<inum;++a){
               if (get_user_flags(players[a])&ADMIN_IMMUNITY){
                   get_user_name(players[a],name,31)
                   console_print(id,"Skipping  ^"%s^"  because client has
   immunity",name)
                   continue
               }
               slap_player(id,players[a],damage)
           }
       }
       else {
           new player = cmd_target(id,arg,5)
           if (!player) return PLUGIN_HANDLED
           slap_player(id,player,damage)
       }
       return PLUGIN_HANDLED
   }
   public plugin_precache(){
      bloodspray = precache_model("sprites/bloodspray.spr")
      blooddrop = precache_model("sprites/blood.spr")
      return PLUGIN_CONTINUE
   }
   public plugin_init(){
      register_plugin("Admin Slap 2","0.9.2","f117bomb")
      register_concmd("amx_slap2","admin_slap",ADMIN_SLAY,"<authid, nick,
   @team or #userid> [damage]")
      return PLUGIN_CONTINUE
   }
   blood(vec1[3]) {
      message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec1)
      write_byte( 115 )
      write_coord(vec1[0])
      write_coord(vec1[1])
      write_coord(vec1[2] +25)
      write_short( bloodspray )
      write_short( blooddrop )
      write_byte( 70 ) // color index
      write_byte( 15 ) // size
      message_end()
   }
