View Single Post
Teyut
Junior Member
Join Date: Nov 2006
Location: Somewhere between Mars and Venus
Old 02-28-2009 , 23:40   Re: Multilines kick reason
Reply With Quote #9

Quote:
Originally Posted by evilworm View Post
Quote:
FATAL ERROR (shutting down): MSG_ONE or MSG_ONE_UNRELIABLE with no target entity
[...]
So the question is - how can I know if I can send message to the player with message_begin() if the player shows up as not connected?
From what I understand reading the AMXX/HLSDK source code, such crashes happen when the last parameter (player entity) of the MESSAGE_BEGIN macro is NULL. The AMXX core doesn't check for such a case before calling that macro (the result of INDEXENT should be checked before use in unicast messages)

I've fixed that bug in the kick_ML() method (see above) calling the is_valid_ent() method (engine module) before doing anything. If the kick can't work, the method will return 0. Note however that is_valid_ent() does almost the same things as is_user_connected(), so it may not really help you, but at least, it should fix that server crash (I haven't test the code actually).

If you really want to kick players that are connecting but are not yet connected, you'll need to find a way to retrieve the result of the HL engine method pfnPEntityOfEntIndex: if it's non-zero, then you may kick the player. But I haven't find an AMXX module which provides a direct access to that method.

Quote:
Originally Posted by VEN View Post
Correction: it's SVC_DISCONNECT, not SVC_KICK.
Fixed, thanks. I didn't know where to find the correct names.

Quote:
Originally Posted by Brad View Post
My testing indicates that you can not use color in the message.
Sorry about my lack of answer You were right: it's not possible (I guess it is with Source).

Last edited by Teyut; 03-01-2009 at 00:11.
Teyut is offline