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

Color Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lantimilan
Senior Member
Join Date: May 2016
Old 03-10-2017 , 11:50   Color Problem
Reply With Quote #1

Hi can i edit one text :

client_print(0, print_chat, "[LS - AFK Slay]: %s eshte vrare per shkak te qendrimit ne AFK.", name);

I want to [ ] have yellow color and text LS - AFK Slay red text , and eshte vrare per shkak te qendrimit ne AFK. to have green color can you help me ?
lantimilan is offline
Send a message via MSN to lantimilan
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-10-2017 , 12:27   Re: Color Problem
Reply With Quote #2

Add #include <colorchat>

Replace client_print with ColorChat
Replace print_chat with TEAM_COLOR

^4 = green
^3 = team color
^1 = normal (yellow)

"^4This is a ^3cool ^1text in the ^4wrong section"
__________________

Last edited by OciXCrom; 03-11-2017 at 19:35.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-10-2017 , 12:34   Re: Color Problem
Reply With Quote #3

Quote:
Originally Posted by lantimilan View Post
Colorchat(0, print_chat, "^1[^3LS - AFK Slay^1]^3: %s eshte vrare per shkak te qendrimit AFK.", name)
__________________

Last edited by edon1337; 03-12-2017 at 11:13.
edon1337 is offline
lantimilan
Senior Member
Join Date: May 2016
Old 03-10-2017 , 19:56   Re: Color Problem
Reply With Quote #4

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define TIME 20.0
new Float:player_origin[33][3];
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
}

public e_Spawn(id)
{
if(is_user_alive(id))
{
set_task(0.8, "get_spawn", id);
}
return HAM_IGNORED;
}

public get_spawn(id)
{
pev(id, pev_origin, player_origin[id]);
set_task(TIME, "check_afk", id);
}

public check_afk(id)
{
if(is_user_alive(id))
{
if(same_origin(id))
{
user_kill(id);
new name[33];
get_user_name(id, name, 32);
client_print(0, print_chat, "[LS - AFK Slay]: %s eshte vrare per shkak te qendrimit ne AFK.", name);
}
}
}

public same_origin(id)
{
new Floatrigin[3];
pev(id, pev_origin, origin);
for(new i = 0; i < 3; i++)
if(origin[i] != player_origin[id][i])
return 0;
return 1;
}


Can you edit this text and just i convert ?
lantimilan is offline
Send a message via MSN to lantimilan
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-11-2017 , 09:18   Re: Color Problem
Reply With Quote #5

Are you stupid or something? Can't you understand a simple tutorial?
__________________

Last edited by OciXCrom; 03-11-2017 at 09:19.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
lantimilan
Senior Member
Join Date: May 2016
Old 03-11-2017 , 10:31   Re: Color Problem
Reply With Quote #6

I cant understand because im not study for scripting or to works with code just i put in my server and i like to see , if you can help me thanks, if not no problem
lantimilan is offline
Send a message via MSN to lantimilan
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-11-2017 , 19:34   Re: Color Problem
Reply With Quote #7

I already helped you. Stop being lazy and at least try to do what I told you. "Studying scripting" is not required in order to understand 3 simple sentences.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-12-2017 , 05:37   Re: Color Problem
Reply With Quote #8

I already gave you the solution.... If you can't edit 3 symbols then you don't deserve having a server.
Code:
#include <amxmodx> #include <amxmisc> #include <colorchat> #include <hamsandwich> #include <fakemeta> #define TIME 20.0 new Float:player_origin[33][3]; public plugin_init() {     RegisterHam(Ham_Spawn, "player", "e_Spawn", 1); } public e_Spawn(id) {     if(is_user_alive(id))     {         set_task(0.8, "get_spawn", id);     }     return HAM_IGNORED; } public get_spawn(id) {     pev(id, pev_origin, player_origin[id]);     set_task(TIME, "check_afk", id); } public check_afk(id) {     if(is_user_alive(id))     {         if(same_origin(id))         {             user_kill(id);             new name[33];             get_user_name(id, name, 32);             ColorChat(0, TEAM_COLOR, "^1[^3LS - AFK Slay^1]^3: %s eshte vrare per shkak te qendrimit AFK.", name)         }     } } public same_origin(id) {     new Floatrigin[3];     pev(id, pev_origin, origin);     for(new i = 0; i < 3; i++)     if(origin[i] != player_origin[id][i])     return 0;     return 1; }
__________________

Last edited by edon1337; 03-13-2017 at 08:11.
edon1337 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-12-2017 , 10:20   Re: Color Problem
Reply With Quote #9

Since when is client_print capable of displaying colored messages?!
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-12-2017 , 11:13   Re: Color Problem
Reply With Quote #10

Quote:
Originally Posted by OciXCrom View Post
Since when is client_print capable of displaying colored messages?!
. . .
__________________
edon1337 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 23:23.


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