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

Solved [CSGO] Weird printtochat bug of color


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-10-2018 , 16:13   [CSGO] Weird printtochat bug of color
Reply With Quote #1

PrintToChatAll("\x03%N\x01 tried to steal\x03 %N\x01's gold and failed., client, target);

For some reason the client doesn't get colored but target does, what am I doing wrong?

Solved by Javierko
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 07-10-2018 at 17:15.
eyal282 is offline
Javierko
AlliedModders Donor
Join Date: Sep 2017
Location: Czech republic
Old 07-10-2018 , 16:17   Re: [CSGO] Weird printtochat bug of color
Reply With Quote #2

Use this:
PHP Code:
PrintToChatAll(" \x03%N\x01 tried to steal\x03 %N\x01's gold and failed."clienttarget); 
I had same problem and i was really nervous that space at beginning will fix it, i hope
__________________
My Github & Sourcemod work.
If you like my work and if you want to support me, you can through PayPal.

Official SourceMod CZ/SK Discord: https://discord.gg/Qvar55a

Last edited by Javierko; 07-10-2018 at 17:55.
Javierko is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 07-10-2018 , 17:05   Re: [CSGO] Weird printtochat bug of color
Reply With Quote #3

this not true:
PHP Code:
PrintToChatAll("\x03%N\x01 tried to steal\x03 %N\x01's gold and failed., client, target); 
you must use this:
PHP Code:
PrintToChatAll("\x03%N\x01 tried to steal\x03 %N\x01's gold and failed"clienttarget); 
and you can use Multi Color:
https://forums.alliedmods.net/showthread.php?t=247770

PHP Code:
#include <multicolors>

CPrintToChatAll("{green}%N{default} tried to steal {lightred}%N{default}'s gold and failed"clienttarget); 

Last edited by Dr.Mohammad; 07-10-2018 at 17:06.
Dr.Mohammad is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 07-10-2018 , 19:31   Re: [CSGO] Weird printtochat bug of color
Reply With Quote #4

CSGO doesn't accept a color code for the first character.

Use a space or another char at the start of this string to fix the issue.
__________________
Neuro Toxin is offline
Wanheda
Junior Member
Join Date: Oct 2017
Location: Portugal ♥
Old 07-14-2018 , 07:46   Re: [CSGO] Weird printtochat bug of color
Reply With Quote #5

You forgot to close the " at the end of your sentence?
__________________
ʙᴇɪɴɢ ʜᴀᴘᴘʏ ᴅᴏᴇsɴ'ᴛ ᴍᴇᴀɴ ᴛʜᴀᴛ ᴇᴠᴇʀʏᴛʜɪɴɢ ɪs ᴘᴇʀꜰᴇᴄᴛ
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ𝐒𝐭𝐞𝐚𝐦
Wanheda 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 07:44.


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