Raised This Month: $32 Target: $400
 8% 

[ANY] Improved Player Joined Team Messages v1.3.0.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Plugin ID:
3382
Plugin Version:
1.3.0.2
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    39 
    Plugin Description:
    Replaces messages when player joins any team with new one
    Old 11-24-2012 , 08:20   [ANY] Improved Player Joined Team Messages v1.3.0.2
    Reply With Quote #1

    Description:
    - Currently Supported Games: Team Fortress 2, CS:S, Day of Defeat: Source, Half Life 2: Multiplayer and Left 4 Dead 2, Not sure about Left 4 Dead 1
    - Replaces old messages "Player has joined team" with new improved one.

    Installation:
    - Place improved_join_team.smx in : addons/sourcemod/plugins
    - Eventualy if you had installed before this plugin : Remove tf2_team_join.smx
    - Change Map

    Changelog:
    v1.0 - First Release
    v1.1 - Nickname color now is based on team which play is currently in
    v1.2 - Added Enable / Disable Cvar, removed the timers, version cvar and many more (Thanks to ReflexPoison )
    v1.3 - Added support for most games (Thanks again ReflexPoison )
    v1.3.0.1 - Fixed Wrong Team Colors in HL2: DM
    v1.3.0.2 - Fixed Wrong Team Numbers in HL2: DM

    Cvars:
    - sm_jointeam_enabled | 0 | 1 - Enables & Disables Plugin
    - sm_jointeam_bots | 0 | 1 - Enables / Disables Messages for bots (SUGGESTED TO HAVE THIS TURNED ON IN MvM)

    Media:
    [IMG]http://img33.**************/img33/5365/joinmsg.jpg[/IMG]

    Requires to compile:
    - More Colors

    Future Plans:
    - Color of Player nickname will be based on team which he currently is in.
    Attached Files
    File Type: sp Get Plugin or Get Source (improved_join_team.sp - 1842 views - 12.6 KB)
    File Type: smx improved_join_team.smx (11.1 KB, 1327 views)
    __________________
    ...

    Last edited by Oshizu; 09-03-2013 at 15:06.
    Oshizu is offline
    serpentine
    I don't have a problem
    Join Date: Feb 2011
    Location: Madison, WI
    Old 11-24-2012 , 13:04   Re: [TF2] Improved Player Joined Team Messages
    Reply With Quote #2

    I can't believe no one has done this before, if they actually haven't. Cool!
    __________________
    serpentine is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 11-24-2012 , 13:50   Re: [TF2] Improved Player Joined Team Messages v1.1
    Reply With Quote #3

    Things that raise a question with this plugin are:
    • Why do you require timers for a team hook message?
    • Why not allow users to designate specific name colors?

    Last edited by ReFlexPoison; 11-24-2012 at 13:53.
    ReFlexPoison is offline
    Oshizu
    Veteran Member
    Join Date: Nov 2012
    Location: Warsaw
    Old 11-24-2012 , 14:00   Re: [TF2] Improved Player Joined Team Messages v1.1
    Reply With Quote #4

    Quote:
    Originally Posted by ReFlexPoison View Post
    Things that raise a question with this plugin are:
    • Why do you require timers for a team hook message?
    • Why not allow users to designate specific name colors?
    - Without timers it would catch team that he actualy quits from. Example "From Red to Blue". If we use timer it catches team that he joined.
    __________________
    ...

    Last edited by Oshizu; 11-24-2012 at 14:03.
    Oshizu is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 11-24-2012 , 14:07   Re: [TF2] Improved Player Joined Team Messages v1.1
    Reply With Quote #5

    Quote:
    Originally Posted by Oshizu View Post
    - Without timers it would catch team that he actualy quits from. Example "From Red to Blue". If we use timer it catches team that he joined.
    Use event integers to find the old team of a client.

    Rewrote this few minutes ago. Added enable CVar, removed the timers, and added version CVar.

    Also, there is no need to post compiled binary if it compiles on the forums.
    PHP Code:
    #pragma semicolon 1

    #include <morecolors>

    #define PLUGIN_VERSION "1.2"

    new Handle:cvarEnabled;
    new 
    bool:gEnabled;

    public 
    Plugin:myinfo =
    {
        
    name "[TF2] Improved Join Team Messages",
        
    author "Oshizu",
        
    description "Improves messages that appear when player joins team.",
        
    version PLUGIN_VERSION,
        
    url "http://www.sourcemod.net",
    }

    public 
    OnPluginStart()
    {
        
    CreateConVar("sm_jointeam_version"PLUGIN_VERSION"Improved Join Team Messages Version"FCVAR_REPLICATED FCVAR_PLUGIN FCVAR_SPONLY FCVAR_DONTRECORD FCVAR_NOTIFY);
        
        
    cvarEnabled CreateConVar("sm_jointeam_enabled""1""Enable Improved Join Team Messages"FCVAR_PLUGINtrue0.0true1.0);
        
    gEnabled GetConVarBool(cvarEnabled);
        
        
    HookConVarChange(cvarEnabledCVarChange);

        
    HookEvent("player_team"Event_PlayerTeamEventHookMode_Pre);
    }

    public 
    CVarChange(Handle:convar, const String:oldValue[], const String:newValue[])
    {
        if(
    convar == cvarEnabledgEnabled GetConVarBool(cvarEnabled);
    }

    public 
    Action:Event_PlayerTeam(Handle:event, const String:szEventName[], bool:bDontBroadcast)
    {
        if(!
    gEnabled) return Plugin_Continue;

        new 
    client GetClientOfUserId(GetEventInt(event"userid"));
        if(!
    IsValidClient(client)) return Plugin_Continue;

        new 
    oldteam GetEventInt(event"oldteam");
        new 
    newteam GetEventInt(event"team");

        
    SetEventBroadcast(eventtrue);

        switch(
    oldteam)
        {
            case 
    01:
            {
                switch(
    newteam)
                {
                    case 
    0CPrintToChatAll("Player {gray}%N joined team unassigned"client);
                    case 
    1CPrintToChatAll("Player {gray}%N{DEFAULT} joined team {gray}Spectator"client);
                    case 
    2CPrintToChatAll("Player {gray}%N{DEFAULT} joined team {red}Red"client);
                    case 
    3CPrintToChatAll("Player {gray}%N{DEFAULT} joined team {blue}Blu"client);
                }
            }
            case 
    2:
            {
                switch(
    newteam)
                {
                    case 
    0CPrintToChatAll("Player {red}%N joined team unassigned"client);
                    case 
    1CPrintToChatAll("Player {red}%N{DEFAULT} joined team {gray}Spectator"client);
                    case 
    2CPrintToChatAll("Player {red}%N{DEFAULT} joined team {red}Red"client);
                    case 
    3CPrintToChatAll("Player {red}%N{DEFAULT} joined team {blue}Blu"client);
                }
            }
            case 
    3:
            {
                switch(
    newteam)
                {
                    case 
    0CPrintToChatAll("Player {blue}%N joined team unassigned"client);
                    case 
    1CPrintToChatAll("Player {blue}%N{DEFAULT} joined team {gray}Spectator"client);
                    case 
    2CPrintToChatAll("Player {blue}%N{DEFAULT} joined team {red}Red"client);
                    case 
    3CPrintToChatAll("Player {blue}%N{DEFAULT} joined team {blue}Blu"client);
                }
            }
        }
        return 
    Plugin_Continue;
    }

    stock bool:IsValidClient(clientbool:replay true)
    {
        if(
    client <= || client MaxClients || !IsClientInGame(client)) return false;
        if(
    replay && (IsClientSourceTV(client) || IsClientReplay(client))) return false;
        return 
    true;

    Attached Files
    File Type: sp Get Plugin or Get Source (tf2_team_join.sp - 594 views - 2.8 KB)

    Last edited by ReFlexPoison; 11-24-2012 at 14:13.
    ReFlexPoison is offline
    Oshizu
    Veteran Member
    Join Date: Nov 2012
    Location: Warsaw
    Old 11-24-2012 , 14:19   Re: [TF2] Improved Player Joined Team Messages v1.1
    Reply With Quote #6

    Quote:
    Originally Posted by ReFlexPoison View Post
    Use event integers to find the old team of a client.

    Rewrote this few minutes ago. Added enable CVar, removed the timers, and added version CVar.

    Also, there is no need to post compiled binary if it compiles on the forums.
    PHP Code:
    CODE 

    Thanks
    __________________
    ...

    Last edited by Oshizu; 11-24-2012 at 14:19.
    Oshizu is offline
    ServerUltimate
    Junior Member
    Join Date: Jul 2012
    Old 11-24-2012 , 18:15   Re: [TF2] Improved Player Joined Team Messages v1.2
    Reply With Quote #7

    Can you make a flag for the administrators and moderators, which will change the nickname color from green to the other?
    __________________
    Team Fortress 2
    IP:89.31.93.44:27020
    ServerUltimate is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 11-24-2012 , 18:25   Re: [TF2] Improved Player Joined Team Messages v1.2
    Reply With Quote #8

    Great plugin! As the above person said, it would be nice if you would allow for color customization.
    Sreaper is offline
    igotfits
    Senior Member
    Join Date: May 2009
    Old 12-03-2012 , 19:32   Re: [TF2] Improved Player Joined Team Messages v1.2
    Reply With Quote #9

    hi im trying to compile but it keeps giving me an morecolors error, you say to compile you'll need more colors i have that in my server already. but i dont understand how having that will compile with the .sp file done through compiler website. can u give a small tutorial or run through of steps. thanks
    igotfits is offline
    noodleboy347
    AlliedModders Donor
    Join Date: Mar 2009
    Old 12-03-2012 , 20:54   Re: [TF2] Improved Player Joined Team Messages v1.2
    Reply With Quote #10

    Quote:
    Originally Posted by igotfits View Post
    hi im trying to compile but it keeps giving me an morecolors error, you say to compile you'll need more colors i have that in my server already. but i dont understand how having that will compile with the .sp file done through compiler website. can u give a small tutorial or run through of steps. thanks
    You can't. You'll need to use the compiler in the scripting folder.
    noodleboy347 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 09:52.


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