Raised This Month: $51 Target: $400
 12% 

[ZP] Fire Sound Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MercedeSx7
Senior Member
Join Date: Feb 2012
Location: Serbia
Old 12-15-2012 , 06:47   [ZP] Fire Sound Help
Reply With Quote #1

Hi!
I have problem with fire sound
Can someone help

PHP Code:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <zombieplague>

new const PLUGIN[] = "[ZP] Extra Item: Salamander";
new const 
VERSION[] = "1.0";
new const 
AUTHOR[] = "MercedeS";

#define is_valid_player(%1) (1 <= %1 <= 32)

new v_salamander[64] = "models/HalloWeeN_TowN/v_salamander.mdl";
new 
p_salamander[64] = "models/HalloWeeN_TowN/p_salamander.mdl";
new 
w_salamander[64] = "models/HalloWeeN_TowN/w_salamander.mdl";

new const 
salamander_shoot[] = {"weapons/flamegun-1.wav"};

new 
bool:has_salamander[33];
new 
g_item_salamander;
new 
cvar_damage_multiplier;
 
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
g_item_salamander zp_register_extra_item("Salamander"10ZP_TEAM_HUMAN);
    
register_event("CurWeapon""event_CurWeapon""be""1=1");
    
register_forward(FM_SetModel"fw_SetModel");
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
    
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m249""fw_PrimaryAttack_Post"1)
    
    
// Damage multiplier
    
cvar_damage_multiplier register_cvar("zp_salamander_damage_multiplier""3");
}

public 
client_connect(id)
{
    
has_salamander[id] = false;
}

public 
client_disconnect(id)
{
    
has_salamander[id] = false;
}

public 
zp_user_infected_post(id)
{
    if (
zp_get_user_zombie(id))
    {
        
has_salamander[id] = false;
    }
}

public 
zp_user_humanized_post(id)
{
    
has_salamander[id] = false;
}

public 
plugin_precache()
{
    
precache_model(v_salamander);
    
precache_model(p_salamander);
    
precache_model(w_salamander);
    
    
precache_sound(salamander_shoot);
}

public 
zp_extra_item_selected(iditemid)
{
    if(
itemid == g_item_salamander)
    {
        
give_item(id"weapon_m249");
        
cs_set_user_bpammo (idCSW_M249200);
        
has_salamander[id] = true;
    }
}

public 
event_CurWeapon(id)
{
    if (
zp_get_user_zombie(id))
        return 
PLUGIN_HANDLED;
        
    new 
wpn read_data(2);    
    if (
wpn == CSW_M249 && has_salamander[id])
    {
        
set_pev(idpev_viewmodel2v_salamander);
        
set_pev(idpev_weaponmodel2p_salamander);
    }
    return 
PLUGIN_HANDLED
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if (
is_valid_player(attacker) && get_user_weapon(attacker) == CSW_UMP45 && has_salamander[attacker])
    {
        
SetHamParamFloat(4damage get_pcvar_float(cvar_damage_multiplier));
    }
}

public 
fw_SetModel(entitymodel[])
{
    if(!
is_valid_ent(entity))
        return 
FMRES_IGNORED;
        
    static 
szClassName[33];
    
entity_get_string(entityEV_SZ_classnameszClassNamecharsmax(szClassName));
    
    if(!
equal(szClassName"weaponbox"))
        return 
FMRES_IGNORED;
        
    static 
iOwner;
    
iOwner entity_get_edict(entityEV_ENT_owner);
    
    if(
equal(model"models/w_m249.mdl"))
    {
        static 
iStoredSVDID;
        
iStoredSVDID find_ent_by_owner(-1"weapon_m249"entity);
        
        if(!
is_valid_ent(iStoredSVDID))
            return 
FMRES_IGNORED;
            
        if(
has_salamander[iOwner])
        {
            
entity_set_int(iStoredSVDIDEV_INT_impulse1);
            
has_salamander[iOwner] = false;
            
entity_set_model(entityw_salamander);
            return 
FMRES_SUPERCEDE;
        }
    }
    return 
FMRES_IGNORED;
}

public 
fw_PrimaryAttack_Post(Weapon)
{
    new 
Player get_pdata_cbase(Weapon414);
    
    new 
szClipszAmmo;
    
get_user_weapon(PlayerszClipszAmmo);
    
    if (
has_salamander[Player])
    {
        if (
szClip 0)
        {
            
emit_sound(PlayerCHAN_WEAPONsalamander_shootVOL_NORMATTN_NORM0PITCH_NORM);
        }
    }

__________________
MercedeSx7 is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 12-15-2012 , 08:02   Re: [ZP] Fire Sound Help
Reply With Quote #2

Code:
    if (has_salamander[Player]) 
    { 
        if (szClip > 0) 
        { 
            emit_sound(Player, CHAN_WEAPON, salamander_shoot, VOL_NORM, ATTN_NORM, 0, PITCH_NORM); 
        } 
    }
Code:
    if (has_salamander[Player] && (szClip > 0)) 
        emit_sound(Player, CHAN_WEAPON, salamander_shoot, 1.0, ATTN_NORM, 0, PITCH_NORM);

Last edited by TheDS1337; 12-15-2012 at 08:04.
TheDS1337 is offline
artos
Senior Member
Join Date: Mar 2010
Old 12-15-2012 , 17:34   Re: [ZP] Fire Sound Help
Reply With Quote #3

You can't change weapon fire sound because it's client side. If you realy want new weapon in CS 1.6, you must do everything from a scratch, or use this: http://forums.alliedmods.net/showthread.php?t=181283
__________________
artos is offline
Send a message via Skype™ to artos
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:41.


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