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

return in client_connect() and FM_ClientConnect = nothing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-06-2010 , 14:52   return in client_connect() and FM_ClientConnect = nothing
Reply With Quote #1

i think i saw that returning PLUGIN_HANDLED in client_connect will stop the connect forward for next plugins and mb not set player ingame for amxx (dunno, or does it even does anything?)

so i checked it and it doesn't do anything =\

1st plugin
PHP Code:
public client_connect(client)
{
     
log_amx"client not came!" );    
    return 
PLUGIN_HANDLED;

2nd plugin
PHP Code:
public client_connect(client)
{
    
log_amx"client came!" );

and so i log into my server normally and see
Code:
client not came!
client came!
in server console =\

so is there any reason to return anything like PLUGIN_CONTINUE or PLUGIN_HANDLED in client_connect() ?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 01-06-2010 at 14:55.
Owyn is offline
Send a message via ICQ to Owyn
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-06-2010 , 15:14   Re: return in client_connect()
Reply With Quote #2

client_connect() is a post forward. Returning something will do nothing.

If you want to block a player, try to hook FM_ClientConnect as pre.

Code:
register_forward( FM_ClientConnect, "Client_Connect" ); public Client_Connect ( const client, const name[], const address[], const rejectReason[ 128 ] ) {     return FMRES_SUPERCEDE; }
__________________

Last edited by Arkshine; 01-06-2010 at 15:23.
Arkshine is offline
.OM NOM NOM NOM
BANNED
Join Date: Dec 2009
Old 01-06-2010 , 15:42   Re: return in client_connect()
Reply With Quote #3

@ Owyn

I like your signature.
.OM NOM NOM NOM is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-06-2010 , 15:57   Re: return in client_connect()
Reply With Quote #4

lol =\ no work

PHP Code:
    register_forwardFM_ClientConnect"Client_Connect" );
}

public 
Client_Connect ( const client, const name[], const address[], const rejectReason128 ] )
{
    static 
authid[35];
    
get_user_authid(clientauthidsizeof(authid) - 1);
    
    
log_amx"id %d ,ip %s, id %s, name %s, reason: %s"client,address,authid,name,rejectReason );
    return 
FMRES_SUPERCEDE;

=
L 01/06/2010 - 23:55:14: [ret.amxx] id 1 ,ip 93.100.**.***:27005, id STEAM_0:1:20******, name ***, reason: Connection rejected by game

L 01/06/2010 - 23:55:14: [plugin2.amxx] client came!

so client came and played normally)
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 01-06-2010 , 16:26   Re: return in client_connect() and FM_ClientConnect
Reply With Quote #5

Try using SVC_DISCONNECT message in the forward.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-06-2010 , 16:31   Re: return in client_connect() and FM_ClientConnect
Reply With Quote #6

i can use SVC_DISCONNECT anywhere else anytime, it's not about it =\
plus msg takes time so it is still "plugin2: client came!"
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-06-2010 , 17:13   Re: return in client_connect() and FM_ClientConnect
Reply With Quote #7

Is ret.amxx before plugin2.amxx in plugins.ini ?
__________________
xPaw is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 01-06-2010 , 17:14   Re: return in client_connect() and FM_ClientConnect
Reply With Quote #8

yes, plus plugin2 is a post forward connect
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 01-06-2010 at 17:22.
Owyn is offline
Send a message via ICQ to Owyn
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 01-06-2010 , 18:22   Re: return in client_connect() and FM_ClientConnect = nothing
Reply With Quote #9

What you want to return/do ?
Mxnn is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 01-06-2010 , 19:09   Re: return in client_connect() and FM_ClientConnect = nothing
Reply With Quote #10

I test with modules. You need to return false in Pre Client Connect to prevent Calling Post!!
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
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 05:29.


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