AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Host_Error: WriteDest_Parm: not a client (https://forums.alliedmods.net/showthread.php?t=207503)

Erdener 02-03-2013 10:06

[HELP] Host_Error: WriteDest_Parm: not a client
 
PHP Code:

client_printc(index, const text[], any:...)
{
    new 
szMsg[128];
    
vformat(szMsgsizeof(szMsg) - 1text3);

    
replace_all(szMsgsizeof(szMsg) - 1"!g""^x04");
    
replace_all(szMsgsizeof(szMsg) - 1"!n""^x01");
    
replace_all(szMsgsizeof(szMsg) - 1"!t""^x03");

    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _index);
    
write_byte(index);
    
write_string(szMsg);
    
message_end();



players connected to the server is giving this error after a few seconds.

EDIT:
Error in this code

dias 02-16-2013 04:23

Re: [HELP] Host_Error: WriteDest_Parm: not a client
 
replace
PHP Code:

client_printc(index, const text[], any:...)
{
    new 
szMsg[128];
    
vformat(szMsgsizeof(szMsg) - 1text3);

    
replace_all(szMsgsizeof(szMsg) - 1"!g""^x04");
    
replace_all(szMsgsizeof(szMsg) - 1"!n""^x01");
    
replace_all(szMsgsizeof(szMsg) - 1"!t""^x03");

    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _index);
    
write_byte(index);
    
write_string(szMsg);
    
message_end();


to
PHP Code:

// Colour Chat
stock client_printc(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^x04"); // Green Color
    
replace_all(msg190"!n""^x01"); // Default Color
    
replace_all(msg190"!t""^x03"); // Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }



Erdener 02-16-2013 05:10

Re: [HELP] Host_Error: WriteDest_Parm: not a client
 
Ok, thnx dias


All times are GMT -4. The time now is 20:37.

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