AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   host_error: WriteDest_parm: not a client (https://forums.alliedmods.net/showthread.php?t=65091)

taheri6 12-31-2007 16:10

host_error: WriteDest_parm: not a client
 
Hi all,

Ive seen a couple posts about this, from what I understand this occurs when a message is sent to "a person" who is not a client (like a bot?) or when a message is sent with out an ID.

Are these teh only times this message will occur?

Will doing a is_user_connecte(id) check before sending all messages be a good way to work arround this?

Does this only apply to hud messages (set_hudmessage/show_hudmessage) or does it also apply to client messages (client_print) ?

kp_uparrow 01-01-2008 02:27

Re: host_error: WriteDest_parm: not a client
 
check is_user_connected(id) first, i think it applies to all messages

Drak 01-01-2008 02:32

Re: host_error: WriteDest_parm: not a client
 
'client_print()' is a message, and the server won't crash if sent to a un-connected client. Same with a hud message. Tho.. I thought that if a message is sent reliably it will crash. Using "MSG_BROADCAST" and "MSG_ONE_UNRELIABLE" shouldn't crash a server.

kp_uparrow 01-01-2008 15:47

Re: host_error: WriteDest_parm: not a client
 
but isnt client_print(id......... a client and is sent reliably?

Drak 01-01-2008 23:54

Re: host_error: WriteDest_parm: not a client
 
Quote:

Originally Posted by kp_uparrow (Post 568937)
but isnt client_print(id......... a client and is sent reliably?

I didn't think so, but I checked the SDK. And I guess it is, though. It checks if the player is in-game before it sends the message. So, that's why it didn't crash. But as for the error he's getting. I was looking thought the HL-SDK. And the error is thrown when it's sent to an entity. Not a non-connected player.
I'm not so sure "is_user_connected()" would work, but using fakemeta, and:
Code:
if(pev(id,pev_flags) & FL_CLIENT)
would work.

kp_uparrow 01-02-2008 00:17

Re: host_error: WriteDest_parm: not a client
 
i think is_user_connected(id) will work

taheri6 01-02-2008 15:05

Re: host_error: WriteDest_parm: not a client
 
what about something simple like this:

Code:

public Is_Valid_User( id )
{
    if( is_user_connected( id ) && ( pev( id, pev_flags ) & FL_CLIENT ) )
        return true;

    return false;
}

And then just call that each time instead?

taheri6 01-06-2008 07:00

Re: host_error: WriteDest_parm: not a client
 
ok, so I did this:

PHP Code:

public Util_Should_Message_Clientid )
{
    if( 
id == || id MAX_PLAYERS )
    {
        return 
false;
    }

    if( 
is_user_connectedid ) && !is_user_botid ) && is_user_alive(id) )
    {
        return 
true;
    }

    return 
false;


I have that set for anytime a client_print, hudmessage, or sound emit occurs

so
PHP Code:

if( Util_Should_Message_Clientid ) )
{
    
//Action


And I am still getting this occuring. Does this need to be set arround message_begin, ( anything in between like write_byte, write_short) , message_end, etc also?

Drak 01-06-2008 14:04

Re: host_error: WriteDest_parm: not a client
 
Quote:

Originally Posted by taheri6 (Post 570882)
ok, so I did this:

PHP Code:

public Util_Should_Message_Clientid )
{
    if( 
id == || id MAX_PLAYERS )
    {
        return 
false;
    }

    if( 
is_user_connectedid ) && !is_user_botid ) && is_user_alive(id) )
    {
        return 
true;
    }

    return 
false;


I have that set for anytime a client_print, hudmessage, or sound emit occurs

so
PHP Code:

if( Util_Should_Message_Clientid ) )
{
    
//Action


And I am still getting this occuring. Does this need to be set arround message_begin, ( anything in between like write_byte, write_short) , message_end, etc also?

No, but if possible. Do you know the code that's causing it? If you do, post it.

taheri6 01-06-2008 16:33

Re: host_error: WriteDest_parm: not a client
 
What types of messages do I need to do that with?

PHP Code:

#define MSG_BROADCAST        0    // unreliable to all
#define MSG_ONE            1    // reliable to one (msg_entity)
#define MSG_ALL            2    // reliable to all
#define MSG_INIT                     3    // write to the init string
#define MSG_PVS            4    // Ents in PVS of org
#define MSG_PAS            5    // Ents in PAS of org
#define MSG_PVS_R        6    // Reliable to PVS
#define MSG_PAS_R        7    // Reliable to PAS
#define MSG_ONE_UNRELIABLE    8    // Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)
#define MSG_SPEC        9    // Sends to all spectator proxies 

Would it only be needed arround MSG_ONE type messages?


All times are GMT -4. The time now is 11:01.

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