Local Chat
#1

Any tut here on how to make Local Chat??
Reply
#2

Somewhere in your script:

PHP код:
ProxDetector(Floatf_Radiusplayeridstring[],col1,col2,col3,col4,col5)
{
    new
        
Floatf_playerPos[3];

    
GetPlayerPos(playeridf_playerPos[0], f_playerPos[1], f_playerPos[2]);
    foreach(new 
Player)
    {
        if(
GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
        {
            if(
IsPlayerInRangeOfPoint(if_Radius 16f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol1string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radius 8f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol2string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radius 4f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol3string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radius 2f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol4string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radiusf_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol5string);
            }
        }
    }
    return 
1;

The command:

PHP код:
CMD:local(playeridparams[])
{
    new 
string[128],pname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnamesizeof(pname));
    if(
isnull(params)) return SendClientMessage(playerid, -1"/local <Message>");
    
format(stringsizeof(string), "Local Chat %s:{FFFFFF} %s"pnameparams);
    
ProxDetector(20.0playeridstring,-1,-1,-1,-1,-1);
    return 
1;

Hope it works
Reply
#3

No no you dont understand. I dont want to type /local <message> i want to just type and it is automaticly local chat. Get it?
Reply
#4

then the same function, but
Код:
ProxDetector(20.0, playerid, text,-1,-1,-1,-1,-1);
put in OnPlayerText, like this:

PHP код:
public OnPlayerText(playeridtext[])
{
    
ProxDetector(20.0playeridtext,-1,-1,-1,-1,-1);
    return 
false;

Reply
#5

This may work, keep the ProxDetector.
Under OnPlayerText:

PHP код:
public OnPlayerText(playeridtext[])
{
    
ProxDetector(20.0playeridtext,-1,-1,-1,-1,-1);
    return 
0;

eh BloodyRP was faster than me :P
Reply
#6

Quote:
Originally Posted by oMa37
Посмотреть сообщение
This may work, keep the ProxDetector.
Under OnPlayerText:

PHP код:
public OnPlayerText(playeridtext[])
{
    
ProxDetector(20.0playeridtext,-1,-1,-1,-1,-1);
    return 
0;

eh BloodyRP was faster than me :P
^ You would need to-do this, but it would only display the user text, not the user who inputted it.
PHP код:
OnPlayerText(...) {
    new 
tstr[128], pName[25];
    
GetPlayerName(playeridpName25);
    
format(tstr128"%s says: %s"pNametext);
    
ProxDetector(20.0playeridtstr, -1, -1, -1, -1, -1);

Reply
#7

The craziest one is there's an example of local chat in the GrandLarceny files, provided with the server package.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)