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

Player disconnected - HUD message for Admins only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
StDenisGamers
Junior Member
Join Date: Dec 2021
Location: USA
Old 04-03-2022 , 19:39   Player disconnected - HUD message for Admins only
Reply With Quote #1

Hello.

I am looking for just a plugin that lets Admins only know via a HUD message when a player disconnects from the server. I know i can see it in the config but during gameplay its often nice not to constantly press the tab(scoreboard).

thanks in advance!
__________________
StDenisGamers is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-03-2022 , 21:37   Re: Player disconnected - HUD message for Admins only
Reply With Quote #2

Quote:
Originally Posted by StDenisGamers View Post
Hello.

I am looking for just a plugin that lets Admins only know via a HUD message when a player disconnects from the server. I know i can see it in the config but during gameplay its often nice not to constantly press the tab(scoreboard).

thanks in advance!
I'm not sure if it is possible to create a loop inside the 'client disconnected' function but try this and if it doesn't work I will use another method

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}

public 
client_disconnectid )
{
    new 
iPlayer32 ], szName32 ], iNum;
    
get_playersiPlayeriNum"ch" )
    
get_user_nameidszNamecharsmaxszName ) )
    
    for( new 
iiAdminiNumi++ )
    {
        if( 
is_user_admin( ( iAdmin iPlayer] ) ) )
        {
            
set_hudmessage02550, -1.0, -1.0 )
            
show_hudmessageiAdmin"Player %s has disconnected"szName )
        }
    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-03-2022 at 23:08.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-03-2022 , 22:03   Re: Player disconnected - HUD message for Admins only
Reply With Quote #3

In what particular reason you're using the loop?

You simply don't need to loop the players just check whether the id ( 1st parameter in client_disconnect ) is an admin.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-03-2022 , 22:48   Re: Player disconnected - HUD message for Admins only
Reply With Quote #4

Quote:
Originally Posted by Natsheh View Post
In what particular reason you're using the loop?

You simply don't need to loop the players just check whether the id ( 1st parameter in client_disconnect ) is an admin.
Quote:
Admins only know via a HUD message when a player disconnects
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-03-2022 , 23:07   Re: Player disconnected - HUD message for Admins only
Reply With Quote #5

Alright then add the flags "ch" to exclude bots and HLTV clients to get_players.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-03-2022 at 23:14.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-03-2022 , 23:11   Re: Player disconnected - HUD message for Admins only
Reply With Quote #6

Quote:
Originally Posted by Natsheh View Post
Alright then add the flags "ch" to disclude bots and HLTV clients to get_players
I guess it doesn't matter who gives the admin access to the bot or hltv and if so it's just a message anyway I've added
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-03-2022 at 23:12.
Supremache is offline
StDenisGamers
Junior Member
Join Date: Dec 2021
Location: USA
Old 04-11-2022 , 11:30   Re: Player disconnected - HUD message for Admins only
Reply With Quote #7

I tried it and sadly it didnt work.

Thanks again.
__________________
StDenisGamers is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-12-2022 , 10:45   Re: Player disconnected - HUD message for Admins only
Reply With Quote #8

I thought it, It's not possible to create a loop inside 'client disconnected' function, Try this:
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_szName32 ];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task1.0"OnTaskDisconnected", .flags "b" )
}

public 
client_disconnectid )
{    
    
get_user_nameidg_szNamecharsmaxg_szName ) );


public 
OnTaskDisconnected( )
{
    if( 
g_szName] != EOS )
    {
        new 
iPlayer32 ], iNum;
        
get_playersiPlayeriNum"ch" )
    
        for( new 
iiAdminiNumi++ )
        {
            if( 
is_user_admin( ( iAdmin iPlayer] ) ) )
            {
                
set_hudmessage02550, -1.0, -1.0 )
                
show_hudmessageiAdmin"Player %s has disconnected"g_szName )
            }
        }
        
g_szName] = EOS
    
}

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-15-2022 at 00:05.
Supremache is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-12-2022 , 13:08   Re: Player disconnected - HUD message for Admins only
Reply With Quote #9

I don't think you need a fixed task for that.

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_szName32 ]

public 
plugin_init()
{
        
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_disconnectid )
{
        
get_user_nameidg_szNamecharsmaxg_szName ) )
        
set_task(1.0"OnTaskDisconnected")
}

public 
OnTaskDisconnected()
{
        new 
iPlayer32 ], iNum;
        
get_playersiPlayeriNum"ch" )

        for( new 
iiAdminiNumi++ )
        {
                if( 
is_user_admin( ( iAdmin iPlayer] ) ) )
                {
                        
set_hudmessage02550, -1.0, -1.0 )
                        
show_hudmessageiAdmin"Player %s has disconnected"g_szName )
                }
        }

        
g_szName[0] = EOS

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
StDenisGamers
Junior Member
Join Date: Dec 2021
Location: USA
Old 04-12-2022 , 21:12   Re: Player disconnected - HUD message for Admins only
Reply With Quote #10

Quote:
Originally Posted by Supremache View Post
I thought it, It's not possible to create a loop inside 'client disconnected' function, Try this:
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_szName32 ];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task1.0"OnTaskDisconnected", .flags "b" )
}

public 
client_disconnectid )
{    
    
get_user_nameidg_szNamecharsmaxg_szName ) );


public 
OnTaskDisconnected( )
{
    if( 
g_szName] != EOS )
    {
        new 
iPlayer32 ], iNum;
        
get_playersiPlayeriNum"ch" )
    
        for( new 
iiAdminiNumi++ )
        {
            if( 
is_user_admin( ( iAdmin iPlayer] ) ) )
            {
                
set_hudmessage02550, -1.0, -1.0 )
                
show_hudmessageiAdmin"Player %s has disconnected"g_szName )
            }
        }
    }


it works!

the HUD message is in the middle and in a green to quickly spot.




Approve this plugin!!!!


--many thanks to Supremache and Koz for the assistance!
Attached Files
File Type: amxx announce.amxx (1,002 Bytes, 23 views)
__________________

Last edited by StDenisGamers; 04-12-2022 at 21:13.
StDenisGamers 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 16:45.


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