OnPlayerText Help
#1

I need help with OnPlayerText. I am trying to limit the globalchatradius and then send a message to the player who typed if nobody is within range. It works good except when i type something i get a message saying that i typed Eagle
i will include a screenshot
Код:
public OnPlayerText(playerid, text[])
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	format(text, 128, "%s : %s", name, text);
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	for (new i=0; i<MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(IsPlayerInRangeOfPoint(i,200.0,x,y,z))
			{
	        SendClientMessage(i, GetPlayerColor(playerid), text);
	        }
		}
		else
		{
			return SendClientMessage(playerid, COLOR_WHITE, "[SERVER] : Nobody heard you, please use /shout or /me!");
		}
	}
	return 0;
}
Reply


Messages In This Thread
[SOLVED]OnPlayerText Help - by [BFT]eagles22 - 02.01.2011, 22:32
Re: OnPlayerText Help - by JaTochNietDan - 02.01.2011, 23:00
Re: OnPlayerText Help - by [BFT]eagles22 - 02.01.2011, 23:15

Forum Jump:


Users browsing this thread: 1 Guest(s)