Raised This Month: $ Target: $400
 0% 

print_chat help! (plugin)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NaTeDaWg92
Junior Member
Join Date: Apr 2006
Old 12-16-2009 , 00:03   print_chat help! (plugin)
Reply With Quote #1

Hi, I was wondering if someone could help with something real quick.

I was wondering if its possible to have a green chat message as in:

client_print(id, print_chat, "TEXT")

I need the "TEXT" part to be green text. Please Help!
__________________
Wazz Uppp? Come to my server. Put this IP in and come to my SH Server!!!
70.172.192.50:27015
NaTeDaWg92 is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 12-16-2009 , 01:39   Re: print_chat help! (plugin)
Reply With Quote #2

PHP Code:
client_print(idprint_chat"^x04TEXT"
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 12-16-2009 , 01:42   Re: print_chat help! (plugin)
Reply With Quote #3

Code:
stock client_printcolor(const id, const input[], any:...)
{
    new iCount = 1, iPlayers[32]
    
    static szMsg[191]
    vformat(szMsg, charsmax(szMsg), input, 3)
    
    replace_all(szMsg, 190, "/g", "^4") // green txt
    replace_all(szMsg, 190, "/y", "^1") // orange txt
    replace_all(szMsg, 190, "/ctr", "^3") // team txt
    replace_all(szMsg, 190, "/w", "^0") // team txt
    
    if(id) iPlayers[0] = id
    else get_players(iPlayers, iCount, "ch")
    
    for (new i = 0; i < iCount; i++)
    {
        if (is_user_connected(iPlayers[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
            write_byte(iPlayers[i])
            write_string(szMsg)
            message_end()
        }
    }
}
Put this at the back of your code. Then replace all client_print() to client_printcolor() /g = green /y = yellow

Example:
Code:
client_printcolor(id, "/gI OWN YOU. /y BUT YOU OWN ME MORE."
This will show I OWN YOU. as green and BUT YOU OWN ME MORE. as yellow.
Excalibur.007 is offline
vivek
BANNED
Join Date: Dec 2009
Old 12-16-2009 , 04:07   Re: print_chat help! (plugin)
Reply With Quote #4

Quote:
Originally Posted by Excalibur.007 View Post
Code:
stock client_printcolor(const id, const input[], any:...)
{
    new iCount = 1, iPlayers[32]
    
    static szMsg[191]
    vformat(szMsg, charsmax(szMsg), input, 3)
    
    replace_all(szMsg, 190, "/g", "^4") // green txt
    replace_all(szMsg, 190, "/y", "^1") // orange txt
    replace_all(szMsg, 190, "/ctr", "^3") // team txt
    replace_all(szMsg, 190, "/w", "^0") // team txt
    
    if(id) iPlayers[0] = id
    else get_players(iPlayers, iCount, "ch")
    
    for (new i = 0; i < iCount; i++)
    {
        if (is_user_connected(iPlayers[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
            write_byte(iPlayers[i])
            write_string(szMsg)
            message_end()
        }
    }
}
Put this at the back of your code. Then replace all client_print() to client_printcolor() /g = green /y = yellow

Example:
Code:
client_printcolor(id, "/gI OWN YOU. /y BUT YOU OWN ME MORE."
This will show I OWN YOU. as green and BUT YOU OWN ME MORE. as yellow.


FOR GREY COLOR WHAT IS THE CODE
vivek is offline
NaTeDiZzLe
New Member
Join Date: Mar 2009
Old 12-16-2009 , 15:25   Re: print_chat help! (plugin)
Reply With Quote #5

Thanks Guys. :-)
NaTeDiZzLe 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 09:07.


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