Raised This Month: $ Target: $400
 0% 

TextMsg - Alter content


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mogel
Senior Member
Join Date: Jan 2007
Old 05-08-2007 , 13:37   Re: TextMsg - Alter content
Reply With Quote #5

Hi,

an example for replacing the voice-commands for both sides

Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <csx>
#include "include/blackmesa.inc"



#define PLUGIN "BM-Radio"
#define VERSION "0.4.1"
#define AUTHOR "mogel"



//    Hilfe -> http://www.databasesystemscorp.com/psivrttv.htm
//         David & Split Personality
//         Damien & Old Robot



#define MAXRADIO 23



new newradio[MAXRADIO][] = {
    "newradio11.wav",
    "newradio12.wav",
    "newradio13.wav",
    "newradio14.wav",
    "newradio15.wav",
    "newradio16.wav",
    "newradio21.wav",
    "newradio22.wav",
    "newradio23.wav",
    "newradio24.wav",    // 10
    "newradio25.wav",
    "newradio26.wav",
    "newradio31b.wav",
    "newradio31a.wav",
    "newradio32.wav",
    "newradio33.wav",
    "newradio34.wav",
    "newradio35.wav",
    "newradio36.wav",
    "newradio37.wav",    // 20
    "newradio38.wav",
    "newradio39.wav",
    "newradio01.wav"    // Fire In The Hole
}
new message[MAXRADIO][] = {
    "%!MRAD_COVERME",
    "%!MRAD_TAKEPOINT",
    "%!MRAD_POSITION",
    "%!MRAD_REGROUP",
    "%!MRAD_FOLLOWME",
    "%!MRAD_HITASSIST",
    "%!MRAD_GO",
    "%!MRAD_FALLBACK",
    "%!MRAD_STICKTOG",
    "%!MRAD_GETINPOS",
    "%!MRAD_STORMFRONT",
    "%!MRAD_REPORTIN",
    "%!MRAD_AFFIRM",
    "%!MRAD_ROGER",
    "%!MRAD_ENEMYSPOT",
    "%!MRAD_BACKUP",
    "%!MRAD_CLEAR",
    "%!MRAD_INPOS",
    "%!MRAD_REPRTINGIN",
    "%!MRAD_BLOW",
    "%!MRAD_NEGATIVE",
    "%!MRAD_ENEMYDOWN",
    "%!MRAD_FIREINHOLE"
}



//    Hilfe -> http://forums.alliedmods.net/showthread.php?t=54110
//         http://forums.alliedmods.net/showthread.php?p=193239



new msgid_sendaudio
new CsTeam:hs = CsTeam:CS_TEAM_UNASSIGNED



public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    RegisterVersionCVar("radio", VERSION)
    
    msgid_sendaudio = get_user_msgid("SendAudio")
    
    register_message(msgid_sendaudio, "Msg_SendAudio") 
    
    hs = HumanSide()
}
public plugin_precache() {
    new path[200]
    for (new i = 0; i < MAXRADIO; i++)
    {
        format(path, 199, "sound/blackmesa/human/%s", newradio[i])
        precache_generic(path)
        if (!equal(newradio[i], "newradio01.wav"))
        {
            format(path, 199, "sound/blackmesa/zombie/%s", newradio[i])
            precache_generic(path)
        }
    }
}
/*
L 04/18/2007 - 18:05:35: MessageBegin (SendAudio "100") (Destination "One<1>") (Args "3") (Entity "1") (Classname "player") (Netname "<BlackMesa> Invader Zim") (Origin "0.000000 0.000000 0.000000")
L 04/18/2007 - 18:05:35: Arg 1 (Byte "1")
L 04/18/2007 - 18:05:35: Arg 2 (String "%!MRAD_AFFIRM")
L 04/18/2007 - 18:05:35: Arg 3 (Short "100")
L 04/18/2007 - 18:05:35: MessageEnd (SendAudio "100")
*/
public Msg_SendAudio() {
    new sound[50]
    //new patched = 0
    get_msg_arg_string(2, sound, 49)
    new player = get_msg_arg_int(1)
    
    // es muss nicht alles kontrolliert werden
    if (contain(sound, "%!MRAD_") == -1) return PLUGIN_CONTINUE
    
    for(new i = 0; i < MAXRADIO; i++)
    {
        if (equali(sound, message[i]))  
        {
            new sound[200]
            if (cs_get_user_team(player) == hs)
            {
                format(sound, 199, "blackmesa/human/%s", newradio[i])
            } else
            {
                format(sound, 199, "blackmesa/zombie/%s", newradio[i])
            }
            
            set_msg_arg_string(2, sound)
            //patched = 1
            break;
        }
    }
    
    //if (!patched) log_amx("unpatched sound -> '%s'", sound)
    
    return PLUGIN_CONTINUE
}
hand, mogel
__________________
mogel is offline
 



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 08:00.


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