Raised This Month: $51 Target: $400
 12% 

[Dyn Native] ColorChat v0.3.2 (04 jul 2013)


Post New Thread Reply   
 
Thread Tools Display Modes
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 10-13-2013 , 22:25   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #231

Quote:
Originally Posted by FLAiTE View Post
i don't get it man...please help me.
for example, i have the attached plugin. how can i edit it to have colours in my chat?
i'm using AMXX 1.8.3 b190.

can you please give me a concrete example of how to use the integrated colorchat in AMXX 1.8.3?
Change client_print to client_print_color and print_chat by other colors:

PHP Code:
/* Color types for client_print_color() */
enum {
    
print_team_default 0,
    
print_team_grey = -1,
    
print_team_red = -2,
    
print_team_blue = -3,
}; 
and replace with colors the message:

PHP Code:
 The available colors identifiers are :
 *          
green       ^4   ; use location color from this point forward
 
*  red/blue/grey       ^3   ; use team color from this point forward
 
*  red/blue/grey       ^2   ; use team color up to the end of the player nameThis only works at the start of the string, and precludes using the other control characters.
 *          
normal      ^1   ; use normal color from this point forward 
After do this, make sure you have read the amxconst.inc and amxmodx.inc files from amxmodx compiler.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
FLAiTE
Member
Join Date: Aug 2008
Old 10-14-2013 , 06:42   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #232

Quote:
Originally Posted by ^SmileY View Post
Change client_print to client_print_color and print_chat by other colors:

PHP Code:
/* Color types for client_print_color() */
enum {
    
print_team_default 0,
    
print_team_grey = -1,
    
print_team_red = -2,
    
print_team_blue = -3,
}; 
and replace with colors the message:

PHP Code:
 The available colors identifiers are :
 *          
green       ^4   ; use location color from this point forward
 
*  red/blue/grey       ^3   ; use team color from this point forward
 
*  red/blue/grey       ^2   ; use team color up to the end of the player nameThis only works at the start of the string, and precludes using the other control characters.
 *          
normal      ^1   ; use normal color from this point forward 
After do this, make sure you have read the amxconst.inc and amxmodx.inc files from amxmodx compiler.
okay...and if i want to modify the language files?
for example:
time.txt:

[en]
TIME_ELEMENT_SECOND = second
TIME_ELEMENT_SECONDS = seconds
TIME_ELEMENT_MINUTE = minute
TIME_ELEMENT_MINUTES = minutes
TIME_ELEMENT_HOUR = hour
TIME_ELEMENT_HOURS = hours
TIME_ELEMENT_DAY = day
TIME_ELEMENT_DAYS = days
TIME_ELEMENT_WEEK = week
TIME_ELEMENT_WEEKS = weeks
TIME_ELEMENT_PERMANENTLY = permanently
TIME_ELEMENT_AND = and

if i want all those to be RED what should i do?
FLAiTE is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 10-14-2013 , 16:33   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #233

change print_team_grey to print_team_red

and

PHP Code:
[en]
TIME_ELEMENT_SECOND = ^3second^1
TIME_ELEMENT_SECONDS 
= ^3seconds^1
// Whell other strings 
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 10-14-2013 at 16:34.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
FLAiTE
Member
Join Date: Aug 2008
Old 10-16-2013 , 08:53   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #234

hmm...
so, in conclusion...if i have AMXX 1.8.3 latest build and i have to edit the line (the words ”immunity off” to be BLUE, for example):

Code:
client_print(id,print_chat,"Server does not allow Immunity Off")
it will become:

Code:
client_print_color(id,-3,"^1Server does not allow ^3Immunity Off^1.")
FLAiTE is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-16-2013 , 12:26   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #235

Don't use -3, use print_team_blue
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-24-2013 , 17:32   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #236

Iam using this:
PHP Code:
new playerarg[32]
    
read_argv(1argcharsmax(arg)-1)
    
    
player cmd_target(idarg2)
    
    if(!
player)
        return 
PLUGIN_HANDLED
    
    
new message[121], victim_name[32]
    
read_argv(2messagecharsmax(message)-1)
    
get_user_name(playervictim_namecharsmax(victim_name)-1)
    
    
client_print_color(0player"^2%s^1: %s"victim_namemessage
There is some space problem between name and ":"
__________________
Jhob94 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-24-2013 , 17:47   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #237

Remove ^1, it is not needed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-24-2013 , 18:13   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #238

Quote:
Originally Posted by ConnorMcLeod View Post
Remove ^1, it is not needed.
?
If i remove, doesnt it makes all chat printed with same color?
__________________
Jhob94 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-25-2013 , 04:30   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #239

This is not how ^2 is working.

^2Following player name _PLAYER_NAME_ is colored with team.

->

Following player name _PLAYER_NAME_ is colored with team.

Also, with ^2 at the start of the string, any other color key in the string has no effect. If at least you would read native description...
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-25-2013 at 04:33.
ConnorMcLeod is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 10-25-2013 , 12:04   Re: [Dyn Native] ColorChat v0.3.2 (04 jul 2013)
Reply With Quote #240

ConnorMcLeod I am facing some problems, I tried with the stock on 1.8.2 and with 1.8.3 without the stock. It seems to work normally when I use it on 1 message, but when I implement with all messages, they simply print the ^1 and ^2 and it does not color the messages. It's pretty big plugin, and I am using it with ML by the way. The plugin I am trying to use this on is UltimatePlugin, the link is in my description.

Does it have a problem when ML file is large?
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 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 19:21.


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