SA-MP Forums Archive
[SOLVED] A little help with IsPlayerInArea - 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: [SOLVED] A little help with IsPlayerInArea (/showthread.php?tid=100937)



[SOLVED] A little help with IsPlayerInArea - Vichuzz - 07.10.2009

Hi..

I was trying to check whether a player is in certain Area for my bank script. But Even if I enter that particular area, it doesn't works. I checked the whole code and everything seems fine. So I guess the problem is probably with my co-ords.

This is from my savedpositions.txt :

Код:
AddPlayerClass(217,-1990.9180,298.8868,35.4688,78.8712,0,0,0,0,0,0); // minx
AddPlayerClass(217,-1980.5435,299.2061,35.1719,281.7545,0,0,0,0,0,0); // miny
AddPlayerClass(217,-1980.7822,309.1550,35.1719,1.6553,0,0,0,0,0,0); // maxy
AddPlayerClass(217,-1990.7935,309.2433,35.1794,92.5646,0,0,0,0,0,0); // maxx
And this is my failing line:

Код:
 if (IsPlayerInArea(playerid,-1990.7935, -1990.9180, 309.1550, 299.2061))
Here's my IsPlayerInArea Code

Код:
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;
}



Re: A little help with IsPlayerInArea - dice7 - 07.10.2009

You need to put it in a timer


Re: A little help with IsPlayerInArea - Vichuzz - 07.10.2009

nvm..I used Seif's IsPlayerInArea. thanks anyway!