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

[L4D2/ANY] Player Join Message


Post New Thread Reply   
 
Thread Tools Display Modes
Author
WinCher58
Junior Member
Join Date: Nov 2020
Plugin ID:
7496
Plugin Version:
1.0
Plugin Category:
All
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Players send a hintbox message when joining the game
    Old 02-11-2021 , 16:32   [L4D2/ANY] Player Join Message
    Reply With Quote #1

    The message appears when players log into the game. simple plugin

    my english is bad i am sorry
    Attached Files
    File Type: sp Get Plugin or Get Source ([ANY] Player_Join_Message.sp - 1386 views - 1.1 KB)
    File Type: smx [ANY] Player_Join_Message.smx (3.3 KB, 591 views)

    Last edited by WinCher58; 02-11-2021 at 16:40.
    WinCher58 is offline
    dr_lex
    Member
    Join Date: Dec 2014
    Old 02-11-2021 , 16:56   Re: [L4D2/ANY] Player Join Message
    Reply With Quote #2

    Quote:
    Originally Posted by WinCher58 View Post
    The message appears when players log into the game. simple plugin

    my english is bad i am sorry
    In my opinion, it will be better this way.

    HTML Code:
    #include <sourcemod>
    
    public Plugin myinfo = 
    {
    	name = "PlayerJoin",
    	author = "WinCher",
    	description = "Player Join Message On Your Server",
    	version = "1.0",
    	url = "http://www.sourcemod.net/"
    };
    
    public void OnClientPostAdminCheck(int client)
    {
    	if (!IsFakeClient(client))
    	{
    		char Name[64];
    		GetClientName(client, Name, sizeof(Name));
    		PrintHintTextToAll("Player %s Connected to server", Name);
    	}
    }
    
    public void OnClientDisconnect(int client)
    {
    	if (!IsFakeClient(client))
    	{
    		char Name[64];
    		GetClientName(client, Name, sizeof(Name));
    		PrintHintTextToAll("Player %s Disconnected the server", Name);
    	}
    }
    __________________
    dr_lex is offline
    WinCher58
    Junior Member
    Join Date: Nov 2020
    Old 02-11-2021 , 17:56   Re: [L4D2/ANY] Player Join Message
    Reply With Quote #3

    Quote:
    Originally Posted by dr_lex View Post
    In my opinion, it will be better this way.

    HTML Code:
    #include <sourcemod>
    
    public Plugin myinfo = 
    {
    	name = "PlayerJoin",
    	author = "WinCher",
    	description = "Player Join Message On Your Server",
    	version = "1.0",
    	url = "http://www.sourcemod.net/"
    };
    
    public void OnClientPostAdminCheck(int client)
    {
    	if (!IsFakeClient(client))
    	{
    		char Name[64];
    		GetClientName(client, Name, sizeof(Name));
    		PrintHintTextToAll("Player %s Connected to server", Name);
    	}
    }
    
    public void OnClientDisconnect(int client)
    {
    	if (!IsFakeClient(client))
    	{
    		char Name[64];
    		GetClientName(client, Name, sizeof(Name));
    		PrintHintTextToAll("Player %s Disconnected the server", Name);
    	}
    }
    Thank u
    WinCher58 is offline
    Tank Rush
    Senior Member
    Join Date: May 2019
    Location: Argentina
    Old 02-13-2021 , 09:07   Re: [L4D2/ANY] Player Join Message
    Reply With Quote #4

    The version I am using works with multicolors.inc and allows me to use {red} and {blue} colors, but there is a problem, in versus mode when the survivors team become infected or vice versa the chat announcement is repeat again and with the bugeados colors. The chat ad should appear only once when the player connects to the server.

    PHP Code:
    #include <sourcemod>
    #include <multicolors>

    public Plugin:myinfo =
    {
        
    name "Player/Server Notification",
        
    author "Sky",
        
    description "prints vital join/team/leave information to server.",
        
    version "1.1",
        
    url "http://steamcommunity.com/groups/skyservers"
    };

    public 
    OnPluginStart()
    {
        
    HookEvent("player_team"JoinTeam);
    }
    // I can't believe I forgot this.
    // I am such a fucking idiot.
    // /Wrist

    public OnClientConnected(client)
    {
        if (
    IsFakeClient(client))
        {
            return;
        }
        
    CPrintToChatAll("{olive}%N {default}has connected to the server."client)
    }

    // Not Needed as Valve already automatically provides this functionality.
    /*
    public OnClientDisconnect(client)
    {
        if (IsFakeClient(client))
        {
            return;
        }
        PrintToChatAll("%N has left the game.", client)
    }
    */
    public JoinTeam(Handle:eventString:event_name[], bool:dontBroadcast)
    {
        new 
    playerClient GetClientOfUserId(GetEventInt(event"userid"));
        new 
    clientTeam GetEventInt(event"team");
        if (
    IsFakeClient(playerClient))
        {
            return;
        }

        switch (
    clientTeam)
        {
            case 
    1:
            {
                
    CPrintToChatAll("{olive}%N {default}has joined the Spectators."playerClient)
            }
            case 
    2:
            {
                
    CPrintToChatAll("{olive}%N {default}has joined the {blue}Survivors."playerClient)
            }
            case 
    3:
            {
                
    CPrintToChatAll("{olive}%N {default}has joined the {red}Infected."playerClient)
            }
        }

    Tank Rush has connected to the server.
    Tank Rush has joined the Survivors.
    Tank Rush has joined the Infected.

    Can anybody help me?
    Attached Images
    File Type: jpg chat colors.jpg (18.9 KB, 606 views)
    Attached Files
    File Type: sp Get Plugin or Get Source (playerinfo.sp - 347 views - 1.4 KB)
    File Type: inc multicolors.inc (11.0 KB, 276 views)
    __________________
    Sorry i don't speak english very well

    --->My name is Source and I'm on Steam<---
    Discord: Source#9382
    Tank Rush is offline
    jeremyvillanueva
    AlliedModders Donor
    Join Date: Jan 2021
    Location: dcord:Jeremy333#7632
    Old 02-24-2021 , 20:01   Re: [L4D2/ANY] Player Join Message
    Reply With Quote #5

    Hi, maybe I can help you out,
    I'm working in colors also,
    Ill add you on steam
    jeremyvillanueva is offline
    caphao1101
    Member
    Join Date: Aug 2023
    Old 10-29-2023 , 11:00   Re: [L4D2/ANY] Player Join Message
    Reply With Quote #6

    Quote:
    Originally Posted by WinCher58 View Post
    Thank u
    Can you switch from text to notification when someone connects, thank you
    caphao1101 is offline
    king kong
    Member
    Join Date: Oct 2021
    Old 10-29-2023 , 12:45   Re: [L4D2/ANY] Player Join Message
    Reply With Quote #7

    Quote:
    Originally Posted by caphao1101 View Post
    Can you switch from text to notification when someone connects, thank you

    This https://forums.alliedmods.net/showpo...55&postcount=4
    king kong 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 19:23.


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