AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HE Damage Sound... Changeable sound path (https://forums.alliedmods.net/showthread.php?t=84461)

ilham92-cc-sakura 01-26-2009 11:18

HE Damage Sound... Changeable sound path
 
How to edit this... use "hesnd.ini" for user can change their won HE Damage sound... by i create this plugins until now... still can't!

Let say in "hesnd.ini"
Code:

; HE Damage Sound Configuration File
; ----------------------------------
; Do not start path with "sound/"
; SND1 for Sound Event 1
; SND2 for Sound Event 2
; Be sure sound file with [*.wav] file extension!
; ----------------------------------
"SND1" "player/player_listen.wav"
"SND2" "player/breathe1noloop.wav"

Here:
PHP Code:

/*
        I'm hurt! HE make me can't listen for while!

        Extra stuff for Grenade Enhancer by anakin_cstrike
        
        This plugins will play sound when HE throw and player get
        damage from HE. Hurt Sound will be played.
        
        More real style HE damage like Half-Life 2 and Call of Duty 4
        Download: http://forums.alliedmods.net/showthread.php?p=651536
        
        © Copyright 2008 ANiME clan.
        Visit: http://ilham92-cc-sakura.webs/
    Under License GNU
    
    English help by: [ANiME|ADMiN][5hp-Evolution]
    Created by: [ANiME|ADMiN][Ilham Sakura] aka ilham92-cc-sakura
    Scripting Help: SnoW (Damage Event)
    Scripting Help: Tuty (Stock)

*/

#include <amxmodx>
#include <fakemeta>
#include <csx>

#define SND1 "player/player_listen.wav"
#define SND2 "player/breathe1noloop.wav"
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

new amx_pcvar_0;

public 
plugin_init()
{
    
register_plugin("HE Player Damage Snd""1.0","ilham92-cc-sakura");
    
amx_pcvar_0 register_cvar("he_hit_respawn","1");
}
public 
plugin_precache()
{
    
precache_sound(SND1);
    
precache_sound(SND2);
}
public 
client_damage(attacker,victim,damage,wpnindex,hitplace,TA)
{
    if(
get_pcvar_num(amx_pcvar_0) != && wpnindex != CSW_HEGRENADE)
        return 
PLUGIN_HANDLED;
    
    new 
sound1[129];
    
copy(sound1,128,SND1);

    if(
contain(sound1,".wav"))
    {
        
replace(sound1,128,".wav","");
        
client_cmd(victim"spk %s",sound1);
    }

    new 
sound2[131];
    
copy(sound2,130,SND2);

    if(
contain(sound2,".wav"))
    {
        
replace(sound1,130,".wav","");
        
client_cmd(victim"spk %s",sound2);
    }

    new 
pl_name[32];
    
get_user_name(victim,pl_name31);
    
    
client_cmd(victim"say ^"Damn itHE Grenade Hit Me!^"");
    
client_print(0print_chat"[Grenade]: At who trow grenade. %s! it is time for a payback",pl_name);
    
    if(
get_user_team(victim) == 1)
    {
        
fm_give_item(victim"weapon_knife");
        
fm_give_item(victim"weapon_mp5navy");
        
fm_give_item(victim"item_kevlar");
        
fm_give_item(victim"ammo_9mm");
        
fm_give_item(victim"ammo_9mm");
        
fm_give_item(victim"ammo_9mm");
        
fm_give_item(victim"ammo_9mm");
    }
    if(!
is_user_alive(victim))
    {
        
set_task(0.6,"respawnagain",victim);
        
client_print(0print_chat"[Grenade]: HE kill %s and respwan.",pl_name);
        
client_cmd(victim"say ^"I will get you for my revenge!^"");
    }
    return 
PLUGIN_CONTINUE;
}
public 
respawnagain(victim)
{
    
fm_cs_user_spawn(victim);
}
stock fm_cs_user_spawn(index)
{
    
set_pev(indexpev_deadflagDEAD_RESPAWNABLE);
    
dllfunc(DLLFunc_Spawnindex);
    
set_pev(indexpev_iuser10);

    return 
1;
}
stock fm_give_item(index, const item[])
{
    if (!
equal(item"weapon_"7) && !equal(item"ammo_"5) && !equal(item"item_"5) && !equal(item"tf_weapon_"10))
        return 
0;

    new 
ent fm_create_entity(item);

    if (!
pev_valid(ent))
        return 
0;

    new 
Float:origin[3];
    
pev(indexpev_originorigin);
    
set_pev(entpev_originorigin);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);

    new 
save pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentindex);

    if (
pev(entpev_solid) != save)
        return 
ent;

    
engfunc(EngFunc_RemoveEntityent);
    return -
1;




All times are GMT -4. The time now is 01:49.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.