Raised This Month: $ Target: $400
 0% 

creating a colored message (sequence in SMA)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FLAiTE
Member
Join Date: Aug 2008
Old 03-10-2009 , 07:43   creating a colored message (sequence in SMA)
Reply With Quote #1

hello guys.
well, i have this sma and i need to know what do i have to do so that the bolded messages change their color to blue @ CT or red @ T, green or remain orange.

Quote:
#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(id, 0)
set_user_frags(id, 0)
cs_set_user_deaths(id, 0)
set_user_frags(id, 0)

if(get_pcvar_num(pcvar_Display) == 1)
{
new name[33]
get_user_name(id, name, 32)
client_print(0, print_chat, "[AMXX] %s si-a resetat scorul.", name)
}
else
{
client_print(id, print_chat, "[AMXX] You have just reset your score.")
}
}
public advertise()
{
set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.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)")
}
}
any help?

P.S. it woud be very kind of you to bold the added sequence.

Last edited by FLAiTE; 03-10-2009 at 08:23.
FLAiTE is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-10-2009 , 07:49   Re: need some help
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=45753
__________________
fysiks is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-10-2009 , 08:21   Re: need some help
Reply With Quote #3

As per the Global Forum Rules, you need to have a descriptive topic title. If you wish for this topic to stay open, please correct the topic title before you post again.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
FLAiTE
Member
Join Date: Aug 2008
Old 03-10-2009 , 08:21   Re: need some help
Reply With Quote #4

well i'm really a n00b at these things...could you be more precise?
how to use what's written in that topic on my plugin?
FLAiTE is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-10-2009 , 09:11   Re: creating a colored message (sequence in SMA)
Reply With Quote #5

I can't use color chat myself cause I don't play CS. But what I usually do in this situation is just try some test codes. I think you can just take his ColorChat.amxx and use it. Change things for your setup and test again. If I'm learning something new myself I usually spend alot of time getting errors retrying and testing again. It's one of the best ways to learn .
__________________
fysiks 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 08:51.


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