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

Replace FITH sound


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 01-24-2012 , 14:19   Re: Replace FITH sound
Reply With Quote #11

That id is the player for who the sound actually plays and not the id of the grenade thrower.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-24-2012 , 14:50   Re: Replace FITH sound
Reply With Quote #12

Store player id in a global variable with the value from the grenade_throw() forward (CSX module).
When the FITH sound is played, use the global variable for the grenade thrower.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-24-2012 , 17:41   Re: Replace FITH sound
Reply With Quote #13

Quote:
Originally Posted by Exolent[jNr] View Post
Store player id in a global variable with the value from the grenade_throw() forward (CSX module).
When the FITH sound is played, use the global variable for the grenade thrower.
Yes, that's what I did know and it works. But I think I was right about SendAudio since there is only the receiver of the sound.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-24-2012 , 17:53   Re: Replace FITH sound
Reply With Quote #14

Arg 1 is the player index the sound comes from, have consequence to show one the radar.

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

#define VERSION "0.1.0"
#define PLUGIN "FITH Replacement."

new const FITH_TE[] = "buttons/blip1.wav"
new const FITH_CT[] = "vox/grenade.wav"

enum // http://wiki.amxmodx.org/Half-Life_1_Game_Events#SendAudio
{
    
SendAudio_SenderID 1// byte
    
SendAudio_AudioCode// string
    
SendAudio_Pitch // short
}

#define NumToString(%0,%1,%2)    formatex(%1, %2, "%d", %0)

const XO_PLAYER 5
const m_iTeam 114
const m_szLocation 597*4

const TEAM_T 1

const PRINT_RADIO 5
new gmsgTextMsg

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_message(get_user_msgid("SendAudio"), "Message_SendAudio")
    
gmsgTextMsg get_user_msgid("TextMsg")
}

public 
plugin_precache()
{
    
precache_sound(FITH_TE)
    
precache_sound(FITH_CT)
}

public 
Message_SendAudio(iMsgIdiMsgDestid)
{
    if( 
id )
    {
        static 
audioCode[18// "%!MRAD_FIREINHOLE"
        
get_msg_arg_string(SendAudio_AudioCodeaudioCodecharsmax(audioCode))
        if( 
equal(audioCode"%!MRAD_FIREINHOLE") )
        {
            new 
sender get_msg_arg_int(SendAudio_SenderID)
            if( 
is_user_connected(sender) ) // who knows
            
{
                new 
iTeam get_pdata_int(senderm_iTeamXO_PLAYER)
                new 
weapName[32], senderName[32], szLocation[32], szId[3], szMessage[128]
                
get_user_name(sendersenderNamecharsmax(senderName))
                
get_weaponname(get_user_weapon(sender), weapNamecharsmax(weapName))
                
ucfirst(weapName[7])
                
get_pdata_string(senderm_szLocationszLocationcharsmax(szLocation), 0XO_PLAYER)
                
NumToString(senderszIdcharsmax(szId))

                
message_begin(MSG_ONE_UNRELIABLEgmsgTextMsg, .player=id)
                {
                    
write_byte(PRINT_RADIO)
                    
write_string(szId)
                    if(
szLocation[0])
                    {
                        
formatex(szMessagecharsmax(szMessage), "^3%%s1 ^4@ %%s2^1(RADIO): ^4%s ^1%%s3"weapName[7])
                        
//ewrite_string("#Game_radio_location")
                        
write_string(szMessage)
                        
write_string(senderName)
                        
write_string(szLocation)
                    }
                    else
                    {
                        
formatex(szMessagecharsmax(szMessage), "^3%%s1 ^1(RADIO): ^4%s ^1%%s2"weapName[7])
                        
write_string(szMessage)
                        
write_string(senderName)
                    }
                    
write_string("#Fire_in_the_hole")
                }
                
message_end()

                if( 
get_msg_block(gmsgTextMsg) == BLOCK_NOT )
                {
                    
set_msg_block(gmsgTextMsgBLOCK_ONCE)
                }
                
set_msg_arg_string(SendAudio_AudioCodeiTeam == TEAM_T FITH_TE FITH_CT)
            }
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-25-2012 at 02:48.
ConnorMcLeod is offline
Old 01-27-2012, 17:25
Lolz0r
This message has been deleted by Lolz0r.
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 01-27-2012 , 17:47   Re: Replace FITH sound
Reply With Quote #15

ConnorMcLeod, I need a plugin to change only the chat messages, if you can give it to me.
Lolz0r is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-27-2012 , 18:40   Re: Replace FITH sound
Reply With Quote #16

Quote:
Originally Posted by Lolz0r View Post
ConnorMcLeod, I need a plugin to change only the chat messages, if you can give it to me.
Look at VEN's "Fire In The Hole" colored chat.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 01-27-2012 , 18:54   Re: Replace FITH sound
Reply With Quote #17

I do not need this, i tried this: http://forums.alliedmods.net/showpos...28&postcount=2 , but server's crash.
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-28-2012 , 04:45   Re: Replace FITH sound
Reply With Quote #18

Quote:
Originally Posted by Lolz0r View Post
I do not need this, i tried this: http://forums.alliedmods.net/showpos...28&postcount=2 , but server's crash.
Weird, is it a steam server ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 01-28-2012 , 06:02   Re: Replace FITH sound
Reply With Quote #19

Yes, this work: http://forums.alliedmods.net/showpos...1&postcount=14 , but be done only for messages.
Lolz0r is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-28-2012 , 09:23   Re: Replace FITH sound
Reply With Quote #20

Only chat replacement.

tags descriptive fire hole
Attached Files
File Type: sma Get Plugin or Get Source (Desc_FITH.sma - 604 views - 1.7 KB)
File Type: txt desc_fith.txt (356 Bytes, 110 views)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 02:24.


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