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

Multilines kick reason


Post New Thread Reply   
 
Thread Tools Display Modes
evilworm
Junior Member
Join Date: Apr 2008
Old 03-01-2009 , 06:18   Re: Multilines kick reason
Reply With Quote #11

Player entity parameter is not NULL, I checked that with debug output to log, but I'm not sure abut INDEXENT output. The is_valid_ent() will not work, because it first checks if player is ingame and then checks INDEXENT. By the way, as I said, I'm doing the kick from the client_authorized() function, which sometimes fails. I guess it's too early to call message_begin() here. However client_putinserver() is not guaranteed to happen before client_authorized(), so I cannot call that one either. Just had a thought that I sould check which one of the functions is called last and execute kick from there (some kinda emulation of OnClientPreAdminCheck function from SourceMod).

Last edited by evilworm; 03-01-2009 at 06:35.
evilworm is offline
Teyut
Junior Member
Join Date: Nov 2006
Location: Somewhere between Mars a
Old 03-01-2009 , 15:36   Re: Multilines kick reason
Reply With Quote #12

Quote:
Originally Posted by evilworm View Post
Player entity parameter is not NULL, I checked that with debug output to log, but I'm not sure abut INDEXENT output.
The player entity is the result of INDEXENT (it's a pointer). The only reason why the MESSAGE_BEGIN macro (the HLSDK macro) throws that fatal error is when the player entity parameter is NULL with unicast messages.

Quote:
Originally Posted by evilworm View Post
Just had a thought that I sould check which one of the functions is called last and execute kick from there (some kinda emulation of OnClientPreAdminCheck function from SourceMod).
Don't forget to also implement the client_disconnect forward to handle clients that disconnect between the two events.

Quote:
Originally Posted by ConnorMcLeod View Post
Quote:
Originally Posted by Teyut View Post
Fixed, thanks. I didn't know where to find the correct names.
Quote:
Originally Posted by message_const.inc
/* Hardcoded message types for message_begin()
* Look in the actual HLSDK for details!
*/
Thanks, but as the preterit tense should have implied: I've already found them .
Teyut is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-01-2009 , 10:48   Re: Multilines kick reason
Reply With Quote #13

so not to get error with MSG_ONE you only need to check
PHP Code:
if (FNullEnt(INDEXENT(iEnt))) 
?

that would be easy, make a new native in engine to check only this and use it, woudn't it?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 11-01-2009 , 10:51   Re: Multilines kick reason
Reply With Quote #14

This is awesome. I wonder which is better: SVC_KICK or SVC_DISCONNECT?
__________________
hleV is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-01-2009 , 10:57   Re: Multilines kick reason
Reply With Quote #15

SVC_KICK doesn't exist, it's only SVC_DISCONNECT.
__________________
Arkshine is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-01-2009 , 11:12   Re: Multilines kick reason
Reply With Quote #16

sure it is) but it has problems if you wanna use it before client_putinserver()

just edit engine module and add a new native to check only INDEXENT or add a check
PHP Code:
if (FNullEnt(INDEXENT(iEnt))) 
into
PHP Code:
static cell AMX_NATIVE_CALL message_begin(AMX *amxcell *params/* 4 param */ 
why nobody did this before?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 11-01-2009 at 12:09.
Owyn is offline
Send a message via ICQ to Owyn
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-01-2009 , 12:36   Re: Multilines kick reason
Reply With Quote #17

Quote:
Originally Posted by Owyn View Post
sure it is) but it has problems if you wanna use it before client_putinserver()?
Quote:
Originally Posted by Arkshine View Post
SVC_KICK doesn't exist, it's only SVC_DISCONNECT.
__________________
xPaw is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-01-2009 , 12:38   Re: Multilines kick reason
Reply With Quote #18

Quote:
Originally Posted by Owyn View Post
sure it is) but it has problems if you wanna use it before client_putinserver()

just edit engine module and add a new native to check only INDEXENT or add a check
PHP Code:
if (FNullEnt(INDEXENT(iEnt))) 
into
PHP Code:
static cell AMX_NATIVE_CALL message_begin(AMX *amxcell *params/* 4 param */ 
why nobody did this before?
Check yourself you pass a valid player index.
__________________
Arkshine is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 11-01-2009 , 13:01   Re: Multilines kick reason
Reply With Quote #19

Quote:
Check yourself
that's what i did, now i have no problems, just shared a solution =) *it may looks like u haven't read whole thread, there is no way to check it before client_putinserver() *just noticing**


2xPaw,

Quote:
Originally Posted by hleV
This is awesome
Quote:
Originally Posted by Owyn
sure it is)
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 11-01-2009 at 13:04.
Owyn is offline
Send a message via ICQ to Owyn
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-01-2009 , 14:30   Re: Multilines kick reason
Reply With Quote #20

I suppose is_valid_ent returns true even when players are not connected.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 20:49.


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