#include <amxmodx>
#include <fakemeta>
#include <cstrike>
//#include < fun >
#define PLUGIN_VERSION "1.4"
//STANDING
#define DELAY 10.0
new g_mDeathMsg, g_mScoreAttrib
new Float:falling_speed[33];
new Float:damage_after[33][33];
new ownagelist[][] =
{
"ownagegrid.wav", "mario.wav", "ownage.wav"
}
public plugin_init()
{
register_plugin("Head Splash", PLUGIN_VERSION, "potatis_invalido");
register_forward(FM_Touch, "forward_touch");
g_mDeathMsg = get_user_msgid( "DeathMsg" );
g_mScoreAttrib = get_user_msgid( "ScoreAttrib" );
}
public plugin_precache()
{
precache_sound("ownagegrid.wav");
precache_sound("mario.wav");
precache_sound("ownage.wav")
}
public forward_touch(toucher, touched)
{
if(!is_user_alive(toucher) || !is_user_alive(touched))
return;
if(falling_speed[touched])
return;
if(get_user_team(toucher) == get_user_team(touched) && !get_cvar_num("mp_friendlyfire"))
return;
new touched_origin[3], toucher_origin[3];
get_user_origin(touched, touched_origin);
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(touched_minsize[2] != -18.0)
{
if(!(toucher_origin[2] == touched_origin[2]+72 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+54 && toucher_minsize[2] == -18.0))
{
return;
}
}
else
{
if(!(toucher_origin[2] == touched_origin[2]+68 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+50 && toucher_minsize[2] == -18.0))
{
return;
}
}
if(is_user_alive(touched) && damage_after[toucher][touched] <= get_gametime())
{
damage_after[toucher][touched] = get_gametime() + DELAY;
new CsTeams:Team = cs_get_user_team(toucher)
switch(Team)
{
case CS_TEAM_T:
{
//client_cmd(0, "spk sound/mario.wav")
client_cmd(0,"spk sound/%s",ownagelist[random(sizeof ownagelist)]);
MakeDeathMsg(touched, toucher);
}
case CS_TEAM_CT:
{
//client_cmd(0, "spk sound/mario.wav");
}
}
damage_after[toucher][touched] = get_gametime() + DELAY;
}
}
stock MakeDeathMsg( iVictim, iAttacker)
{
message_begin( MSG_BROADCAST, g_mDeathMsg );
write_byte( iAttacker );
write_byte( iVictim );
write_byte( 0 );
write_string( "tracktrain" );
message_end();
message_begin( MSG_BROADCAST, g_mScoreAttrib );
write_byte( iVictim );
write_byte( 0 );
message_end();
}