Raised This Month: $32 Target: $400
 8% 

show rank on connection 2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The RaiD.
Member
Join Date: Jul 2019
Old 07-06-2020 , 07:05   show rank on connection 2
Reply With Quote #1

is there any chance to not show banned players if they try to connect??
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[ 8 ], body[ 8 ], szName[ 32 ], szAuth[ 32 ];
    new rank_pos = get_user_stats( id, stats, body )
    new rank_max = get_statsnum( )
    get_user_name( id, szName, 31 )
    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.", szName, szAuth, rank_pos, rank_max);
    return 0;
}

// Colour Chat
stock ChatColor(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if (id) players[0] = id; else get_players(players, count, "ch");
    
    for (new i = 0; i < count; i++)
    {
        if (is_user_connected(players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
            write_byte(players[i]);
            write_string(msg);
            message_end();
        }
    }
}
The RaiD. is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 07-06-2020 , 07:21   Re: show rank on connection 2
Reply With Quote #2

How can banned players connect ?
ZaX is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 07-06-2020 , 07:25   Re: show rank on connection 2
Reply With Quote #3

you must edit your ban plugin...its happening in client_authorized( id ), so from it print messages to all players or make a native from it, how you want
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-06-2020 , 07:55   Re: show rank on connection 2
Reply With Quote #4

Quote:
Originally Posted by JocAnis View Post
you must edit your ban plugin...its happening in client_authorized( id ), so from it print messages to all players or make a native from it, how you want
No

Quote:
Originally Posted by The RaiD. View Post
is there any chance to not show banned players if they try to connect??
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[ 8 ], body[ 8 ], szName[ 32 ], szAuth[ 32 ];
    new rank_pos = get_user_stats( id, stats, body )
    new rank_max = get_statsnum( )
    get_user_name( id, szName, 31 )
    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.", szName, szAuth, rank_pos, rank_max);
    return 0;
}

// Colour Chat
stock ChatColor(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if (id) players[0] = id; else get_players(players, count, "ch");
    
    for (new i = 0; i < count; i++)
    {
        if (is_user_connected(players[i]))
        {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
            write_byte(players[i]);
            write_string(msg);
            message_end();
        }
    }
}
Code:
client_putinserver(iPlayer)

To --->

Code:
client_connect(iPlayer)
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-06-2020 , 08:41   Re: show rank on connection 2
Reply With Quote #5

@alferd - how is using a forward that's called even earlier going to prevent banned players from showing?! Just stop.

Simply check if the user is connected before displaying the message. 8 seconds after connection is more than enough for the player to get kicked if he is in the banlist.

Code:
public go_info(id) {

=>

Code:
public go_info(id) {     if(!is_user_connected(id))     {         return 0     }
__________________

Last edited by OciXCrom; 07-06-2020 at 08:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
The RaiD.
Member
Join Date: Jul 2019
Old 07-06-2020 , 09:38   Re: show rank on connection 2
Reply With Quote #6

thanks to all and thanks ocixcrom works
The RaiD. 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 17:17.


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