Raised This Month: $203 Target: $400
 50% 

DeadChat 1.3


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Plugin ID:
464
Plugin Version:
2.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    13 
    Plugin Description:
    Dead players can use chat to talk to alive players
    Unapprover:
    Reason for Unapproving:
    Use http://forums.alliedmods.net/showthread.php?t=171734
    Old 07-12-2008 , 15:58   DeadChat 1.3
    Reply With Quote #1

    DeadChat
    Version 2.0


    Requirements:
    • Sourcemod 1.0.3
    Supported Games:
    • Counter-Strike: Source
    • Team Fortress 2
    Description:

    This plugin allows dead players using chat to communicate with alive players. By default it will read sv_alltalk as it's enable cvar. You can use the override cvar to enable or disable the plugin regardless of sv_alltalk (see below). Alive players will see exactly what the dead players see as far as chat msgs go. Names appear as their team color and its formatted exactly the same as valve made dead chat msgs appear.

    Cvar(s):
    • deadchat_enable - Enable deadchat (-1: Read sv_alltalk, 0: Disable, 1: Enable)
    • deadchat_teamsay - Allow dead players to talk to alive teammates through team-only chat. (Aka "ghosting")
    Todo: (Strikethrough = Completed)
    • (none)
    Installation:
    • Extract deadchat.smx file to sourcemod/plugins
    • Extract deadchat.phrases.txt to sourcemod/translations
    • Your done!
    Changelog:

    July 12th
    • Released
    July 13th
    • say_team as a dead person will only show the text to their own team (dead or alive)
    July 15th
    • Re-arranged some code to easily add support for other games
    • TF2 support added
    August 14th
    • Separated CSS and TF2 into their own plugins
    March 19th 2010
    • Added deadchat_teamsay cvar to prevent ghosting via chat.
    • There is only 1 source code for all games, the defines tell what game to compile it for.
    • Translations added so it can support other languages.
    • Clients that are silenced or gagged (or for some reason just can't use chat) will be ignored by the plugin.
    • Added a command that forces one client to say something to a specified group of targets with an optional parameter to print it as if they were dead.
    • Plugin was recoded.. that might be important, idk.
    Attached Files
    File Type: txt deadchat.phrases.txt (746 Bytes, 8594 views)
    File Type: sp Get Plugin or Get Source (deadchat_cstrike.sp - 11865 views - 11.6 KB)
    File Type: sp Get Plugin or Get Source (deadchat_tf.sp - 7048 views - 11.6 KB)
    __________________

    Last edited by Greyscale; 03-19-2010 at 21:01.
    Greyscale is offline
    Liam
    SourceMod Developer
    Join Date: Jan 2008
    Location: Atlanta, GA
    Old 07-12-2008 , 17:21   Re: DeadTalk 1.0
    Reply With Quote #2

    Nice
    Liam is offline
    Box Cutter
    SourceMod Donor
    Join Date: Dec 2006
    Location: Arizona
    Old 07-12-2008 , 19:45   Re: DeadTalk 1.0
    Reply With Quote #3

    Yes nice. I hate when I am typing a long message and right when I hit send I get killed and NO ONE SEE'S IT!!!

    -BC
    __________________
    Box Cutter is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 07-12-2008 , 20:40   Re: DeadTalk 1.0
    Reply With Quote #4

    I modified this plugin quite a bit for my servers. Here's a few suggestions for what you should change:
    1. Use RegAdminCmd() for "say" and "say_team" and make a callback for each
      • If the person uses "say", print it to everybody
      • If the person uses "say_team", print it to that person's team only
    2. If the first character of the player's chat is @, handle the plugin
    bl4nk is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-12-2008 , 20:57   Re: DeadTalk 1.0
    Reply With Quote #5

    I'll fix it so it only prints to the player's team with say_team.

    Actually instead of checking for "@" I'm going to use event player_chat because it includes an event variable "teamonly"
    __________________
    Greyscale is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 07-12-2008 , 21:23   Re: DeadTalk 1.0
    Reply With Quote #6

    Quote:
    Originally Posted by Greyscale View Post
    Actually instead of checking for "@" I'm going to use event player_chat because it includes an event variable "teamonly"
    The @ thing isn't because of team chat, it's to prevent stuff like admin chat or all chat from being doubled up.
    bl4nk is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-13-2008 , 02:06   Re: DeadTalk 1.0
    Reply With Quote #7

    player_chat won't be fired if any other plugin returns Plugin_Handled in a "say(_team)" command callback.

    So there won't be any need to check for it, player_chat is only fired if it actually gets to chat

    EDIT: Apparently there is no player_chat event :/

    I'll do it your way

    Code:
    "player_chat"                // a public player chat
        {
            "teamonly"    "bool"        // true if team only chat
            "userid"     "short"        // chatting player 
            "text"          "string"    // chat text
        }
    I dont see how it's not working..
    __________________

    Last edited by Greyscale; 07-13-2008 at 02:49.
    Greyscale is offline
    bl4nk
    SourceMod Developer
    Join Date: Jul 2007
    Old 07-13-2008 , 03:44   Re: DeadTalk 1.0
    Reply With Quote #8

    PHP Code:
    #pragma semicolon 1

    #include <sourcemod>

    // Global Definitions
    #define PLUGIN_VERSION "1.0.0"

    // Functions
    public Plugin:myinfo =
    {
        
    name "DeadChat",
        
    author "bl4nk",
        
    description "Alive players can see the chat of dead players",
        
    version PLUGIN_VERSION,
        
    url "http://forums.alliedmods.net"
    };

    public 
    OnPluginStart()
    {
        
    CreateConVar("sm_deadchat_version"PLUGIN_VERSION"DeadChat Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

        
    RegConsoleCmd("say"Command_Say);
        
    RegConsoleCmd("say_team"Command_SayTeam);
    }

    public 
    Action:Command_Say(clientargs)
    {
        if (!
    GetConVarBool(FindConVar("sv_alltalk")))
            return 
    Plugin_Continue;

        if (
    IsPlayerAlive(client))
            return 
    Plugin_Continue;

        
    decl String:text[192];
        
    GetCmdArgString(textsizeof(text));

        new 
    startidx 0;
        if (
    text[0] == '"')
        {
            
    startidx 1;

            new 
    len strlen(text);
            if (
    text[len-1] == '"')
            {
                
    text[len-1] = '\0';
            }
        }

        if (
    text[startidx] == '@')
            return 
    Plugin_Continue;

        new 
    maxclients GetMaxClients();
        for (new 
    1<= maxclientsi++)
        {
            if (
    IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i))
              
    SayText2(iclienttext[startidx]);
        }

        return 
    Plugin_Continue;
    }

    public 
    Action:Command_SayTeam(clientargs)
    {
        if (!
    GetConVarBool(FindConVar("sv_alltalk")))
            return 
    Plugin_Continue;

        if (
    IsPlayerAlive(client))
            return 
    Plugin_Continue;

        
    decl String:text[192];
        
    GetCmdArgString(textsizeof(text));

        new 
    startidx 0;
        if (
    text[0] == '"')
        {
            
    startidx 1;

            new 
    len strlen(text);
            if (
    text[len-1] == '"')
            {
                
    text[len-1] = '\0';
            }
        }

        if (
    text[startidx] == '@')
            return 
    Plugin_Continue;

        new 
    maxclients GetMaxClients();
        for (new 
    1<= maxclientsi++)
        {
            if (
    IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == GetClientTeam(client))
              
    SayText2(iclienttext[startidx], true);
        }

        return 
    Plugin_Continue;
    }

    stock SayText2(clientindex, const String:Msg[], bool:teamOnly=false)
    {
        if (
    strlen(Msg) > 191)
        {
            
    LogError("szMsg (%i) > 191"strlen(Msg));
            return;
        }

        new 
    Handle:hBf;
        if (!
    client)
            
    hBf StartMessageAll("SayText2");
        else
            
    hBf StartMessageOne("SayText2"client);

        if (
    hBf != INVALID_HANDLE)
        {
            
    decl String:playerName[32];
            
    GetClientName(indexplayerNamesizeof(playerName));

            
    BfWriteByte(hBfindex);
            
    BfWriteByte(hBftrue);

            if (!
    teamOnly)
                
    BfWriteString(hBf"\x01*DEAD* \x03%s1 \x01:  %s2");
            else
                
    BfWriteString(hBf"\x01*DEAD*(TEAM) \x03%1 \x01:  %s2");

            
    BfWriteString(hBfplayerName);
            
    BfWriteString(hBfMsg);

            
    EndMessage();
        }

    Here's my version if you're interested.
    bl4nk is offline
    Greyscale
    SourceMod Plugin Approver
    Join Date: Dec 2007
    Location: strYoMommasHouse[you];
    Old 07-13-2008 , 14:11   Re: DeadTalk 1.0
    Reply With Quote #9

    I was working on this last night, I now I have it done except for some reason it's cutting off (Counter-Terrorist), I'm to (Counter-Terr).

    I'm trying to fix this then I can get it out.
    __________________
    Greyscale is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 07-13-2008 , 14:23   Re: DeadTalk 1.0
    Reply With Quote #10

    Woo, im guessing this will work on TF2, exactly what im looking for.
    __________________

    DontWannaName is offline
    Reply


    Thread Tools
    Display Modes

    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 11:53.


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