AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Solved] Fake Radio Command (https://forums.alliedmods.net/showthread.php?t=231709)

devilicioux 12-18-2013 21:14

[Solved] Fake Radio Command
 
I got 2 questions ..

1. How can i generate a Fake Radio command?
Eg : Player (Radio) : Something ..

2. How to make a command coloured?
Eg : Player(<Green>Radio) : Something..

shaliwahan 12-18-2013 21:58

Re: Fake Radio Command
 
Edit:
Here you go -

PHP Code:

formatex(szFormatcharsmax(szFormat), "%L"LANG_PLAYER"C4_ARMED_RADIO"iC4Timer)

    for(new 
1<= g_iMaxPlayersi++)
    {
        if(
g_iTeam[i] == g_iTeam[id] && !g_bBot[id])
        {
            
/* fully fake hookable radio message and event */

            
emessage_begin(MSG_ONEgMsg_TextMsg_i)
            
ewrite_byte(3)
            
ewrite_string("#Game_radio")
            
ewrite_string(szName)
            
ewrite_string(szFormat)
            
emessage_end()

            
emessage_begin(MSG_ONEgMsg_SendAudio_i)
            
ewrite_byte(id)
            
ewrite_string("%!MRAD_BLOW")
            
ewrite_short(100)
            
emessage_end()
        }
    } 


devilicioux 12-18-2013 22:37

Re: Fake Radio Command
 
:D Awesome Ty :D First Solved .. But Still Stuck on 2nd .. Any Suggestions ?

PHP Code:

emessage_begin(MSG_BROADCASTgMsg_TextMsg_,0)
ewrite_byte(3)
ewrite_string("#Game_radio")
ewrite_string(szName)
ewrite_string(szFormat)
emessage_end() 

Edit : Tested and works fine.. Suggestions for making Radio Coloured ?

shaliwahan 12-18-2013 22:53

Re: Fake Radio Command
 
Quote:

Originally Posted by devilicioux (Post 2073742)
Still Stuck on 2nd .. Any Suggestions ?

Haven't seen anyone do that through emessage.

You got the concept then use it with this
PHP Code:

msg_saytext(idtext[]) {
    
message_begin(MSG_ONEg_msgid_saytext_id)
    
write_byte(id)
    
write_string(text)
    
message_end()



devilicioux 12-18-2013 22:57

Re: Fake Radio Command
 
I did Check Info Zone Source for how it was printing a certain part of message as coloured ..Your way matches that So may be thats the solution.. Will give it a try ASAP and respond.. By the way Tysm :D

ConnorMcLeod 12-19-2013 04:10

Re: [Solved] Fake Radio Command
 
Correct way is with TextMsg, not SayText, but you can do as you want.

PHP Code:

// czero\resource\czero_english.txt for real format
// "Game_radio"                    "^2%%s1 (RADIO): %%s2"
// "Game_radio_location"                "^3%%s1^1 @ ^3%%s2^1 (RADIO): %%s3"

{
    
emessage_begin(MSG_ONEgmsgTextMsg, .player=iPlayer)
    
ewrite_byte(PRINT_RADIO// PRINT_RADIO = 5
    
ewrite_string(szId// player index converted to string
    
ewrite_string("^3%%s1^1 @ ^3%%s2^1 (RADIO): %%s3"
    
ewrite_string(szName// %%1 is replaced with this string
    
ewrite_string(szLocation// %%2 is replaced with this string
    
ewrite_string(szMessage// %%3 is replaced with this string
    
emessage_end()


You can make an idea reading following plugin's source : http://forums.alliedmods.net/showthread.php?p=573867


Anyway, if you use amxx1.8.3, i suggest to only use client_print_color native.


All times are GMT -4. The time now is 20:42.

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