
   /*
   *    AMXMOD script.
   *    (amx_injured.sma)
   *    by Bringer <icq: 219323157>
   *    This file is provided as is (no warranties).
   *
   *    This plugin slows down players when they are hurt badly
   *
   */
   #include <amxmod>
   #include <amxmisc>
   #define MAX_NAME_LENGTH 32
   #define MAX_VAR_LENGTH 64
   #define MAX_PLAYERS 32
   #define MAX_TEXT_LENGTH 512
   /************************************************************
   * MAIN
   ************************************************************/
   public event_slowdown()
   {
       new  Float:slowspeed  =  160.0 //Speed for players with 20 or less
   health
       new Float:medslowspeed = 110.0 //Speed for players with 10 or less
   health
       new  Float:reallyslowspeed  =  90.0  //Speed for players with 2 or
   less health

       new iPlayer, iPlayers[MAX_PLAYERS], iNumPlayers
       get_players(iPlayers,iNumPlayers,"a")
       for (new i = 0; i < iNumPlayers; i++) {
           iPlayer = iPlayers[i]

           if(get_user_health(iPlayer) < 3) {
               set_user_maxspeed(iPlayer,reallyslowspeed)
           }
           else if(get_user_health(iPlayer) < 11) {
               set_user_maxspeed(iPlayer,medslowspeed)
           }
           else if(get_user_health(iPlayer) < 21)
           {
               set_user_maxspeed(iPlayer,slowspeed)
           }
       }
   }
   /************************************************************
   * PLUGIN FUNCTIONS
   ************************************************************/
   public plugin_init()
   {
       register_plugin("AMX Slow Down Injured Players","1.0","Bringer")
       set_task(1.0,"event_slowdown",0,"",0,"b")
       return PLUGIN_CONTINUE
   }
