
   #include <amxmod>
   // Mod specific code
   // Edit if you don't run Counter-Strike
   //
   #define TEAMS 2         // The number of teams
   new teams[TEAMS][] = {  // The team names
       "TERRORIST",
       "CT"
   }
   //
   // End of mod specific code
   #define DELAY 20.0           // Check for AFK players after x seconds
   #define ADMINS_IMMUNE false  // Don't kill admins
   new spawn_origins[33][3]
   new kill = false
   public allow_kill(){
       kill = true
   }
   public event_roundtime(id){
       if    (floatround(get_cvar_float("mp_roundtime")    *   60.0)   ==
   read_data(1)){
           get_user_origin(id,spawn_origins[id])
       }
   }
   public event_roundtime2(){
       if    (floatround(get_cvar_float("mp_roundtime")    *   60.0)   ==
   read_data(1)){
           remove_task(0)
           kill = false
           set_task(DELAY,"allow_kill")
           set_task(DELAY + 1,"event_deathmsg")
       }
   }
   public event_deathmsg(){
       if (!kill){
           return
       }
       new players[32]
       new num
       new origin[3]
       new name[32]
       new i,j,k
       for (i=0; i < TEAMS; i++){
           get_players(players,num,"ae",teams[i])
           for (j=0; j < num; j++){
               get_user_origin(players[j],origin)
               if (origin[0] == spawn_origins[players[j]][0] && origin[1]
   ==       spawn_origins[players[j]][1]       &&       origin[2]      ==
   spawn_origins[players[j]][2]){
                   if (j == num - 1){
                       for (k=0; k < num; k++){
                           if (ADMINS_IMMUNE &&
   get_user_flags(players[k])&ADMIN_IMMUNITY){
                               continue
                           } else {
                               user_kill(players[k],1)
                               get_user_name(players[k],name,31)
                               client_print(0,print_chat,"*     %s    was
   AFK",name)
                           }
                       }
                   }
               } else {
                   break
               }
           }
       }
   }
   public plugin_init(){
       register_plugin("AFK Slayer","0.4c","-X.Soul")
       register_event("DeathMsg","event_deathmsg","a")
       register_event("RoundTime","event_roundtime","b")
       register_event("RoundTime","event_roundtime2","bc")
       return PLUGIN_CONTINUE
   }
