finding a way to make ultimatesounds count kills with spells from mods like war3ft
ultimatesounds doesn't count kills made with magic (war3ftmod, superhero, zombie etc.), i'm tring to fix it.
here's my public death event from ultimate sounds
Code:
public event_death(id) {
new killer = read_data(1);
new victim = read_data(2);
new headshot = read_data(3);
new weapon[24], vicname[32], killname[32]
read_data(4,weapon,23)
get_user_name(victim,vicname,31)
get_user_name(killer,killname,31)
g_died[victim] = true
if(headshot == 1 && get_pcvar_num(hsenable) ==1)
{
set_hudmessage(0, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, (hsmessages[random_num(0,3)]), killname, vicname)
new i
i = random_num(0,hsounds-1)
client_cmd(0,"spk %s",hslist[i])
}
if(weapon[0] == 'k' && get_pcvar_num(knifeenable) ==1)
{
set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, (knmessages[random_num(0,2)]), killname, vicname)
new r
r = random_num(0,knsounds-1)
client_cmd(0,"spk %s",knlist[r])
}
if(firstblood && killer!=victim && killer>0 && get_pcvar_num(firstbloodenable) ==1)
{
set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, (fbmessages[random_num(0,2)]), killname)
new t
t = random_num(0,fbsounds-1)
client_cmd(0,"spk %s",fblist[t])
firstblood = 0
}
if(weapon[1] == 'r' && get_pcvar_num(nadecvar) ==1)
{
set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0,(nademessages[random_num(0,2)]),killname,vicname)
client_cmd(0,"spk NyaKeN/nade")
}
if(killer == victim && get_pcvar_num(suicidecvar) ==1)
{
set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0,(suicidemess[random_num(0,1)]), vicname)
new z
z = random_num(0,suicidesounds-1)
client_cmd(0,"spk %s",suicidelist[z])
}
if(kill[killer][0] && equal(kill[killer],weapon) && get_pcvar_num(cvardouble) == 1)
{
set_hudmessage(255, 0, 255, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0,"Wow %s made a double kill", killname)
kill[killer][0] = 0;
new q
q= random_num(0,maxdbsounds-1)
client_cmd(0,"spk %s",doublelist[q])
}
if (get_pcvar_num(qs_hattrick) && killer != victim)
{
g_roundKills[killer] = g_roundKills[killer] + 1
topPlayer()
}
else
{
kill[killer] = weapon;
set_task(0.1,"clear_kill",TASK_CLEAR_KILL+killer);
}
kills[killer] += 1;
kills[victim] = 0;
deaths[killer] = 0;
deaths[victim] += 1;
for (new i = 0; i < LEVELS; i++)
{
if (kills[killer] == levels[i])
{
announce(killer, i);
return PLUGIN_CONTINUE;
}
}
return PLUGIN_CONTINUE;
}
and twokilling functions in war3ft
Code:
public WC3_Kill( iVictim, iKiller, iWeapon, iHeadshot )
{
new szWpnName[64], iRet = 0;
UTIL_GetWeaponName( iWeapon, szWpnName, 63 );
ExecuteForward( fwd_ReportKill, iRet, iKiller, iVictim, iWeapon, szWpnName );
// Save stats information?
if ( get_pcvar_num( CVAR_wc3_psychostats ) )
{
if ( CSW_WAR3_MIN <= iWeapon <= CSW_WAR3_MAX )
{
new iSkillWeapon = iWeapon - CSW_WAR3_MIN;
if ( SHARED_ValidPlayer( iKiller ) )
{
// Team kill
if ( get_user_team( iVictim ) == get_user_team( iKiller ) )
{
iStatsTKS[iKiller][iSkillWeapon]++;
}
// Random chance so some skills that aren't headshots have a chance
if ( ( iHeadshot || random_num( 0, 100 ) < 30 ) )
{
iStatsHS[iKiller][iSkillWeapon]++;
}
iStatsKills[iKiller][iSkillWeapon]++;
}
iStatsDeaths[iKiller][iSkillWeapon]++;
}
}
// Remove all ultimate icons since the user is going to be killed...
ULT_ClearIcons( iVictim );
new iVictimTeam = get_user_team( iVictim );
new iKillerTeam = get_user_team( iKiller );
// Create Death Message
if ( is_user_alive( iVictim ) )
{
// Kill Victim
WC3_KillUser( iVictim, iKiller, iWeapon );
// Update frags ( realtime )
new iVictimFrags = get_user_frags( iVictim ) + 1;
set_user_frags( iVictim, iVictimFrags );
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
new iVictimDeaths = get_user_deaths( iVictim );
Create_ScoreInfo( iVictim, iVictimFrags, iVictimDeaths, 0, iVictimTeam );
// Get the weapon name
new szWeaponName[32];
UTIL_GetWeaponName( iWeapon, szWeaponName, 31 );
Create_DeathMsg_CS( iKiller, iVictim, iHeadshot, szWeaponName );
}
else if ( g_MOD == GAME_DOD )
{
Create_DeathMsg_DOD( iKiller, iVictim, iWeapon );
}
}
// Call all war3 functions when the user dies
WC3_Death( iVictim, iKiller, iWeapon, iHeadshot );
// Award $300 for a Kill
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
// Make sure they're not on the same team
if ( iVictimTeam != iKillerTeam && iKiller != iVictim )
{
SHARED_SetUserMoney( iKiller, SHARED_GetUserMoney( iKiller ) + 300, 1 );
}
}
// Get the killer's frags
new iKillerFrags = get_user_frags( iKiller ) + 1;
// Team Kill
if ( iVictimTeam == iKillerTeam && iKiller != iVictim )
{
// Remove one from the killer's frags
iKillerFrags = get_user_frags( iKiller ) - 2; // (-2 since when we init'd it was +1)
set_user_frags( iKiller, iKillerFrags );
}
// Update frags ( realtime )
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
if ( is_user_alive( iKiller ) )
{
new iKillerDeaths = get_user_deaths( iKiller );
// If we don't do this then next round the number of kills will go back to what it was
set_user_frags( iKiller, iKillerFrags );
// Updates realtime
Create_ScoreInfo( iKiller, iKillerFrags, iKillerDeaths, 0, iKillerTeam );
}
}
// Log it so psychostats can pick the death up...
UTIL_LogDeath( iVictim, iKiller, iWeapon );
return;
}
Code:
ublic WC3_KillUser( iVictim, iKiller, iWeapon )
{
set_msg_block( gmsgDeathMsg, BLOCK_ONCE );
if ( g_MOD == GAME_CSTRIKE || g_MOD == GAME_CZERO )
{
user_kill( iVictim );
}
else if ( g_MOD == GAME_DOD )
{
dod_user_kill( iVictim );
entity_set_int( iVictim, EV_INT_deadflag, 1 ); // DEAD_DYING = 1
// This isn't triggered for DOD, so lets call it
on_Death( iVictim, iKiller, iWeapon, 0 );
}
}
and i thin when user_kill( iVictim ); is called ultimate sounds considers that user has commited suicide, i have a hard time thinking about all of that >_< i will very apriciate if you'd like to help me
my only idea atm is to put ult sounds plugin inside war3ft plugin and see what will happen =\
|