Raised This Month: $ Target: $400
 0% 

Solved [HELP] Sending Radio Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 06-02-2018 , 01:36   [HELP] Sending Radio Messages
Reply With Quote #1

Hi guys! Long time no post. Anyway I was wondering if anyone could teach me how to use SendAudio message. I'm trying to utilize the "hostage down" sound clip. I've already hooked the event but I can't produce the sound. I can always use client_cmd(id, "spk %s", whatever.wav) but I have the impression this will not make it a real radio message. Anyway, here's the code:
PHP Code:
new msg_SendAudio;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("TextMsg""Event_Hostage_Killed""b""2=#Killed_Hostage");
//    register_event("SendAudio", "EventSendAudio", "a", "1=0", "2=%!MRAD_hosdown");
    
    
msg_SendAudio get_user_msgid("SendAudio");
}

public 
Event_Hostage_Killed()
{
//    client_print(1, print_chat, "I did?");

    
message_begin(MSG_ONE_UNRELIABLEmsg_SendAudio);
    
write_byte(1);             // Sender ID
    
write_string("%!MRAD_hosdown");    // Audio Code
    
write_short(1<<1);        // Pitch    
    
message_end();

I know the values are messed up. I really don't know what to put exactly...
__________________

Last edited by hellmonja; 06-02-2018 at 16:16.
hellmonja is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 06-02-2018 , 12:31   Re: [HELP] Sending Radio Messages
Reply With Quote #2

Quote:
message_begin(MSG_ONE_UNRELIABLE, msg_SendAudio);
If you are using MSG_ONE you must provide reciever id, like this:
Quote:
message_begin(MSG_ONE_UNRELIABLE, msg_SendAudio, _, id);
or, if you send for all:
Quote:
message_begin(MSG_BROADCAST, msg_SendAudio);
Also, for the pitch, in the amxcost file defined values exist.
__________________
My English is A0

Last edited by E1_531G; 06-02-2018 at 12:32.
E1_531G is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 06-02-2018 , 16:09   Re: [HELP] Sending Radio Messages
Reply With Quote #3

Quote:
Originally Posted by E1_531G View Post
...
Good stuff. Thank you! This is most helpful given that I haven't used this before. For pitch, I used PITCH_NORM, which I found where you told it would be...
__________________

Last edited by hellmonja; 06-06-2018 at 03:52.
hellmonja 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 04:33.


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