Proper RP Chat.
#1

Hello, i keep make mine RP chat but when i chat none can see it.

Some help? Anyone got a proper rp chat?
Reply
#2

use the OnPlayerText or or your cmd where you make it and put on on player text and give if player in range of point

then the player can see the chat thats how we do it and true and false option should also be there
Reply
#3

This is something I whipped up for you. It's very simple, but it works.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new szString[128];
    format(szString, sizeof(szString), "%s says: %s", getName(playerid), text);
    sendNearbyMessage(playerid, szString, COLOR_GREY);
    // you don't need to specify "range" unless you want to
    // COLOR_GREY will need to be your color of choice
    return 1;
}

stock getName(playerid) // gets and returns a particular playerid's name
{
    new szName[25];
    GetPlayerName(playerid, szName, sizeof(szName));
    return szName;
}

/* sendNearbyMessage was created by RealCop228 - fuck rights, he doesn't care

the params are:
  playerid is the person sending the message
  text[] is the string message itself (formatted already)
  color is the color you want the message to be
  range is the range to send the message, it defaults to 30 meters from playerid's position
 
*/


stock sendNearbyMessage(playerid, text[], COLOR, Float:range = 30.0)
{
    new Float:fPosition[3];
    GetPlayerPos(playerid, fPosition[0], fPosition[1], fPosition[2]);

    foreach(new i : Player)
    {
        if(IsPlayerInRangeOfPoint(i, range, fPosition[0], fPosition[1], fPosition[2])
        {
            SendClientMessage(i, COLOR, text);
        }
    }
    return 1;
}
* Not tested, should work though.

You'll need the LATEST foreach include, by ******.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)