why doesn't this work?
#5

Try this:

Код:
#include <a_samp>
#define green 0x33AA33AA
#define red 0xAA3333AA
new IsIn[MAX_PLAYERS], IsOut[MAX_PLAYERS];
forward Areacheck();
public Areacheck()
{
	for(new i=0; i < MAX_PLAYERS; i++)
	{
	if (IsPlayerInArea(i, 2858,2342,-2319,-2742) && IsIn[i] == 0)
	{
	IsIn[i] = 1;
	IsOut[i] = 1;
	SendClientMessage(i,green, "Welcome to the Dm area!");
	}
	if (!IsPlayerInArea(i, 2858,2342,-2319,-2742) && IsOut[i] == 1)
	{
	IsIn[i] = 0;
	IsOut[i] = 0;
	SendClientMessage(i,red, "You left the Dm area!");
	}
	}
	return 1;
}
// IsPlayerInArea Function.
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(playerid, X, Y, Z);
	if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) return 1;
	return 0;
}
You also need to set a timer to use this though..
Reply


Messages In This Thread
why doesn't this work? - by ted80 - 13.06.2010, 19:12
Re: why doesn't this work? - by DJDhan - 13.06.2010, 19:16
Re: why doesn't this work? - by ted80 - 14.06.2010, 06:03
Re: why doesn't this work? - by DJDhan - 14.06.2010, 06:35
Re: why doesn't this work? - by Cameltoe - 14.06.2010, 06:59
Re: why doesn't this work? - by ted80 - 15.06.2010, 13:11
Re: why doesn't this work? - by Cameltoe - 15.06.2010, 14:39
Re: why doesn't this work? - by ted80 - 19.07.2010, 19:37
Re: why doesn't this work? - by ted80 - 20.07.2010, 07:17
Re: why doesn't this work? - by nuriel8833 - 20.07.2010, 07:27

Forum Jump:


Users browsing this thread: 1 Guest(s)