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

Solved [TFC] How to disable chat sound ; Ham_Touch problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vancold
Member
Join Date: Jan 2015
Old 02-11-2020 , 08:44   [TFC] How to disable chat sound ; Ham_Touch problem
Reply With Quote #1

Hey guys!

I do have a short question. When player use the say / team_say command and write something and it gets printed in the server, it makes a sound.

I am no newb but i can't find any clue as to how to deactivate the sound?


Also i would like to know how to make a hook on Ham_Touch do the following.

I set up a info_tfgoal which is just a backpack which gives ammo and i hooked the Touch function on the info_tfgoal.

So when player touches the info_tfgoal it would normally get removed and spawn after 5 seconds (that's my wait time). But since i hooked it it just despawn.
And i dont why, since it should.


Thanks

Last edited by Vancold; 02-11-2020 at 16:50.
Vancold is offline
Old 02-11-2020, 14:18
gabuch2
This message has been deleted by gabuch2. Reason: Didn't know you could stop sounds in specific channels. Nice find DarthMan.
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-11-2020 , 16:07   Re: [TFC] How to disable chat sound ; Ham_Touch problem
Reply With Quote #2

Quote:
Originally Posted by Vancold View Post
Hey guys!

I do have a short question. When player use the say / team_say command and write something and it gets printed in the server, it makes a sound.

I am no newb but i can't find any clue as to how to deactivate the sound?


Also i would like to know how to make a hook on Ham_Touch do the following.

I set up a info_tfgoal which is just a backpack which gives ammo and i hooked the Touch function on the info_tfgoal.

So when player touches the info_tfgoal it would normally get removed and spawn after 5 seconds (that's my wait time). But since i hooked it it just despawn.
And i dont why, since it should.


Thanks
You can easely change the sound. Just use the SayText and TextMsg, as post, after the messages were sent, do this:

PHP Code:
StopSendSound(const iID)
{
    
message_begin(MSG_ONESVC_STOPSOUND_iID);
    
write_short((iID << 3) | CHAN_ITEM);
    
message_end();

This will stop the sounds entirely and prevent them from ever playing.

Best way, if you want it to be hookable from plug-ins as well, would be to sue Orpheu and hook pfnMessageBegin and pfnMessageEnd, both as post.

For the tfgoal entity not sure how you coded it, but I can give a suggestion:
Hook pfnKeyValue, read the value of the wait key, store it somewhere, on touch retrive the value and set the nextthink to get_gametime + float of the value.

Last edited by DarthMan; 02-11-2020 at 16:12.
DarthMan is offline
Vancold
Member
Join Date: Jan 2015
Old 02-11-2020 , 16:50   Re: [TFC] How to disable chat sound ; Ham_Touch problem
Reply With Quote #3

Quote:
Originally Posted by DarthMan View Post
You can easely change the sound. Just use the SayText and TextMsg, as post, after the messages were sent, do this:

PHP Code:
StopSendSound(const iID)
{
    
message_begin(MSG_ONESVC_STOPSOUND_iID);
    
write_short((iID << 3) | CHAN_ITEM);
    
message_end();

This will stop the sounds entirely and prevent them from ever playing.

Best way, if you want it to be hookable from plug-ins as well, would be to sue Orpheu and hook pfnMessageBegin and pfnMessageEnd, both as post.

For the tfgoal entity not sure how you coded it, but I can give a suggestion:
Hook pfnKeyValue, read the value of the wait key, store it somewhere, on touch retrive the value and set the nextthink to get_gametime + float of the value.

Ty Darthman ;) The post hook makes sense. The info_tfgoal problem isn't as easy as it sounds. the problem is that i thought that this would be an efficent way, but i got a different idea, that should work.

have a nice day
Vancold is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-11-2020 , 16:55   Re: [TFC] How to disable chat sound ; Ham_Touch problem
Reply With Quote #4

Quote:
Originally Posted by Vancold View Post
Ty Darthman ;) The post hook makes sense. The info_tfgoal problem isn't as easy as it sounds. the problem is that i thought that this would be an efficent way, but i got a different idea, that should work.

have a nice day
I see. You too
DarthMan 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 06:36.


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