Raised This Month: $51 Target: $400
 12% 

Player Join and Leave Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Merrill
Member
Join Date: Jun 2006
Location: Houston
Old 04-11-2020 , 11:38   Player Join and Leave Messages
Reply With Quote #1

Hello

I want to make a request for a plugin that blocks the player join, leave and switch team messages for dods. I would also like to ask if it can block these messages for bots.

I searched these forums and did find two, however they didn't work.

Thank you

Merrill
Merrill is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-11-2020 , 15:37   Re: Player Join and Leave Messages
Reply With Quote #2

Day of Defeat Source

Try it.
Should disable messages made by bots.
PHP Code:
public void OnPluginStart()
{

    
HookEventEx("player_connect_client",     eventsEventHookMode_Pre);
    
HookEventEx("player_disconnect",         eventsEventHookMode_Pre);
    
HookEventEx("player_team",                 eventsEventHookMode_Pre);
}


public 
Action events(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));

    if(
client == 0)
    {
        
int bot event.GetInt("bot", -1);
        
        if(!
bot)
        {
            return 
Plugin_Continue;
        }
        
        return 
Plugin_Handled;
    }


    if(
IsClientInGame(client) && IsFakeClient(client))
    {
        return 
Plugin_Handled;
    }


    return 
Plugin_Continue;

__________________
Do not Private Message @me
Bacardi is offline
Merrill
Member
Join Date: Jun 2006
Location: Houston
Old 04-14-2020 , 23:17   Re: Player Join and Leave Messages
Reply With Quote #3

I get the following compile error

plugin.sp(30) : error 030: compound statement not closed at the end of file (started at line 12)

plugin.sp(30) : warning 209: function "events" should return a value
Merrill is offline
Merrill
Member
Join Date: Jun 2006
Location: Houston
Old 04-14-2020 , 23:19   Re: Player Join and Leave Messages
Reply With Quote #4

My bad I didn't copy properly. Plugin compiled fine.
Merrill 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 04:08.


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