Raised This Month: $ Target: $400
 0% 

Customize *DEAD* *SPEC* (TEAM)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TitanTF
Senior Member
Join Date: Mar 2016
Location: Singapore
Old 05-02-2016 , 02:19   Customize *DEAD* *SPEC* (TEAM)
Reply With Quote #1

Does anyone know how to customize *DEAD* *SPEC* and (TEAM) colors? I've seen servers changing the colors of these texts but I can't find a plugin for it.
TitanTF is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 05-02-2016 , 07:05   Re: Customize *DEAD* *SPEC* (TEAM)
Reply With Quote #2

You have to hook the message event, block it an make a new one.
__________________
Benoist3012 is offline
TitanTF
Senior Member
Join Date: Mar 2016
Location: Singapore
Old 05-02-2016 , 08:38   Re: Customize *DEAD* *SPEC* (TEAM)
Reply With Quote #3

Quote:
Originally Posted by Benoist3012 View Post
You have to hook the message event, block it an make a new one.
I see I see
TitanTF is offline
Michael Shoe Maker
Senior Member
Join Date: Apr 2016
Old 05-02-2016 , 08:42   Re: Customize *DEAD* *SPEC* (TEAM)
Reply With Quote #4

Is the event called "game_message"?
Michael Shoe Maker is offline
Farbror Godis
AlliedModders Donor
Join Date: Feb 2016
Old 05-02-2016 , 09:38   Re: Customize *DEAD* *SPEC* (TEAM)
Reply With Quote #5

Use OnClientSayCommand

"Returning Plugin_Handled bypasses the game function call."
__________________
Farbror Godis is offline
decl_mev
Member
Join Date: Dec 2015
Old 05-02-2016 , 09:48   Re: Customize *DEAD* *SPEC* (TEAM)
Reply With Quote #6

Theres many ways to achieve this heres a few:

1. Hook the correct user message to block and call a new with desired parameters -> call ClientSay(client, msg) -> return Plugin_Stop
2. AddCommandListener on say and say_team -> call ClientSay(client, argstring) -> return Plugin_Handled
3. RegConsoleCmd on say and say_team -> call ClientSay(client, argstring) -> return Plugin_Handled
4. OnClientSayCommand as Farbror Godis suggested

I find option 2 & 3 the easiest and most appealing for myself, but its up to you in the end.

Code:

stock void ClientSay(int fromclient, char[] msg)
{    

    // some sort of check if the client is gagged is needed for this
    // Reformat msg depending on wether client is in spectator or on a team and if the client is dead or alive

     Handle pb = StartMessageAll("SayText2", USERMSG_RELIABLE);
    if (pb != null)
    {
        PbSetInt(pb, "ent_idx", fromclient);
        PbSetBool(pb, "chat", false);
        PbSetString(pb, "msg_name", msg);
        PbAddString(pb, "params", "");
        PbAddString(pb, "params", "");
        PbAddString(pb, "params", "");
        PbAddString(pb, "params", "");
        
        EndMessage();
    }
}
__________________
If it isn't automated you aren't doing it right.

High quality servers with custom plugins @ http://sourcecode.community
Github @ https://github.com/meev
Steam @ http://steamcommunity.com/id/mevv
decl_mev 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 08:10.


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