Raised This Month: $ Target: $400
 0% 

Player disconnected - HUD message for Admins only


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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 #9

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, 30 views)
__________________

Last edited by StDenisGamers; 04-12-2022 at 21:13.
StDenisGamers is offline
 



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 10:33.


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