Closer chat for RP. + REP.
#1

I just wanted to say, that I would like to disable the regular chat, and to exchange it with RolePlay chat, as you played already in RP server, you saw that it goes trought ' CLOSER CHAT ' only people that 10m or so can hear you.
If someone will make me the command I'll +REP.
Reply
#2

Its not a command.. Check below OnPlayerText in your gm..
Reply
#3

Quote:
Originally Posted by Zamora
Посмотреть сообщение
Its not a command.. Check below OnPlayerText in your gm..
I know it's not a command, I didn't even worte " Gimme the command " I just said, how I can do this when players talking in the regular chat, it will be on radius of 10-15m and with white dirty color.
Reply
#4

Use GetDistanceBetweenPlayers
It's easy, try this command for example
pawn Код:
CMD:w(playerid,params[])
{
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,-1,"[USAGE] {FFFFFF}/w [MESSAGE]");
        return 1;
    }
    format(string, sizeof(string), "<Whisper>: %s(%d): %s",PlayerName(playerid),playerid,params);
    printf("%s", string);
    IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
        {
            format(string, sizeof(string), "<Whisper> %s(%d): {FFFFFF}%s",PlayerName(playerid),playerid,params);
            SendClientMessage(i,-1,string);
        }
    }
    return 1;
}
Reply
#5

You said make me a command .

Whatever.. Show me your OnPlayerText.
Reply
#6

Quote:
Originally Posted by Zamora
Посмотреть сообщение
You said make me a command .

Whatever.. Show me your OnPlayerText.
Empty, started from zero precent.
Reply
#7

pawn Код:
stock CloseMessage(playerid, color, string[])
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, x, y, z);
            if(IsPlayerInRangeOfPoint(i, 10.0, x, y, z))
            {
                if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
                {
                    if(GetPlayerInterior(playerid) == GetPlayerInterior(i))
                    {
                        SendClientMessage(i, color, string);
                    }
                }
            }
        }
    }
Add this under OnPlayerText: CloseMessage(playerid, WHITE, text);
Reply
#8

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof (name));
    format(string, sizeof (string), " %s: %s",  name, text);
    SendNearbyMessage(playerid, 10, string, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE, COLOR_WHITE);
    return 0;
}
Edit: Fixed Sendnearbymessage.
Reply
#9

Quote:
Originally Posted by iFiras
Посмотреть сообщение
Use GetDistanceBetweenPlayers
It's easy, try this command for example
pawn Код:
CMD:w(playerid,params[])
{
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,-1,"[USAGE] {FFFFFF}/w [MESSAGE]");
        return 1;
    }
    format(string, sizeof(string), "<Whisper>: %s(%d): %s",PlayerName(playerid),playerid,params);
    printf("%s", string);
    IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
        {
            format(string, sizeof(string), "<Whisper> %s(%d): {FFFFFF}%s",PlayerName(playerid),playerid,params);
            SendClientMessage(i,-1,string);
        }
    }
    return 1;
}
Use what he say ^
Reply
#10

Quote:
Originally Posted by FakkChass
Посмотреть сообщение
Use what he say ^
I didn't meant to say Whisper, or anything else, it's easy to build as much as Privte message and such, I wanted the OnPlayerText, to be as Zamora gave me earlier.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)