Raised This Month: $ Target: $400
 0% 

Replace messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-28-2012 , 07:20   Replace messages
Reply With Quote #1

Well, i have a plugin that replace some messages like "Terrorists Win!", "The bomb has been planted!" and so.. But message like "Enemy spotted." , "Defusing bomb WITHOUT Defuse kit." , "Press the BUY key to purchase items." , "Free Chase Cam" and etc won't change..

WHY ? and How to replace this messages ? ;)

example:
PHP Code:
new const g_szOriginal[][] = {

"#CTs_Win"
"#Terrorists_Win"        
}
#define MAX_REPLACE sizeof(g_szOriginal) 

new const g_szReplace[MAX_REPLACE][] = {

"Counter-Terrorists Win!",
"Terrorists Win!"
};

enum _:RGB RG}; 

new const 
g_iColor[MAX_REPLACE][RGB] = {

{
255,    255,    255},
{
255,    255,    255}
};

new const 
g_iEffect[MAX_REPLACE] = {
0,
0
};

new const 
Float:g_fTime[MAX_REPLACE] = {

3.0,
2.0
};


new 
Trie:g_tReplacements 

#define toColor(%1) (%1 == -1 ? random(256) : %1) 
public plugin_init() {
    
    
register_message(get_user_msgid("TextMsg"), "Message_TextMsg"
    
g_tReplacements TrieCreate()
    for(new 
0MAX_REPLACEi++)
    {
    
TrieSetCell(g_tReplacementsg_szOriginal[i], i);
    }
}   
public 
Message_TextMsg(iMsgIdiMsgDestid) { 
    
    if( !
id && get_msg_arg_int(1) == print_center 
    { 
    new 
szMessage[64], index
    get_msg_arg_string
(2szMessagecharsmax(szMessage)) 
    if( 
TrieGetCell(g_tReplacementsszMessageindex) ) 
    {
    
set_dhudmessage(
        .
red      toColor(g_iColor[index][R]),
        .
green    toColor(g_iColor[index][G]),
        .
blue     toColor(g_iColor[index][B]),
        .
effects  g_iEffect[index],
        .
holdtime g_fTime[index],
        .
fxtime   g_fTime[index]
        );
    
show_dhudmessage(0g_szReplace[index]) 
    return 
PLUGIN_HANDLED 
        

    } 
    return 
PLUGIN_CONTINUE 

bazhenov93 is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 05-13-2012 , 14:32   Re: Replace messages
Reply With Quote #2

bump
bazhenov93 is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 05-13-2012 , 14:46   Re: Replace messages
Reply With Quote #3

AFAIK you need to hook HudTextArgs message for those types of message.

P.S. Show us the new tatoo.
__________________


Last edited by NiHiLaNTh; 05-13-2012 at 14:46.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 05-13-2012 , 16:37   Re: Replace messages
Reply With Quote #4

Why I should post photos of my ass ?
There's one on my avatar, that does not show to much, but ..

only for my bf :*

thanks for the hudtextargs..
bazhenov93 is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-14-2012 , 09:36   Re: Replace messages
Reply With Quote #5

How is he able to know that you have the new tattoo placed on ur ass :$?
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 05-14-2012 at 09:37.
Bilal Pro is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 05-14-2012 , 16:05   Re: Replace messages
Reply With Quote #6

My avatar!!! are you blind!?
bazhenov93 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 07:50.


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