
   /* AMX Mod script.
   * This file is provided as is (no warranties).
   */
   #include <amxmod>
   #include <amxmisc>
   /*
   * Usage: amx_smite <authid, nick, @team or #userid> [smitedam]
   * Examples:
   * amx_smite uid damage
   *
   */
   new light, smoke
   new damage
   smite_player(id,victim) {
           new origin[3], srco[3], name[32]
           get_user_name(victim,name,31)
           get_user_origin(victim,origin)
           origin[2] -= 26
           srco[0]=origin[0]
           srco[1]=origin[1]
           srco[2]=origin[2]+400
           lightning(srco,origin)
           emit_sound(victim,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0,
   ATTN_NORM, 0, PITCH_NORM)
           new userHealth = get_user_health(victim) - damage
           if (damage <= 0)
                   set_user_health(victim, 0)
           else
                   set_user_health(victim, userHealth)
           console_print(id,"^"%s^" hath been smote", name)
   }
   public smite(id,level,cid) {
           if (!cmd_access(id,level,cid,2))
                   return PLUGIN_HANDLED
           new arg[32]
           read_argv(1,arg,31)
           new player = cmd_target(id,arg,5)
           if (!player) return PLUGIN_HANDLED
           new arg2[32]
           read_argv(2,arg2,31)
           damage = strtonum(arg2)
           smite_player(id,player)
           return PLUGIN_HANDLED
   }
   public plugin_precache(){
           light = precache_model("sprites/lgtning.spr")
           smoke = precache_model("sprites/steam1.spr")
           precache_sound( "ambience/thunder_clap.wav")
           return PLUGIN_CONTINUE
   }
   public plugin_init() {
           register_plugin("Admin Smite","1.0","Gastro")
           register_concmd("smite","smite",ADMIN_CFG,"<authid,      nick,
   @team or #userid> [smitedam]")
           return PLUGIN_CONTINUE
   }
   lightning(vec1[3],vec2[3]) {
           //Lightning
           message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
           write_byte( 0 )
           write_coord(vec1[0])
           write_coord(vec1[1])
           write_coord(vec1[2])
           write_coord(vec2[0])
           write_coord(vec2[1])
           write_coord(vec2[2])
           write_short( light )
           write_byte( 1 ) // framestart
           write_byte( 5 ) // framerate
           write_byte( 2 ) // life
           write_byte( 20 ) // width
           write_byte( 30 ) // noise
           write_byte( 200 ) // r, g, b
           write_byte( 200 ) // r, g, b
           write_byte( 200 ) // r, g, b
           write_byte( 200 ) // brightness
           write_byte( 200 ) // speed
           message_end()
           //Sparks
           message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
           write_byte( 9 )
           write_coord( vec2[0] )
           write_coord( vec2[1] )
           write_coord( vec2[2] )
           message_end()
           //Smoke
           message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
           write_byte( 5 )
           write_coord(vec2[0])
           write_coord(vec2[1])
           write_coord(vec2[2])
           write_short( smoke )
           write_byte( 10 )
           write_byte( 10 )
           message_end()
   }
