Raised This Month: $ Target: $400
 0% 

[L4D2] pcsWelcome Message (1.21)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ball2hi
Senior Member
Join Date: Feb 2010
Plugin ID:
8714
Plugin Version:
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Uses hook event 'player_team' to determine fully-loaded players, and display a message.
    Old 06-16-2024 , 16:02   [L4D2] pcsWelcome Message (1.21)
    Reply With Quote #1

    Description
    This plugin uses HookEvent("player_team") and grabs their new (and old) team. If their team is 0, they aren't fully-loaded. If their team is 1, they are loaded but haven't been assigned a team yet because other players are still loading (or are about to be assigned a team). Once players have been assigned to team 2 (survivors) or team 3 (infected), they are fully past the loading screen and can see chat. This plugin then displays a message to them. This plugin should be compatible with competitive L4D2 servers as well.

    By default, this prints 2 messages to each player individual, translated to their language provided in the phrases file. You also have an option to make it print every map, or just on the very first time they connect to the server. Once they disconnect, they'll see the welcome message again.

    An autoexec is created in cfg/sourcemod for this plugin.

    Cvars
    • pcs_everymap "1" // Whether to print every map.
    • pcs_lines "2" // How many lines to print.
    • pcs_finalmsg "1" // Should we print a final message?
    • pcs_lines_final "2" // How many lines to print for final message?

    Other plugins use things like player_connect, player_spawn, or OnClientPutInServer(), etc. Some of these fire multiple times in L4D2 especially during map changes, and don't cover the initial time everyone is loading in from a lobby where load times and connections vary. As well, things like OnClientPutInServer() will fire before a client finishes loading.

    Compiling

    In order to compile, you will need colors.inc ->
    https://forums.alliedmods.net/showthread.php?t=96831

    Installation

    You don't need to mess with any of the code to change the messages in the translation files.
    pcsWelcome.smx -> addons/sourcemod/plugins
    pcswelcome.phrases.txt -> addons/sourcemod/translations

    Changelog:
    Code:
    1.21 (July 17th - 2024)
       - Added some validity checks in PlayerQuit, Event_VehicleLeave, and Event_VersusFinished to prevent client 0 errors.
    
    1.2 (July 16th - 2024)
       - Added cvars and code related to sending a "final message" to the players. Using "versus_match_finished" and "finale_vehicle_leaving".
    
    1.1 (July 16th - 2024)
       - Used ArrayList and user's SteamAuth to check if they were connected. Prior design caused mismatches for "pcs_everymap" "0".
    
    1.0 (July 16th - 2024)
       - Initial release.
    Additional
    This is a very simple plugin. While I plan to add to it, the whole point of it is for others to build on it and tailor it to their own liking. You can increase the amount of lines by changing a few things in a few places easily. The plugin also should work for Left4Dead1, but I do not have a server setup to test these so if you want you can remove the public APLRes AskPluginLoad2 at the top to let it load.
    Attached Files
    File Type: txt pcswelcome.phrases.txt (910 Bytes, 9 views)
    File Type: sp Get Plugin or Get Source (pcsWelcome.sp - 3 views - 5.4 KB)
    File Type: smx pcsWelcome.smx (8.1 KB, 2 views)

    Last edited by ball2hi; Yesterday at 12:01.
    ball2hi is online now
    sonic155
    Senior Member
    Join Date: Mar 2019
    Old 06-16-2024 , 16:04   Re: [L4D2] pcsWelcome Message
    Reply With Quote #2

    no sp
    no plugin
    no Translation
    sonic155 is offline
    ball2hi
    Senior Member
    Join Date: Feb 2010
    Old 06-16-2024 , 16:10   Re: [L4D2] pcsWelcome Message
    Reply With Quote #3

    Quote:
    Originally Posted by sonic155 View Post
    no sp
    no plugin
    no Translation
    I noticed as soon as I submitted. I've edited the post and uploaded them immediately. Having issues with the website being slow for me at the moment.
    ball2hi is online now
    liquidplasma
    Member
    Join Date: May 2023
    Old 06-16-2024 , 22:52   Re: [L4D2] pcsWelcome Message (1.1)
    Reply With Quote #4

    does colors work for L4D2?
    liquidplasma is offline
    ball2hi
    Senior Member
    Join Date: Feb 2010
    Old Yesterday , 01:23   Re: [L4D2] pcsWelcome Message (1.1)
    Reply With Quote #5

    Quote:
    Originally Posted by liquidplasma View Post
    does colors work for L4D2?
    It's been working for me on my servers with CPrintToChat.
    ball2hi is online now
    Bluetool
    Junior Member
    Join Date: Jul 2016
    Location: South Korea
    Old Yesterday , 09:26   Re: [L4D2] pcsWelcome Message (1.1)
    Reply With Quote #6

    Quote:
    Originally Posted by ball2hi View Post
    It's been working for me on my servers with CPrintToChat.
    only few colors are working in l4d2. does color.inc supports other colors in l4d2? (Purple, Pink etc.)

    Current Color works in l4d2:

    Default
    Grey(Spectator)
    Blue(Survivors)
    Red(Infected)
    Olive(Achievement)
    Orange
    Lightgreen
    Bluetool is offline
    ball2hi
    Senior Member
    Join Date: Feb 2010
    Old Yesterday , 12:02   Re: [L4D2] pcsWelcome Message (1.1)
    Reply With Quote #7

    Quote:
    Originally Posted by Bluetool View Post
    only few colors are working in l4d2. does color.inc supports other colors in l4d2? (Purple, Pink etc.)

    Current Color works in l4d2:

    Default
    Grey(Spectator)
    Blue(Survivors)
    Red(Infected)
    Olive(Achievement)
    Orange
    Lightgreen
    I don't think I've seen purple or pink. Someone would probably have to test all the colors. I think someone somewhere already has, but I don't remember.
    ball2hi is online now
    JustMadMan
    Member
    Join Date: Feb 2023
    Old Yesterday , 15:57   Re: [L4D2] pcsWelcome Message (1.1)
    Reply With Quote #8

    Quote:
    Originally Posted by Bluetool View Post
    only few colors are working in l4d2. does color.inc supports other colors in l4d2? (Purple, Pink etc.)

    Current Color works in l4d2:

    Default
    Grey(Spectator)
    Blue(Survivors)
    Red(Infected)
    Olive(Achievement)
    Orange
    Lightgreen
    There have never been other chat colors in L4D2

    Last edited by JustMadMan; Yesterday at 16:00.
    JustMadMan 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 05:38.


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