public forward_touch(toucher, touched) // This function is called every time a player touches another player.
{
// NOTE: The toucher is the player standing/falling on top of the other (touched) player's head.
if(!is_user_alive(toucher) || !is_user_alive(touched)) // The touching players can't be dead.
return;

if(!get_pcvar_num(amx_headsplash)) // If the plugin is disabled, stop messing with things.
return;

if(falling_speed[touched]) // Check if the touched player is falling. If he/she is, don't continue.
return;

if(get_user_team(toucher) == get_user_team(touched) && !get_cvar_num("mp_friendlyfire")) // If the touchers are in the same team and friendly fire is off, don't continue.
return;

new touched_origin[3], toucher_origin[3];
get_user_origin(touched, touched_origin); // Get the origins of the players so it's possible to check if the toucher is standing on the touched's head.
get_user_origin(toucher, toucher_origin);

new Float:toucher_minsize[3], Float:touched_minsize[3];
pev(toucher,pev_mins,toucher_minsize);
pev(touched,pev_mins,touched_minsize); // If touche*_minsize is equal to -18.0, touche* is crouching.

if(falling_speed[toucher] >= MINIMUM_FALL_SPEED) // If the toucher is falling in the required speed or faster, then landing on top of the touched's head, do some damage to the touched. MUHAHAHAHAHA!!!
{
new Float:damage = ((falling_speed[toucher] - MINIMUM_FALL_SPEED + 30) * (falling_speed[toucher] - MINIMUM_FALL_SPEED + 30)) / 1300;
if(damage > MAXIMUM_DAMAGE_FROM_JUMP) // Make shure that the touched player don't take too much damage.
damage = MAXIMUM_DAMAGE_FROM_JUMP;
damage_player(touched, toucher, damage); // Damage or kill the touched player.
damage_after[toucher][touched] = 0.0; // Reset.
}
if(is_user_alive(touched) && damage_after[toucher][touched] <= get_gametime()) // This makes shure that you won't get damaged every frame you have some one on your head. It also makes shure that players won't get damaged faster on fast servers than laggy servers.
{
damage_after[toucher][touched] = get_gametime() + DELAY;
damage_player(touched, toucher, DAMAGE); // Damage or kill the touched player.
}
}

public forward_PlayerPreThink(id) // This is called every time before a player "thinks". A player thinks many times per second.
{
//falling_speed[id] = entity_get_float(id, EV_FL_flFallVelocity); // Store the falling speed of the soon to be "thinking" player.
pev(id, pev_flFallVelocity, falling_speed[id])
}