AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Colors (https://forums.alliedmods.net/showthread.php?t=62616)

KoVeNaNT 10-31-2007 15:13

Colors
 
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?

Alka 10-31-2007 15:18

Re: Colors
 
Duh...can't do it like that. Take a look here : http://forums.alliedmods.net/showthr...ight=Colorchat

KoVeNaNT 10-31-2007 15:31

Re: Colors
 
Quote:

Originally Posted by Alka (Post 548102)
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);
 } 



M249-M4A1 10-31-2007 16:21

Re: Colors
 
The scripts on that tutorial clearly show how to format a message to include color

KoVeNaNT 11-02-2007 05:08

Re: Colors
 
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) ?


All times are GMT -4. The time now is 01:16.

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