View Single Post
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-23-2016 , 14:56   Re: [REQ] Small Help
Reply With Quote #5

untested
PHP Code:
#include <amxmodx>

public plugin_init()
{
   
register_plugin("Join","1.0","Relaxing")
}

public 
client_putinserver(id)
{
    new 
name[32]
    
get_user_name(idnamecharsmax(name))
    if( 
get_user_flags(id) & ADMIN_RESERVATION ) {    
        
client_print_color(id"!t[PREFIX] OWNER !g%s !tjoined",  name)
    }
    else 
    {
        
client_print_color(id"!t[PREFIX] PLAYER !g%s !tjoined",  name)
    }
   
   return 
PLUGIN_HANDLED
}

public 
client_disconnect(id)
{
    new 
name[32]
    
get_user_name(idnamecharsmax(name))
    if( 
get_user_flags(id) & ADMIN_RESERVATION ) {    
        
client_print_color(id"!t[PREFIX] OWNER !g%s !tjoined",  name)
    }
    else 
    {
        
client_print_color(id"!t[PREFIX] PLAYER !g%s !tjoined",  name)
    }
    return 
PLUGIN_HANDLED   
}
stock client_print_color(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
    
    
replace_all(msg190"!n""^x01");
    
replace_all(msg190"!g""^x04");     
    
replace_all(msg190"!t""^x03");
    
    if (
idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++) 
        { 
            if (
is_user_connected(players[i])) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

__________________

Last edited by Relaxing; 12-23-2016 at 14:57. Reason: no reason for other includes
Relaxing is offline