[SOLVED] A little help with IsPlayerInArea
#1

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;
}
Reply
#2

You need to put it in a timer
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)