Raised This Month: $ Target: $400
 0% 

Help with the sound


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 03-03-2010 , 17:26   Help with the sound
#1

Okey im getting tierd of this ripp now....


The only thing i wanted to do was;

1. Change the name. (DONE)
2. Change the effects. (DONE)
3. Change the sound. (..)



I've tried awhile adding the freekin sound but it just wont.
I've tried to replace "my" sound with other custom sounds, but no.
The default (Electro) sound, wich is hl1, does works fine.

so its basically just a problem with the custom sound...

It precaches the sound, but i hear nothing when i use the power.


(I did just edit the sound location.. i also tried to precache the sound other ways. But no)

Here's the... "Electro" but.. with, my name and settings.

(i think this is the proper one)

PHP Code:
// Chidori! - From naruto animé

/* CVARS - copy and paste to shconfig.cfg

//Chidori
chidori_level 0
chidori_cooldown 45        //# of seconds for cooldown between use (Default 45)
chidori_searchtime 45        //# of seconds to search for a victim when key is pressed (Default 45)
chidori_maxdamage 50        //Damage on first victim, amount is decreased each jump by decay rate (Default 50)
chidori_jumpdecay 0.66        //Decay rate for damage and sprite line width each lightning jump (Default 0.66)
chidori_jumpradius 500        //Radius to search for a lightning jump (Default 500)

*/

/*
*  
*  Ripp by Viktor B.N. 
*  
*  Used: Electro(AssKicR).
*  
*  2010
*/

#include <superheromod>

#define LINE_WIDTH 80

// GLOBAL VARIABLES
new gHeroID
new bool:gHasChidori[SH_MAXSLOTS+1]
new 
bool:gLightningHit[SH_MAXSLOTS+1]
new 
bool:gIsSearching[SH_MAXSLOTS+1]
new const 
gSoundSearch[] = "turret/tu_ping.wav"
new const gSoundLightning[] = "shmod/chidori.wav"
new gSpriteLightning
new gPcvarCooldowngPcvarSearchTimegPcvarMaxDamagegPcvarJumpDecaygPcvarJumpRadius
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Sasuke's Chidori""1.0""AssKicR/Viktor B.N.")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("chidori_level""1")
    
gPcvarCooldown register_cvar("chidori_cooldown""30")
    
gPcvarSearchTime register_cvar("chidori_searchtime""60")
    
gPcvarMaxDamage register_cvar("chidori_maxdamage""50")
    
gPcvarJumpDecay register_cvar("chidori_jumpdecay""0.88")
    
gPcvarJumpRadius register_cvar("chidori_jumpradius""1500")

    
// FIRE THE EVENTS TO CREATE THIS SUPERHERO!
    
gHeroID sh_create_hero("Sasuke's Chidori"pcvarLevel)
    
sh_set_hero_info(gHeroID"Chidori Jutsu""This jutsu channels a large amount of lightning chakra to the user's hand.")
    
sh_set_hero_bind(gHeroID)

    
register_forward(FM_TraceLine"fm_TraceLine")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_sound(gSoundSearch)
    
precache_sound(gSoundLightning)
    
gSpriteLightning precache_model("sprites/lgtning.spr")
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return

    
gHasChidori[id] = mode true false
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    
gPlayerInCooldown[id] = false
    gIsSearching
[id] = false
    gLightningHit
[id] = false

    remove_task
