AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [INC] Colors (1.0.5) (https://forums.alliedmods.net/showthread.php?t=96831)

Ellie 03-30-2014 20:08

Re: [INC] Colors (1.0.5)
 
Just wanted to say that I'm still testing it. Want to make sure before I say it works or not.

Ellie 04-01-2014 01:30

Re: [INC] Colors (1.0.5)
 
Well after lots of testing with various plugins, I can safely say it works :up: Thanks Powerlord. :) What do I owe you?

Powerlord 04-23-2014 17:23

Re: [INC] Colors (1.0.5)
 
3 Attachment(s)
Turns out my tester was calling the wrong code and not testing CShowActivity2. Which was trying to print the wrong variable.

So, here's a new version that fixes it.

Ellie 06-10-2014 03:25

Re: [INC] Colors (1.0.5)
 
Thought I mentioned this but I guess I didn't. The chat tags don't get removed when it's printed to console/server. Otherwise it works perfectly ;)

Powerlord 06-10-2014 09:41

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by Ellie (Post 2149196)
Thought I mentioned this but I guess I didn't. The chat tags don't get removed when it's printed to console/server. Otherwise it works perfectly ;)

Using which command, CReplyToCommand?

Ellie 06-10-2014 10:45

Re: [INC] Colors (1.0.5)
 
Whoops forgot to put that in the post. It's only CShowActivity2 it seems where the tags aren't removed when printed to console/server.

Powerlord 06-10-2014 11:15

Re: [INC] Colors (1.0.5)
 
1 Attachment(s)
Quote:

Originally Posted by Ellie (Post 2149353)
Whoops forgot to put that in the post. It's only CShowActivity2 it seems where the tags aren't removed when printed to console/server.

It's weird... ShowActivity2 always prints to the chat when the player isn't the server. The comment next to it says:

Code:

        /* We don't display directly to the console because the chat text
        * simply gets added to the console, so we don't want it to print
        * twice.
        */

...which I don't think is correct seeing as how the message in question is being sent to the user who did the action via the SM "ChatSayText" method, which iirc is the SayText2 usermessage on most games.

I really doubt this will fix your problem, but it does pull out some old code from CShowActivity2 that shouldn't have been executing as well as fixes a minor bug in CShowActivity/CShowActivityEx.

sim242 09-01-2014 23:22

Re: [INC] Colors (1.0.5)
 
It seems to not be working correctly.. I can't get purple and blue working in the same sentence.

DiskJockeyED 03-25-2015 08:49

Re: [INC] Colors (1.0.5)
 
don't work for cs go :/

I take #include <colors>

And PrintToChatAll("{green}Blablabla");

But i doesn't work why ? :/

And colors.inc in sourcemod/scipting/include ;)

Why :)

Thank you ;)

KissLick 03-25-2015 11:03

Re: [INC] Colors (1.0.5)
 
Read carefully https://forums.alliedmods.net/showpo...36&postcount=1 - use CPrintToChatAll

pcmaster 07-02-2015 13:40

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by sim242 (Post 2192870)
It seems to not be working correctly.. I can't get purple and blue working in the same sentence.

Mega bump, but purple doesn't work at all. Even if there is no other blue tag in the message.

KALASH NICOLE 05-09-2017 05:10

Re: [INC] Colors (1.0.5)
 
hi, i want to add red color to the chat message of this code (printtochatall and kickclient):

could you repost it with the correct code ?

PHP Code:

ConVar sm_teamkill_limit;

public 
void OnPluginStart()
{
    
sm_teamkill_limit CreateConVar("sm_teamkill_limit""3""The limit before of team kill before kicking the player"FCVAR_NONEtrue0.0);
    
HookEventEx("round_start"event);
    
HookEventEx("player_death"event);
    
HookEventEx("player_disconnect"event);
}

public 
void event(Event event, const char[] namebool dontBroadcast)
{
    static 
int teamkill_counts[MAXPLAYERS+1];

    if(
sm_teamkill_limit.IntValue <= 0) return;

    if(
StrEqual(name"round_start"))
    {
        for(
int x 1<= MaxClientsx++)
        {
            
teamkill_counts[x] = 0;
        }
        return;
    }

    if(
StrEqual(name"player_disconnect"))
    {
        
teamkill_counts[GetClientOfUserId(event.GetInt("userid"))] = 0;
        return;
    }

    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int attacker GetClientOfUserId(event.GetInt("attacker"));

    if(!
attacker || attacker == victim || GetClientTeam(attacker) != GetClientTeam(victim)) return;

    
teamkill_counts[attacker]++;
    
PrintToChatAll("%N TEAMKILLED %N (%i/%i)."attackervictimteamkill_counts[attacker], sm_teamkill_limit.IntValue);

    if(
teamkill_counts[attacker] >= sm_teamkill_limit.IntValue && !IsClientInKickQueue(attacker))
    {
        
KickClient(attacker"Kicked for reaching the TeamKill limit.");
       
    }
    



condolent 06-24-2017 13:07

Re: [INC] Colors (1.0.5)
 
No longer works in CSGO, it doesn't change the colors sadly! At the very least I can't seem to get it to work. Been using this for a year and newly compiled plugins won't work

eziosid 12-17-2017 07:53

Re: [INC] Colors (1.0.5)
 
1 Attachment(s)
hello i need help here dont know what is wrong is this
HTML Code:

PrintToChatAll("\x01%N »»\x04 incapacitated {blue}%N",attacker, target);
PrintToChatAll("{blue}%N ««\x04incapacitated.\x01(by himself)",target);
PrintToChatAll("{blue}%N ««\x04 Is incapacitated.",target);

and it dose not work it's for l4d2 attached pic

Luckiris 12-17-2017 14:01

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by eziosid (Post 2566740)
hello i need help here dont know what is wrong is this
HTML Code:

PrintToChatAll("\x01%N »»\x04 incapacitated {blue}%N",attacker, target);
PrintToChatAll("{blue}%N ««\x04incapacitated.\x01(by himself)",target);
PrintToChatAll("{blue}%N ««\x04 Is incapacitated.",target);

and it dose not work it's for l4d2 attached pic

You need to use CPrintToChatAlll so like this :
CPrintToChatAlll("{blue}%N ««\x04 Is incapacitated.",target).

eziosid 12-18-2017 01:52

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by Luckiris (Post 2566784)
You need to use CPrintToChatAlll so like this :
CPrintToChatAlll("{blue}%N ««\x04 Is incapacitated.",target).

thank you very much sir its work i missed that 1 work nice tnx aouthor also for great job and all on this site
PHP Code:

CPrintToChatAll("{blue}%N« \x04Is Dead.\x01»»{blue}%d 웃",targetcount); 

worked nice keep it up

King_OXO 11-21-2022 18:22

Re: [INC] Colors (1.0.5)
 
1 Attachment(s)
colors inc updated for sourcemod 1.11

axelnieves2012 06-04-2024 15:55

Re: [INC] Colors (1.0.5)
 
Quote:

Originally Posted by King_OXO (Post 2793368)
colors inc updated for sourcemod 1.11

Thanks you, i love you


All times are GMT -4. The time now is 22:58.

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