Raised This Month: $ Target: $400
 0% 

sound emiting


Post New Thread Reply   
 
Thread Tools Display Modes
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-03-2009 , 16:20   Re: sound emiting
Reply With Quote #11

alan_el_more

Works like a charm.

But 1 small problem when i press go the sounds goes blah blah is it possible to make that when one sound plays then plays another ? becouse now when i go the sounds go blah blah
DoviuX is offline
Send a message via Skype™ to DoviuX
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-04-2009 , 07:09   Re: sound emiting
Reply With Quote #12

Define "go blah blah", mate.
vitorrd is offline
3Di
Member
Join Date: Sep 2009
Location: #php_title
Old 10-04-2009 , 11:13   Re: sound emiting
Reply With Quote #13

He means, whenever he walks one sound constantly plays; until he stops moving. Clearly, he wants to have it play one sound per step.
3Di is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-04-2009 , 14:06   Re: sound emiting
Reply With Quote #14

Is it possible to make that ?
DoviuX is offline
Send a message via Skype™ to DoviuX
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-04-2009 , 14:22   Re: sound emiting
Reply With Quote #15

PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >

// Note: There must be the same amount of sounds in each
// If you don't want to use all of them for each, leave them with ""
new const g_szSoundsCsTeams ][ ][ ] = 
{
    
// Don't use
    
{
        
"",
        
"",
        
"",
        
""
    
},
    
// Terrorist Steps
    
{
        
"UmbrellaSwarm/Tank/TankWalk1.wav",
        
"UmbrellaSwarm/Tank/TankWalk2.wav",
        
"UmbrellaSwarm/Tank/TankWalk3.wav",
        
"UmbrellaSwarm/Tank/TankWalk4.wav"
    
},
    
// Counter-Terrorist Steps
    
{
        
"",
        
"",
        
"",
        
""
    
},
    
// Spectator Steps
    
{
        
"",
        
"",
        
"",
        
""
    
}
};

new 
g_iTotalSoundsCsTeams ];

#define IN_MOVE ( IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT )

new g_iSoundNum33 ];
new 
CsTeams:g_iSoundTeam33 ];
new 
flTimeStepSound33 ];

public 
plugin_precache( ) {
    for( new 
CsTeams:iTeamiiTeam CsTeamsiTeam++ ) {
        for( 
0sizeofg_szSounds[ ] ); i++ ) {
            if( 
g_szSoundsiTeam ][ ][ ] ) {
                
precache_soundg_szSoundsiTeam ][ ] );
                
g_iTotalSoundsiTeam ]++;
            }
        }
    }
}

public 
plugin_init( ) {
    
register_plugin"Replace Footstops""0.0.1""Exolent" );
    
register_forwardFM_CmdStart"FwdCmdStart" );
}

public 
FwdCmdStartclientucHandle ) {
    if( !
is_user_aliveclient ) ) {
        return;
    }
    
    if( 
flTimeStepSoundclient ] > ) {
        
flTimeStepSoundclient ]--;
    }
    
    new 
CsTeams:iTeam cs_get_user_teamclient );
    if( !
g_iTotalSoundsiTeam ] ) {
        return;
    }
    
    
set_pevclientpev_flTimeStepSound999 );
    
    static 
Float:vVelocity];
    
pevclientpev_velocityvVelocity );
    
vVelocity] = 0.0;
    
    if( 
vector_lengthvVelocity ) > 130.0 && (
        !( 
get_ucucHandleUC_Buttons ) & IN_MOVE )
        || !
IsUserWalkingclientucHandle )
        )
    ) {
        
// player has enough speed
        // and is either running or is moving at this speed for some other reason
        
        
if( g_iSoundTeamclient ] != iTeam ) {
            
g_iSoundTeamclient ] = iTeam;
            
g_iSoundNumclient ] = randomg_iTotalSoundsiTeam ] );
        }
        else if( 
g_iSoundNumclient ] < ) {
            
g_iSoundNumclient ] = randomg_iTotalSoundsiTeam ] );
        }
        
        if( 
flTimeStepSoundclient ] == ) {
            
emit_soundclientCHAN_ITEMg_szSoundsiTeam ][ g_iSoundNumclient ] ], 1.0ATTN_NORM0PITCH_NORM );
            
flTimeStepSoundclient ] = 400;
        }
    } else {
        
g_iSoundNumclient ] = -1;
    }
}

bool:IsUserWalkingclientucHandle ) {
    static 
Float:fForwardFloat:fSide;
    
get_ucucHandleUC_ForwardMovefForward );
    
get_ucucHandleUC_SideMovefSide );
    
    if( 
fForward == 0.0 && fSide == 0.0 ) {
        return 
false;
    }
    
    static 
Float:fWalkSpeed;
    
pevclientpev_maxspeedfWalkSpeed );
    
fWalkSpeed *= 0.52;
    
    return ( 
floatabsfForward ) <= fWalkSpeed && floatabsfSide ) <= fWalkSpeed );

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 10-05-2009 at 14:51.
Exolent[jNr] is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-05-2009 , 04:28   Re: sound emiting
Reply With Quote #16

It's good but it's fast a little :/
DoviuX is offline
Send a message via Skype™ to DoviuX
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-05-2009 , 04:56   Re: sound emiting
Reply With Quote #17

Why don't you use pev_flTimeStepSound to know the right time to make the sound, Exolent[Pony].
__________________
Arkshine is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-05-2009 , 09:02   Re: sound emiting
Reply With Quote #18

Quote:
Originally Posted by Arkshine View Post
Why don't you use pev_flTimeStepSound to know the right time to make the sound, Exolent[Pony].
Hey, hey, hey.
This is not my code.
I simply edited it to make the single sound play at a time instead of random for each footstep.
Besides, I'm sure he has silent footsteps, which makes the players' flTimeStepSound to 999 every prethink.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-05-2009 , 13:35   Re: sound emiting
Reply With Quote #19

Emulate flTimeStepSound
__________________
Arkshine is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-05-2009 , 14:51   Re: sound emiting
Reply With Quote #20

Quote:
Originally Posted by Arkshine View Post
Emulate flTimeStepSound
Grrr. I hope you're happy.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
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 07:19.


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