Raised This Month: $ Target: $400
 0% 

help flags


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Foxa
Member
Join Date: Nov 2018
Location: Croatia
Old 07-25-2020 , 05:03   Re: help flags
Reply With Quote #13

If you don't know anything and you're not willing to learn, don't post here, go to the requests subforum and post there

PHP Code:
#include <amxmodx>

#define PLUGIN "ConnectDisconnect Message"
#define VERSION "1.0"
#define AUTHOR "AlliedMods"

new const Flag[]="d";  //Change the flag to whatever you want

public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connect(id){
    new 
szName[32]
    new 
szID[32]
    new 
players[32], num;
    
get_user_authid(idszIDcharsmax(szID))
    
get_user_name(idszNamecharsmax(szName))
    
get_players(playersnum)
    for(new 
i=0i<numi++){
        if(
is_admin(players[i]))
            
client_print(players[i], print_chat"%s is connecting SteamID(%s)"szNameszID)
    }
}

public 
client_putinserver(id){
    new 
szName[32]
    new 
szID[32]
    new 
players[32], num
    get_user_authid
(idszIDcharsmax(szID))
    
get_user_name(idszNamecharsmax(szName))
    
get_players(playersnum)
    for(new 
i=0i<numi++){
        if(
is_admin(players[i]))
            
client_print(0print_chat"%s has connected SteamID(%s)"szNameszID)
    }
}  

public 
client_disconnected(id){
    new 
szName[32]
    new 
szID[32]
    new 
players[32], num
    get_user_authid
(idszIDcharsmax(szID))
    
get_user_name(idszNamecharsmax(szName))
    
get_players(playersnum)
    for(new 
i=0i<numi++){
        if(
is_admin(players[i]))
            
client_print(0print_chat"%s has disconnected SteamID(%s)"szNameszID)
    }
}

stock bool:is_admin(id){
    if((
get_user_flags(id) & read_flags(Flag)))
        return 
true
    
    
return false

Not tested but should work.

Last edited by Foxa; 07-25-2020 at 05:04.
Foxa 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 09:01.


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