Raised This Month: $12 Target: $400
 3% 

The proper event to print information to client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2019 , 09:52   The proper event to print information to client
Reply With Quote #1

Hi, I've been searching a lot, and testing, but still had no positive results, what's the most reliable event to print information to client when he connects? I tried client_authorized, client_authorized with 0.3s delay, client_putinserver, client_putinserver with 3.0s delay, nothing works.
Thanks.
__________________

Last edited by edon1337; 08-17-2019 at 09:52.
edon1337 is offline
Old 08-17-2019, 09:57
LearninG
This message has been deleted by LearninG.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-17-2019 , 09:59   Re: The proper event to print information to client
Reply With Quote #2

Quote:
Originally Posted by LearninG View Post
client_connect , maybe ?
Not even close. How is he supposed to see the message while he is connecting?
__________________

Last edited by OciXCrom; 08-17-2019 at 10:00.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
thEsp
BANNED
Join Date: Aug 2017
Old 08-17-2019 , 10:04   Re: The proper event to print information to client
Reply With Quote #3

Quote:
Originally Posted by LearninG View Post
client_connect , maybe ?
Research, maybe?
https://forums.alliedmods.net/showpo...12&postcount=2
thEsp is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 08-17-2019 , 10:24   Re: The proper event to print information to client
Reply With Quote #4

So what is called when player is connecting, but downloading some resources? I also had problems to understand what is called when exactly..but almost every time putiserver + 3-4sec seems okay
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2019 , 10:25   Re: The proper event to print information to client
Reply With Quote #5

Quote:
Originally Posted by LearninG View Post
client_connect , maybe ?
That's the worst event to do things aside from changing var/bool values. In client_connect player hasn't even gotten a SteamID.
__________________

Last edited by edon1337; 08-17-2019 at 10:26.
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-17-2019 , 10:27   Re: The proper event to print information to client
Reply With Quote #6

1st attach your code
2th what are you trying to print which way?

I believe the best event is putinserver or hook player choose team command
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-17-2019 at 10:29.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2019 , 10:38   Re: The proper event to print information to client
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
1st attach your code
2th what are you trying to print which way?

I believe the best event is putinserver or hook player choose team command
1. What code? Hooking putinserver and printing "Hello"?
2. Anything, the way it's supposed to print?

Putinserver doesn't work, setting a 3.0s delay doesn't work either.
__________________
edon1337 is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-17-2019 , 10:43   Re: The proper event to print information to client
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
Not even close. How is he supposed to see the message while he is connecting?
I thought it was possible with set_task... my mistake.
LearninG is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-17-2019 , 11:59   Re: The proper event to print information to client
Reply With Quote #9

Quote:
Originally Posted by edon1337 View Post
1. What code? Hooking putinserver and printing "Hello"?
2. Anything, the way it's supposed to print?

Putinserver doesn't work, setting a 3.0s delay doesn't work either.
1. Always show what have you tried no matter how silly the code is.
2. Printing differs from one way to other for example printing in user chat or console or even server console.


Not sure what you mean with it not working that's why you always have to show the code.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2019 , 14:00   Re: The proper event to print information to client
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
1. Always show what have you tried no matter how silly the code is.
2. Printing differs from one way to other for example printing in user chat or console or even server console.


Not sure what you mean with it not working that's why you always have to show the code.
There, full code can be found here. Player gets kicked but the prints do go off.
PHP Code:
public client_authorizedid )
{
    
set_task0.3"client_authorized_delayed"id TASK_AUTHORIZED );
}

public 
client_authorized_delayedid )
{
    
id -= TASK_AUTHORIZED;

    
CheckBannedid );
}

public 
CheckBannedid )
{
    if( 
get_user_flagsid ) & g_iConfigIMMUNITY_FLAG ] )
    {
        return 
PLUGIN_HANDLED;
    }

    else
    {
        new 
eDataPlayerBan ], szSteamIdMAX_AUTHID_LENGTH ], szNameMAX_NAME_LENGTH ], szIPMAX_IP_LENGTH ];
        
get_user_authididszSteamIdcharsmaxszSteamId ) );
        
get_user_nameidszNamecharsmaxszName ) );
        
get_user_ipidszIPcharsmaxszIP ), );

        for( new 
iArraySizeg_aBans ); i++ )
        {
            
ArrayGetArrayg_aBansieData );
            
            if( 
equaliszSteamIdeDataPlayer_SteamId ] ) || equaliszNameeDataPlayer_Name ] ) || equaliszIPeDataPlayer_IP ] ) )
            {
                if( ! 
HasDatePassedeDataPlayer_BanExpire ] ) || equalieDataPlayer_BanExpire ], "never" ) )
                {
                    if( 
equalieDataPlayer_BanExpire ], "never" ) )
                    {                
                        
                        
send_messageidCONSOLEfalse"************************************************" );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_BANNED" );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_EXPIRE_NEVER" );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_REASON"eDataPlayer_BanReason ] );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_BY"eDataPlayer_BannedBy ] );
                        
send_messageidCONSOLEfalse"************************************************" );
                    }
                    
                    else
                    {
                        
send_messageidCONSOLEfalse"************************************************" );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_BANNED" );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_EXPIRE"eDataPlayer_BanExpire ] );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_REASON"eDataPlayer_BanReason ] );
                        
send_messageidCONSOLEfalse"%L"id"BAN_INFO_BY"eDataPlayer_BannedBy ] );
                        
send_messageidCONSOLEfalse"************************************************" );
                    }
                    
server_cmd"kick #%d %L"get_user_useridid ), id"CHECK_CONSOLE_INFO" );
                    break;
                }
            }
        }
    }
    return 
PLUGIN_CONTINUE;

__________________

Last edited by edon1337; 08-17-2019 at 14:01.
edon1337 is offline
Old 08-17-2019, 14:05
fysiks
This message has been deleted by fysiks. Reason: a post occured between when I started typing and I hit submit.
Reply


Thread Tools
Display Modes

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 04:24.


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