(id)
}
//----------------------------------------------------------------------------------------------
public sh_hero_key(idheroIDkey)
{
    if ( 
gHeroID != heroID || sh_is_freezetime() ) return
    if ( !
is_user_alive(id) || !gHasChidori[id] ) return

    if ( 
gIsSearching[id] ) return

    if ( 
key == SH_KEYDOWN )
    {
        
// Let them know they already used their ultimate if they have
        
if ( gPlayerInCooldown[id] )
        {
            
sh_sound_deny(id)
            return
        }

        
gIsSearching[id] = true

        
new parm[2]
        
parm[0] = id
        parm
[1] = get_pcvar_num(gPcvarSearchTime)
        
chidori_search(parm)
    }
}
//----------------------------------------------------------------------------------------------
public chidori_search(parm[2])
{
    new 
id parm[0]
    new 
timeLeft parm[1]

    
// Decrement our timer
    
parm[1]--

    
// User died or diconnected
    
if ( !is_user_alive(id) || !gHasChidori[id] )
    {
        
gIsSearching[id] = false
    
}

    
// This is the last "playing" of the sound, no target was found :/
    
if ( timeLeft == )
    {
        
gIsSearching[id] = false
    
}

    
// Then we need to play the sound + flash their icon!
    
if ( gIsSearching[id] )
    {
        
// Play the ping sound
        
emit_sound(idCHAN_STATICgSoundSearch1.0ATTN_NORM0PITCH_NORM)

        
set_task(1.0"chidori_search"idparm2)
    }
}
//----------------------------------------------------------------------------------------------
public fm_TraceLine(Float:v1[3], Float:v2[3], const noMonsters, const pentToSkip)
{
    if ( !
sh_is_active() ) return FMRES_IGNORED

    
new victim get_tr(TR_pHit)
    if ( !
is_user_alive(victim) ) return FMRES_IGNORED

    
//new attacker = pentToSkip
    
if ( !is_user_alive(pentToSkip) || !gHasChidori[pentToSkip] || !gIsSearching[pentToSkip] ) return FMRES_IGNORED
    
if ( cs_get_user_team(pentToSkip) == cs_get_user_team(victim) ) return FMRES_IGNORED

    
new damage get_pcvar_num(gPcvarMaxDamage)

    
chidori_attack(victimpentToSkipdamageLINE_WIDTHpentToSkip)

    new 
Float:seconds get_pcvar_float(gPcvarCooldown)
    if ( 
seconds 0.0 sh_set_cooldown(pentToSkipseconds)

    
gIsSearching[pentToSkip] = false

    
// Now we need to search for the next "jump"
    
new parm[4]
    
parm[0] = victim
    parm
[1] = damage
    parm
[2] = LINE_WIDTH
    parm
[3] = pentToSkip

    set_task
(0.2"chidori_jump_check"pentToSkipparm4)

    return 
FMRES_IGNORED
}
//----------------------------------------------------------------------------------------------
public chidori_jump_check(parm[4])
{
    
// parm[0] = victim
    // parm[1] = damage
    // parm[2] = linewidth
    // parm[3] = attacker

    
new lastVictim parm[0]
    new 
players[32], numberofplayersi
    get_players
(playersnumberofplayers"a")

    new 
Float:decay get_pcvar_float(gPcvarJumpDecay)

    
// Damage should be decreased on each jump
    
new damage floatround(parm[1] * decay)

    if ( 
is_user_connected(lastVictim) && damage )
    {
        new 
lvOrigin[3]
        
get_user_origin(lastVictimlvOrigin)

        new 
attacker parm[3]
        new 
CsTeams:attackerTeam cs_get_user_team(attacker)

        new 
targetclosestTargetclosestDistance
        
new distancetargetOrigin[3]
        new 
radius get_pcvar_num(gPcvarJumpRadius)

        
// Loop through every alive player
        
for ( 0numberofplayersi++ )
        {
            
target players[i]

            if ( 
target == attacker ||  target == lastVictim ) continue
            if ( 
gLightningHit[target] ) continue

            
// Make sure our target player isn't on the same team!
            
if ( cs_get_user_team(target) != attackerTeam )
            {
                
get_user_origin(targettargetOrigin)

                
distance get_distance(lvOrigintargetOrigin)

                
// Verify the user is within range
                
if ( distance <= radius )
                {
                    
// This user is closest!! Lets make a note of this...
                    
if ( distance closestDistance || !closestTarget )
                    {
                        
closestDistance distance
                        closestTarget 
target
                    
}
                }
            }
        }

        if ( 
closestTarget )
        {
            
// Then we have a valid target!!!

            // Decrease line width as well
            
new lineWidth floatround(parm[2] * decay)

            
// Display the actual lightning
            
chidori_attack(closestTargetattackerdamagelineWidthlastVictim)

            
// Lets call this again on our next target!
            
parm[0] = closestTarget
            parm
[1] = damage
            parm
[2] = lineWidth
            set_task
(0.2"chidori_jump_check"attackerparm4)

            return
        }
    }

    
// No valid target found - reset all lightning hit variables
    
for ( 0numberofplayersi++ )
    {
        
gLightningHit[players[i]] = false
    
}
}
//----------------------------------------------------------------------------------------------
chidori_attack(const victim, const attacker, const damage, const linewidth, const beamStartID)
{
    
// Make sure we set this user as hit, otherwise we'll hit him again
    
gLightningHit[victim] = true

    
// Get the target's origin
    
new Float:beamOrigin[3]
    
pev(beamStartIDpev_originbeamOrigin)

    
// Damage the user
    
sh_extra_damage(victimattackerdamage"chain lightning"0SH_DMG_NORMtruefalsebeamOrigin)

    
// Create the lightning
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMENTS)
    
write_short(beamStartID)// start entity
    
write_short(victim)    // entity
    
write_short(gSpriteLightning)    // model
    
write_byte(0)        // starting frame
    
write_byte(15)        // frame rate
    
write_byte(50)        // life
    
write_byte(150)    // linewidth
    
write_byte(10)        // noise amplitude
    
write_byte(105)        // r, g, b
    
write_byte(105)        // r, g, b
    
write_byte(255)        // r, g, b 125
    
write_byte(60)        // brightness 175
    
write_byte(0)        // scroll speed
    
message_end()

    
// Get the victim's origin
    
new vicOrigin[3]
    
get_user_origin(victimvicOrigin)

    
// Create an elight on the target
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_ELIGHT)
    
