Raised This Month: $ Target: $400
 0% 

colored name | fire in the hole event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Amonel
Senior Member
Join Date: May 2009
Old 05-22-2010 , 06:38   colored name | fire in the hole event
Reply With Quote #1

How can i make the name of the player throwing a nade be colored depending of his team (red/blue)

%s (RADIO): Fire in the hole!
Amonel is offline
issen1
Member
Join Date: Jan 2010
Old 05-22-2010 , 07:03   Re: colored name | fire in the hole event
Reply With Quote #2

PHP Code:
public ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...) 
Have a look in colorchat.inc:

PHP Code:
if(cs_get_user_team(plr) == CS_TEAM_T)
    
ColorChat(0RED"^3%s ^1(RADIO): Fire in the hole!"sPlrName)
else if (
cs_get_user_team(plr) == CS_TEAM_CT)
    
ColorChat(0BLUE"^3%s ^1(RADIO): Fire in the hole!"sPlrName
or something like that.
__________________
greets (:

Last edited by issen1; 05-22-2010 at 07:19.
issen1 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-22-2010 , 19:57   Re: colored name | fire in the hole event
Reply With Quote #3

Quote:
Originally Posted by issen1 View Post
PHP Code:
public ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...) 
public? o_O
__________________
hleV is offline
issen1
Member
Join Date: Jan 2010
Old 05-24-2010 , 13:46   Re: colored name | fire in the hole event
Reply With Quote #4

Quote:
Originally Posted by hleV View Post
public? o_O
It's the function prototype I found in my version of ColorChat.inc.
__________________
greets (:
issen1 is offline
Amonel
Senior Member
Join Date: May 2009
Old 05-22-2010 , 17:48   Re: colored name | fire in the hole event
Reply With Quote #5

ok... so what do i have to do exactly ? :/
Amonel is offline
Amonel
Senior Member
Join Date: May 2009
Old 05-23-2010 , 06:48   Re: colored name | fire in the hole event
Reply With Quote #6

any ideea ? :/
Amonel is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-23-2010 , 07:02   Re: colored name | fire in the hole event
Reply With Quote #7

http://forums.alliedmods.net/showthread.php?p=401813
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Amonel
Senior Member
Join Date: May 2009
Old 05-23-2010 , 07:12   Re: colored name | fire in the hole event
Reply With Quote #8

yeah,... but i want the COLOR of his name too

if i add ^x03 and throws a smoke... it will print the entire message grey =(
Amonel is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-23-2010 , 07:20   Re: colored name | fire in the hole event
Reply With Quote #9

PHP Code:
/*    Formatright © 2010, ConnorMcLeod

    Descriptive Fire In The Hole Reloaded is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Descriptive Fire In The Hole Reloaded; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>

#define VERSION "0.2.0"

new g_iLocation
new g_iRmTextMsg

public plugin_init()
{
    
register_plugin("Descriptive Fire In The Hole Reloaded"VERSION"ConnorMcLeod")

    
register_event("SendAudio""Event_SendAudio_MRAD_FIREINHOLE""b""2=%!MRAD_FIREINHOLE")

    new 
szModName[7]
    
get_modname(szModNamecharsmax(szModName))
    if(
equal(szModName"czero"))
    {
        
register_event("Location""Event_Location""b")
    }
}

public 
Event_Location()
{
    
g_iLocation 1
}

public 
Event_SendAudio_MRAD_FIREINHOLE()
{
    
g_iRmTextMsg register_messageget_user_msgid("TextMsg") , "Message_TextMsg" )
}

public 
Message_TextMsg(iMsgId)
{
    new 
szType[64], szId[3]
    
get_msg_arg_string(2szIdcharsmax(szId))
    new 
iId get_user_weaponstr_to_num(szId) )
    if( 
g_iLocation )
    {
        
formatex(szTypecharsmax(szType), "^3%%s1^1 @ ^4%%s2^1 ( %s ): %%s3"get_grenade_typeiId ))
    }
    else
    {
        
formatex(szTypecharsmax(szType), "^3%%s1 ^1( %s ): %%s2"get_grenade_typeiId ))
    }
    
set_msg_arg_string(3szType)
    
unregister_message(iMsgIdg_iRmTextMsg)
}

get_grenade_typeiId )
{
    new 
szGrenade[20]
    switch( 
iId )
    {
        case 
CSW_HEGRENADE :
        {
            
szGrenade "^3He Grenade^1"
        
}
        case 
CSW_SMOKEGRENADE :
        {
            
szGrenade "Smoke Grenade"
        
}
        case 
CSW_FLASHBANG :
        {
            
szGrenade "^4FlashBang^1"
        
}
    }
    return 
szGrenade

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Amonel
Senior Member
Join Date: May 2009
Old 05-23-2010 , 07:44   Re: colored name | fire in the hole event
Reply With Quote #10

your code doesn't work.... it makes my sv run at 4 fps when throwing a nade :/
Amonel 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 03:35.


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