Raised This Month: $ Target: $400
 0% 

Walk triggers sound?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Elite_Fallen_Angel
Member
Join Date: Dec 2006
Location: HELL.....AkA, Texas
Old 10-03-2007 , 14:53   Walk triggers sound?
Reply With Quote #1

How would I have a custom sound play everytime a player walks?

I disabled mp_footsteps if that makes any difference?

Thank you for any and all help
__________________
amXXX The new generation......


Elite_Fallen_Angel is offline
Send a message via AIM to Elite_Fallen_Angel Send a message via Yahoo to Elite_Fallen_Angel
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-03-2007 , 15:28   Re: Walk triggers sound?
Reply With Quote #2

You could try and loop an iceskate sound on a player using set_task that loops for as long as the soundfile is. I'm assuming this goes along with your iceskate plugin. It's the only way I could think of doing it right now, but I'm sure theres a more efficient method of doing this
__________________
M249-M4A1 is offline
Elite_Fallen_Angel
Member
Join Date: Dec 2006
Location: HELL.....AkA, Texas
Old 10-03-2007 , 16:19   Re: Walk triggers sound?
Reply With Quote #3

The sound file is 3 seconds.

I don't want it to play when they aren't moving though. Maybe if I set it to loop everytime a player presses:
A, W, S, D
and then stops when they release the key.?

I am not sure how to do it but I will try and figure it out. Any help would be greatly appreciated.
__________________
amXXX The new generation......


Elite_Fallen_Angel is offline
Send a message via AIM to Elite_Fallen_Angel Send a message via Yahoo to Elite_Fallen_Angel
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 10-03-2007 , 16:38   Re: Walk triggers sound?
Reply With Quote #4

That wouldn't make sense if someone is holding the key down but is not moving (running into a wall/corner). To get around that you could probably get the users origin to see if they have moved while holding it down (while ignoring z access).
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
Elite_Fallen_Angel
Member
Join Date: Dec 2006
Location: HELL.....AkA, Texas
Old 10-03-2007 , 16:40   Re: Walk triggers sound?
Reply With Quote #5

That's a good idea!

Um, I will look around on the Wiki to see what I can come up with. Any sample code would help
__________________
amXXX The new generation......


Elite_Fallen_Angel is offline
Send a message via AIM to Elite_Fallen_Angel Send a message via Yahoo to Elite_Fallen_Angel
Old 10-04-2007, 01:11
Elite_Fallen_Angel
This message has been deleted by Elite_Fallen_Angel. Reason: Corrected
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-04-2007 , 10:26   Re: Walk triggers sound?
Reply With Quote #6

Hum, i've maded something...maybe is not the best way but shold work

Code:
#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "Custom FootSteps Sound"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
new Float:NextCheck[33];
new const FootStepSound[] = "misc/whatever.wav";
 
public plugin_init() {
     register_plugin(PLUGIN, VERSION, AUTHOR);
 
     register_forward(FM_PlayerPostThink, "Fwd_PlayerPostThink");
}
 
public Fwd_PlayerPostThink(id)
{
     if(!is_user_alive(id))
           return;
 
     static Float:gametime;
     gametime = get_gametime();
 
     if(NextCheck[id] < gametime)
     {
          static Float:Velocity[3], Button;
 
          pev(id, pev_velocity, Velocity);
          pev(id, pev_button, Button);
 
          if((Button & IN_FORWARD) || (Button & IN_BACK) || (Button & IN_LEFT) || (Button & IN_RIGHT))
          {
               if(pev(id, pev_flFallVelocity) == 0.0 && floatround(vector_length(Velocity)) != 0.0)
               {
                     emit_sound(id, CHAN_VOICE, FootStepSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
               }
          }
          NextCheck[id] = gametime + 3.0;
     }
}
Is for a sound with 3 sec len. ;)
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-04-2007 at 10:33.
Alka is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 10-10-2007 , 05:46   Re: Walk triggers sound?
Reply With Quote #7

Sssssssseeeeeeaaaaarrrrch.

http://forums.alliedmods.net/showthread.php?t=44736
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
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 16:09.


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