write_short(victim)    // entity
    
write_coord(vicOrigin[0])  // initial position
    
write_coord(vicOrigin[1])  // initial position
    
write_coord(vicOrigin[2])  // initial position
    
write_coord(10)    // radius
    
write_byte(0)        // r, g, b
    
write_byte(0)        // r, g, b
    
write_byte(255)        // r, g, b
    
write_byte(10)        // life
    
write_coord(0)        // decay rate
    
message_end()

    
// Play the lightning sound
    
emit_sound(beamStartIDCHAN_STATICgSoundLightning1.0ATTN_NORM0PITCH_NORM)
}
//---------------------------------------------------------------------------------------------- 

Note that i also tried
PHP Code:
precache_sound("shmod/chidori.wav"


Thanks.
__________________




Quote:
Originally Posted by wrecked_ View Post
Stop saying words before I sodomize you with a cucumber.
kanatzu is offline
Send a message via MSN to kanatzu
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-03-2010 , 18:08   Re: Help with the sound
#2

Try to use CHAN_NORM instead of CHAN_STATIC.

Don't know if it works.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-03-2010 , 18:19   Re: Help with the sound
#3

Your sound file may not be properly formatted to work in HL (CS)... You may need to convert it.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-03-2010 , 18:27   Re: Help with the sound
#4

Quote:
Originally Posted by kanatzu View Post
I've tried to replace "my" sound with other custom sounds, but no.
The default (Electro) sound, wich is hl1, does works fine.
The way I read it, he already did that. Am I right?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 03-03-2010 , 20:55   Re: Help with the sound
#5

Quote:
Originally Posted by vittu View Post
Your sound file may not be properly formatted to work in HL (CS)... You may need to convert it.
Yes the file is working correctly.

Quote:
Originally Posted by Jelle View Post
Try to use CHAN_NORM instead of CHAN_STATIC.

Don't know if it works.
I get one error and billions of warnings
__________________




Quote:
Originally Posted by wrecked_ View Post
Stop saying words before I sodomize you with a cucumber.
kanatzu is offline
Send a message via MSN to kanatzu
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 03-03-2010 , 21:30   Re: Help with the sound
#6

Quote:
Originally Posted by kanatzu View Post
Yes the file is working correctly.
Are you sure?

Go in game, open console, type spk "shmod/chidori.wav" and press enter.
If you don't hear the sound there is no way it will play and you need to convert it to some other format probably lower quality like 8bit mono.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
kanatzu
Veteran Member
Join Date: Oct 2007
Location: Sweden
Old 03-03-2010 , 23:57   Re: Help with the sound
#7

Terrible sorry, my mistake!

Works fine now.


Trash or lock or... whatever! Thanks vittu and Jelle, salute
__________________




Quote:
Originally Posted by wrecked_ View Post
Stop saying words before I sodomize you with a cucumber.
kanatzu is offline
Send a message via MSN to kanatzu
Closed Thread



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 10:51.


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