Isn't 128 the maximum length for sent client messages?
#1



The code:

pawn Code:
public OnPlayerText ( playerid, text[] )
{
    new
            Float:      charPos [ 3 ],
                        chatStr [ 128 ],

                        plUserName [ MAX_PLAYER_NAME ];
                       
    GetPlayerPos ( playerid, charPos [ 0 ], charPos [ 1 ], charPos [ 2 ] );
    GetPlayerName ( playerid, plUserName, MAX_PLAYER_NAME );
           
    for( new user; user < MAX_PLAYERS; user ++ )
    {
        if( IsPlayerInRangeOfPoint ( user, 20.0, charPos [ 0 ], charPos [ 1 ], charPos [ 2 ] ) )
        {
            if( GetPlayerVirtualWorld ( user ) == GetPlayerVirtualWorld ( playerid ) )
            {
                format ( chatStr, 128, ""#INT_CHARACTERNAME"%s "#INT_GREY"says: "#INT_WHITE"%s", plUserName, text );
                SendClientMessage ( user, -1, chatStr );
               
                format ( chatStr, 128, ""#INT_GREY"DEBUG: "#INT_WHITE"Character Count: "#INT_CHARACTERNAME"%d", 61 + strlen ( text ) );
                SendClientMessage ( playerid, -1, chatStr );
                return false;
            }
        }
    }
    return 1;
}
61 is the length of the integrated colors and "says:"
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)