Long Chat
#5

Quote:
Originally Posted by StR_MaRy
Посмотреть сообщение
yes , thx but a question where should i put this ?
Anywhere as long as it isn't in a callback.

A little info about the params:
playerid - used to send the message to a player. It's there because this function was originally used in a loop.
senderid - should be "playerid" in most cases. This is used to send a warning message to the sender in case their input exceeded the limit of 144.
color - self explanatory
text - string you want to submit
type - 1 = sendclientmessage, 2 = sendclientmessagetoall.

Essentially, you should just do this:
pawn Код:
public OnPlayerText(playerid, text[]) {

    ReturnSplittedMessage(playerid, playerid, 0xffffffff, "Text", 2);

    return 0;
}
EDIT: If you want to have a local chat, add this function as well (again, anywhere outside any brackets) and use it instead of ReturnSplittedMessage.


pawn Код:
SendLocalMessage(playerid, color, text[], Float: range)
{
    new Float: psX, Float: psY, Float: psZ;
    GetPlayerPos(playerid, psX, psY, psZ);

    foreach(new i: Player)
    {
        if(IsPlayerInRangeOfPoint(i, range, psX, psY, psZ))
        {
            ReturnSplittedMessage(i, playerid, color, text, 1);
        }
    }

    return true;
}
Using this, you only need to do this instead of SendClientMessage:

pawn Код:
//                        senderid,  colorid,   text,   range
SendLocalMessage(playerid, 0xffffffff, text[], Float: range)
It will only send messages to people that are in range of the provided range
Reply


Messages In This Thread
Long Chat - by StR_MaRy - 19.05.2015, 23:39
Re: Long Chat - by Dignity - 19.05.2015, 23:45
Re: Long Chat - by StR_MaRy - 19.05.2015, 23:55
Re: Long Chat - by HeLiOn_PrImE - 20.05.2015, 01:17
Re: Long Chat - by Dignity - 20.05.2015, 01:32

Forum Jump:


Users browsing this thread: 2 Guest(s)