SA-MP Forums Archive
[Help] Only people who are near me can see what i write - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Only people who are near me can see what i write (/showthread.php?tid=94127)



[Help] Only people who are near me can see what i write - Alex_Grant - 28.08.2009

Hello there,
I've started making my own server, and i have a problem, i can't seem to make this shit of only people who are near me can hear what i am saying in the general chat, I mean when i type something, i want only the people who are around me can see it, not the whole server can see it, so please help me, is it a problem in GameTextPlayer or what? Can someone asnwer me?

Exemple how is has to be:





Exemple how it is now:




Re: Only people who are near me can hear me - dice7 - 28.08.2009

https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius


Re: Only people who are near me can hear me - boelie - 28.08.2009

yes you can use limitglobalchatradius...but dont forget to let the player knows that when he logs in and spawns that you have to be nearby some1 to just talk in chat.


Re: Only people who are near me can hear me - Alex_Grant - 28.08.2009

Quote:
Originally Posted by boelie
yes you can use limitglobalchatradius...but dont forget to let the player knows that when he logs in and spawns that you have to be nearby some1 to just talk in chat.
Quote:
Originally Posted by dice7
You guys didn't get me. Look, for exemple on GF, when you speak IC, i mean just /say, only the closest guys can see it, but on my server, which i made from scratch, everyone can see it, that's what i'm talking about, so how to fix this lol?


Re: [Help] Only people who are near me can see what i write - dice7 - 28.08.2009

Open up the search function and type in GetClosestPlayer


Re: [Help] Only people who are near me can see what i write - Alex_Grant - 28.08.2009

Quote:
Originally Posted by dice7
Open up the search function and type in GetClosestPlayer
Код:
forward GetClosestPlayer(p1);
Код:
public GetClosestPlayer(p1)
{
	new x,Float:dis,Float:dis2,player;
	player = -1;
	dis = 99999.99;
	for (x=0;x<MAX_PLAYERS;x++)
	{
		if(IsPlayerConnected(x))
		{
			if(x != p1)
			{
				dis2 = GetDistanceBetweenPlayers(x,p1);
				if(dis2 < dis && dis2 != -1.00)
				{
					dis = dis2;
					player = x;
				}
			}
		}
	}
	return player;
}
Is this what you are talking about? Answer me please