Raised This Month: $32 Target: $400
 8% 

CS Color Chat Function Updated:[01/26/2007]


Post New Thread Reply   
 
Thread Tools Display Modes
FLAiTE
Member
Join Date: Aug 2008
Old 03-28-2009 , 00:14   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #51

Hello guys.
I am pretty confused...If i have a plugin (for example amx_gag)...what do i have to add in the plugin's SMA to use the color chat function?
For example, the plugin prints in chat something like this:

ADMIN X: gag Y for 200.00 minutes.

i want the plugin to print the messages like this:

ADMIN X: gag Y for 200.00 minutes.

and i want the red color to be printed even @ the CT forces or SPECTATOR.
i know this is possible...i saw something like this on other servers...so please help me
FLAiTE is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-28-2009 , 00:16   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #52

It's impossible to have two team colors in the same message.
Therefore, you can only have red, blue, or gray in the message, not a combination.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
FLAiTE
Member
Join Date: Aug 2008
Old 03-28-2009 , 02:41   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #53

ok...my mistake..anyway...how can i do this, using this plugin?
FLAiTE is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-28-2009 , 14:09   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #54

Code:
ColorChat(0, RED, "^x01ADMIN^x04 X^x01:^x03 gag^x04 Y^x01 for^x03 200.00^x01 minutes.");
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
FLAiTE
Member
Join Date: Aug 2008
Old 03-29-2009 , 03:28   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #55

Quote:
Originally Posted by Exolent[jNr] View Post
Code:
ColorChat(0, RED, "^x01ADMIN^x04 X^x01:^x03 gag^x04 Y^x01 for^x03 200.00^x01 minutes.");
Man...thanx a lot...but i'm still pretty confused. I have some questions...that i'm sure they are very simple for you. So here they are:

1. WHERE should i add this line?

ColorChat(0, RED, "^x01ADMIN^x04 X^x01:^x03 gag^x04 Y^x01 for^x03 200.00^x01 minutes.");

in the amx_gag.sma ?

2. To use the function i need to have the plugin ColorChat.amxx already running? (i think so)

3. To use the function in ANY other plugin's sma...what do i need to modify? (only the print_chat functions?)

Thank you in advance

To be more precise:
I have this SMA:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define adtime 600.0 //Default of 10 minuites
new pcvar_Advertise
new pcvar_Display
public plugin_init()
{
register_plugin("Reset Score""1.0""Silenttt")
 
//You may type /resetscore or /restartscore
register_clcmd("say /resetscore""reset_score")
register_clcmd("say /rrscore""reset_score")
 
//This command by default will be set at 0
//Change it to 1 in server.cfg if you want
//A message to be shown to advertise this.
pcvar_Advertise register_cvar("sv_rsadvertise""0")
//This command by default is also 0
//Change it to 1 in server.cfg if you want
//It to show who reset their scores when they do it
pcvar_Display register_cvar("sv_rsdisplay""0")
 
if(
get_cvar_num("sv_rsadvertise") == 1)
{
set_task(adtime"advertise"___"b")
}
}
public 
reset_score(id)
{
//These both NEED to be done twice, otherwise your frags wont
//until the next round
cs_set_user_deaths(id0)
set_user_frags(id0)
cs_set_user_deaths(id0)
set_user_frags(id0)
 
if(
get_pcvar_num(pcvar_Display) == 1)
{
new 
name[33]
get_user_name(idname32)
ColorChat(0RED"^x01[AMXX] ^x03%s ^x01si-a resetat scorul."name)
}
else
{
ColorChat(idprint_chat"[AMXX] You have just reset your score.")
}
}
public 
advertise()
{
set_hudmessage(25500, -1.00.2000.212.0)
show_hudmessage(0"By typing /resetscore you can restart your deaths and kills back to 0.")
}
public 
client_putinserver(id)
{
if(
get_pcvar_num(pcvar_Advertise) == 1)
{
set_task(10.0"connectmessage"id__"a"1)
}
}
public 
connectmessage(id)
{
if(
is_user_connected(id))
{
//client_print(id, print_chat, "By typing /resetscore at any time during the game, you can reset your deaths and kills back to 0 (rather than reconnecting)")
}

when i try to compile it, i get errors...what could be the problem?

Last edited by FLAiTE; 03-29-2009 at 04:05.
FLAiTE is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-19-2009 , 04:19   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #56

ConnorMcLeod something like this?
Attached Files
File Type: sma Get Plugin or Get Source (colored.sma - 741 views - 4.7 KB)
__________________

Last edited by joaquimandrade; 05-19-2009 at 15:32.
joaquimandrade is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-19-2009 , 04:34   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #57

Like I've said you, it's interesting but a bit overhead to the purpose wanted.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2009 , 10:44   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #58

Quote:
Originally Posted by joaquimandrade View Post
ConnorMcLeod something like this:
?
Not really, fake natives that could support ML(send multiple MSG_ONE_UNRE if ML used, MSG_BROADCAST if not), id=0, multiple colors.

Basically colors should be :

enum Colors {
NoChange,
Red,
Blue,
Grey
}

And native should be :

ColorChat(index, Colors:Color, szMessage[], any:...)

+ some specific keys as !t !n !g should be replaced with char 0x01 0x03 0x04


Then all those plugins wouldn't require to duplicate this colorchat includes.


Arkshine already made one but he keeps it private.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-19-2009 at 10:52.
ConnorMcLeod is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 05-19-2009 , 13:19   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #59

Updated. Kept the syntax, added ML.
__________________
joaquimandrade is offline
Juk0
Member
Join Date: Mar 2009
Old 06-02-2009 , 07:42   Re: CS Color Chat Function Updated:[01/26/2007]
Reply With Quote #60

How i get my text like:
[Green]Clanname[/Green][Grey]Lucky u, u get scout with 0 ammo[/Grey]
Without that i need to be in spec.???

Sorry my bad english
Juk0 is offline
Reply


Thread Tools
Display Modes

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:23.


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