SA-MP Forums Archive
IsPlayerInArea not working - 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)
+--- Thread: IsPlayerInArea not working (/showthread.php?tid=448159)



IsPlayerInArea not working - Lusan - 03.07.2013

Hi, i have one big problem in my map. I made script to fishing, but fishing area still not working.

This is code:

Код:
stock NaPolachLowieckich(playerid)
{
	if(IsPlayerInArea(playerid,-3648.8084586519826, 2566.944875739011, -3501.8287492506306, 2790.6439685092037)||
	IsPlayerInArea(playerid,-4184.734473884124, 931.5762344278054, -4436.699690000728, 603.7829706479612)||
	IsPlayerInArea(playerid,1074.5394815656232, -2956.554850519211, 706.5902770778844, -3240.7855275313877)||
	IsPlayerInArea(playerid,-5280.583191597608, 2062.554669173902, -5896.498164327084, 1830.8029511027091))
	{
		return 1;
	}
	return 0;
}

stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
	new Float:X, Float:Y, Float:Z;

	GetPlayerPos(playerid, X, Y, Z);
	if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY)
	{
        return 1;
    }
    return 0;
}
But, i have gang zone for fishing area:

Код:
terenlowiecki1 = GangZoneCreate(-3648.8084586519826, 2566.944875739011, -3501.8287492506306, 2790.6439685092037);
terenlowiecki2 = GangZoneCreate(-4184.734473884124, 931.5762344278054, -4436.699690000728, 603.7829706479612);
terenlowiecki3 = GangZoneCreate(-5280.583191597608, 2062.554669173902, -5896.498164327084, 1830.8029511027091);
terenlowiecki4 = GangZoneCreate(1074.5394815656232, -2956.554850519211, 706.5902770778844, -3240.7855275313877);
Command for fishing,work just on first coordinates:

Код:
if(IsPlayerInArea(playerid,-3648.8084586519826, 2566.944875739011, -3501.8287492506306, 2790.6439685092037)
Other, not working. Why, please help me. Thanks


Re: IsPlayerInArea not working - Lusan - 03.07.2013

refresh...


Re: IsPlayerInArea not working - Vince - 03.07.2013

You need to check your coordinates. -4436 is obviously less than -4184 and thus those two should be swapped.


Re: IsPlayerInArea not working - Lusan - 03.07.2013

Thanks Vince, working.