help with Range Chat
#1

ok i got a probelm i made the Range "50" so its a local chat but i dont know why the ppl still can talk as example from LV to LS the range didnt changed its no local chat

PHP код:
public Chat_LocalRange(playeridcolorstring[])
{
    new 
FloatmPlayerXFloatmPlayerYFloatmPlayerZ;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
GetPlayerPos(playeridmPlayerXmPlayerYmPlayerZ);
            if(
IsPlayerInRangeOfPoint(i50505050))
            {
                if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
                {
                    
SendClientMessage(iCOLOR_WHITEstring);
                }
            }
        }
    }
    return 
1;

or did i changed the range in the wronge part?
Reply
#2

pawn Код:
if(IsPlayerInRangeOfPoint(i, 50, mPlayerX, mPlayerY, mPlayerZ))
You should also return 0 in OnPlayerText to block the global chat.
Reply
#3

but when i do i cant write anymore only PM's
Reply
#4

Where do you use this Chat_LocalRange ?
Reply
#5

u putted it at the end of my script
Reply
#6

I think it's easier to use function

pawn Код:
LimitGlobalChatRadius(Float:radius);
under

pawn Код:
public OnGameModeInit
https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius

Let me know if this solved your problem.
Reply
#7

thanks it helped very well
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)