View Single Post
Old 29/11/2012, 12:39 PM   #4
GiamPy.
Huge Clucker
 
GiamPy.'s Avatar
 
Join Date: Apr 2011
Location: Ravenna, Italy
Posts: 221
Reputation: 16
Default Re: Making the chat and the message split?

pawn Code:
stock SendPlayerExtendedMessage(playerid, color, const string[])
{
    new firstString[128],
        secondString[128],
        finalStringLINE1[128],
        finalStringLINE2[128];
       
    if(strlen(string) > 70) // here you can choose the lenght of the first string
    {
        format(firstString, sizeof(firstString), string);
        format(secondString, sizeof(secondString), string);
       
        strdel(firstString, 70, 140);
        strdel(secondString, 0, 70);
       
        format(finalStringLINE1, sizeof(finalStringLINE1), "%s ...", firstString);
        SendClientMessage(playerid, color, finalStringLINE1);
        format(finalStringLINE2, sizeof(finalStringLINE2), "... %s", secondString);
        SendClientMessage(playerid, color, finalStringLINE2);
        return true;
    }
    else
    {
        SendClientMessage(playerid, color, string);
        return true;
    }
}
GiamPy. is offline   Reply With Quote