Hi all, I have almost finished modifying DarkGL onlyhs plugin.
This is a version that make different damage according to the weapon and armor of the victim.
The problem is that when a player is killed no "dink" sound is made.
I'm trying with
PHP Code:
EmitSoundToClient(victim, "Player.DeathHeadShot");
EmitSoundToClient(attacker, "Player.DeathHeadShot");
but it doesn't work.
Could you help me?
I leave the rest of the code down here
PHP Code:
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &weapon, float damageForce[3], float damagePosition[3], int damagecustom){
if( !IsClientValid( victim ) || !IsClientValid( attacker ) ){
return Plugin_Continue;
}
if( aimOn[ attacker ] ){
char sWeapon[32];
GetClientWeapon(attacker, sWeapon, sizeof(sWeapon));
int iHelmet = GetEntProp(victim, Prop_Send, "m_bHasHelmet");
if (iHelmet == 1){
if( strncmp(sWeapon, "weapon_ak47",strlen("weapon_ak47"))== 0){
damagetype = CS_DMG_HEADSHOT;
EmitSoundToClient(victim, "Player.DeathHeadShot");
EmitSoundToClient(attacker, "Player.DeathHeadShot");
damage = 111.0;
}
if( strncmp(sWeapon, "weapon_glock",strlen("weapon_glock"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 55.0;
}
if( strncmp(sWeapon, "weapon_deagle",strlen("weapon_deagle"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 132.0;
}
if( strncmp(sWeapon, "weapon_m4a1_silencer",strlen("weapon_m4a1_silencer"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 92.0;
}
if( strncmp(sWeapon, "weapon_m4a1",strlen("weapon_m4a1"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 92.0;
}
if( strncmp(sWeapon, "weapon_usp_silencer",strlen("weapon_usp_silencer"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 70.0;
}
if( strncmp(sWeapon, "weapon_fiveseven",strlen("weapon_fiveseven"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 115.0;
}
if( strncmp(sWeapon, "weapon_p250",strlen("weapon_p250"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 96.0;
}
if( strncmp(sWeapon, "weapon_cz75a",strlen("weapon_cz75a"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 95.0;
}
}
else {
if( strncmp(sWeapon, "weapon_ak47",strlen("weapon_ak47"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 146.0;
}
if( strncmp(sWeapon, "weapon_glock",strlen("weapon_glock"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 101.0;
}
if( strncmp(sWeapon, "weapon_deagle",strlen("weapon_deagle"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 149.0;
}
if( strncmp(sWeapon, "weapon_m4a1_silencer",strlen("weapon_m4a1_silencer"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 131.0;
}
if( strncmp(sWeapon, "weapon_m4a1",strlen("weapon_m4a1"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 131.0;
}
if( strncmp(sWeapon, "weapon_usp_silencer",strlen("weapon_usp_silencer"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 121.0;
}
if( strncmp(sWeapon, "weapon_fiveseven",strlen("weapon_fiveseven"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 107.0;
}
if( strncmp(sWeapon, "weapon_p250",strlen("weapon_p250"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 151.0;
}
if( strncmp(sWeapon, "weapon_cz75a",strlen("weapon_cz75a"))== 0){
damagetype = CS_DMG_HEADSHOT;
damage = 123.0;
}
}
return Plugin_Changed;
}
return Plugin_Continue;
}