View Single Post
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-29-2020 , 04:20   Re: show rank on connection
Reply With Quote #10

Quote:
Originally Posted by The RaiD. View Post
there is already a task of 0.5 but still the same problem
Try This:
PHP Code:
#include <amxmodx>
#include <csstats>


public plugin_init() 
{
    
register_plugin("InfoMessage""1.0""MrAbdoO");
}

public 
client_putinserver(iPlayer)
{
    
set_task(8.0"go_info"iPlayer""0""0);
}

public 
go_info(id)
{
    new 
stats], body], szName32 ], szAuth32 ];
    new 
rank_pos get_user_statsidstatsbody )
    new 
rank_max get_statsnum( )
    
get_user_nameidszName31 )
    
get_user_authid(id szAuth 31)
    
ChatColor(0"!tPlayer !t%s !g(%s) !nhas connected to server. Rank is !g%d!nfrom !g%d!n."szNameszAuthrank_posrank_max);
    return 
0;
}

// Colour Chat
stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^x04"); // Green Color
    
replace_all(msg190"!n""^x01"); // Default Color
    
replace_all(msg190"!t""^x03"); // Team Color
    
    
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 Supremache; 06-29-2020 at 04:20.
Supremache is offline