I suck at explaining things, so try this:
Code:
#include <amxmodx>
#include <fun>
public plugin_init()
{
register_event("Damage", "Event_Damage", "b", "2!0");
register_event("CurWeapon", "Event_CurWeapon", "be");
register_event("ResetHUD", "Event_ResetHUD", "b");
}
#define MIN_DAMAGE 25
// minimum amount of damage before player slows down
#define SLOW_SPEED 200.0
// max speed of injured players
new bool:g_bSlow[33] = { false, ... };
public client_connect( id )
g_bSlow[id] = false;
public Event_Damage( id )
{
new dmg = read_data(2); // get the damage recieved
// if the damage is greater than or equal to the defined value..
if(dmg >= MIN_DAMAGE)
{
set_user_maxspeed(id, SLOW_SPEED); // set his maxspeed
g_bSlow[id] = true; // set the bool to true
}
}
public Event_CurWeapon( id )
{
// if the bool is true..
if(g_bSlow[id] == true)
set_user_maxspeed(id, SLOW_SPEED); // set his speed
}
public Event_ResetHUD( id )
g_bSlow[id] = false; // set the bool to false when the player spawns again
__________________