Raised This Month: $ Target: $400
 0% 

Colors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KoVeNaNT
Junior Member
Join Date: Oct 2007
Old 10-31-2007 , 15:13   Colors
Reply With Quote #1

Hi folks.

How come this doesn't work... I want the "[ADMIN Connected]" text to be green, and the admin name to be yellow.

PHP Code:
client_print(0print_chat"^x04[ADMIN Connected]^x01%s"name); 
But, how come all the text turns out yellow?
KoVeNaNT is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-31-2007 , 15:18   Re: Colors
Reply With Quote #2

Duh...can't do it like that. Take a look here : http://forums.alliedmods.net/showthr...ight=Colorchat
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
KoVeNaNT
Junior Member
Join Date: Oct 2007
Old 10-31-2007 , 15:31   Re: Colors
Reply With Quote #3

Quote:
Originally Posted by Alka View Post
Duh...can't do it like that. Take a look here : http://forums.alliedmods.net/showthr...ight=Colorchat
Ok, done that... But I don't know how to implement that to my script. Anyone want to help me out with that?

Here's my script anyway:

PHP Code:
#pragma semicolon 1 
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "PlayerAnnounce"
#define VERSION "1.0"
#define AUTHOR "greVen"

public plugin_init() 

    
register_plugin("PlayerAnnounce","greVen","1.0");     

public 
client_authorized(id)

 
set_task(1.0,"announce",id+5585);
}
public 
announce(id){
 
id id-5585;
 if (
get_user_flags(id) & ADMIN_KICK
 { 
  new 
name[32]; 
  
get_user_name(id,name,sizeof(name)-1); 
  
set_hudmessage(2552552550.030.5500.025.00.010.14)
  
show_hudmessage(0"ADMIN: %s has connected."name);
  
client_print(0print_chat"[ADMIN Connected] %s"name);
  
console_print(0"#### ADMIN %s connected ####"name);
 } 
 if (
get_user_flags(id) & ADMIN_LEVEL_H)
 {
  new 
name[32];
  
get_user_name(id,name,sizeof(name)-1);
  
set_hudmessage(02552550.030.5500.025.00.010.14)
  
show_hudmessage(0"VIP: %s has connected."name);
  
client_print(0print_chat"[VIP Connected] %s"name);
  
console_print(0"#### VIP %s connected ####"name);
 }
 
 if (
get_user_flags(id) & ADMIN_USER)
 {
  new 
name[32];
  
get_user_name(id,name,sizeof(name)-1);
  
console_print(0"#### PLAYER %s connected ####"name);
  
client_print(0print_chat"[PLAYER Connected] %s",name);
 } 


Last edited by KoVeNaNT; 10-31-2007 at 15:49.
KoVeNaNT is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 10-31-2007 , 16:21   Re: Colors
Reply With Quote #4

The scripts on that tutorial clearly show how to format a message to include color
__________________
M249-M4A1 is offline
KoVeNaNT
Junior Member
Join Date: Oct 2007
Old 11-02-2007 , 05:08   Re: Colors
Reply With Quote #5

A friend told me that this code should work...

PHP Code:
format(message1127"^x04[ADMIN Connected]^x01 %s"name
He told me that this will work if I change the color of the first words in the sentece, meaning I can't do this:

PHP Code:
format(message1127"[ADMIN Connected]^x04 %s"name
But I still can't get it to work... Any suggestions (without including the ColorChat.sma) ?
KoVeNaNT 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 01:16.


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