SA-MP Forums Archive
areacheck[fast help] - 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: areacheck[fast help] (/showthread.php?tid=328561)



areacheck[fast help] - Meisternuke - 25.03.2012

ger:
mцchte das ein wert auf 1 gesetzt wird wenn man in eine bestimmte zone sich begibt...
wenn man raus geht soll er wieder auf 0 gesetzt werden
also hab das alles im maintimer drin, was ja jede sekunde aufgerufen wird...
gfdin wird auf 1 gesetzt wenn man rein geht, aber wenn man raus geht bleibts auf 1:

eng:
hey everybody...
i want to set a value to 1 if someone enters a specific zone.
if he leaves the zone the value should be set back to 0.
i got the function in my maintimer which is called every second.
if i enter the zone, gfdrin(the value) get set to 1
but if i leave the zone, it won't be set to 0 back

please help me

ps. no errors

Код:
if(Fraktion(i,7)||Fraktion(i,8)||Fraktion(i,9))//ist er in Fraktion 1 oder 2

{
	if(gfdrin[i] == 0)
	
	{
		new Float:X, Float:Y, Float:Z; //We use this to store player position
		GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
		if(X <= -1243.2946 && X >= -1340.2998 && Y <= 2564.9675 && Y >= 2467.2646)//mz1
		
		{
			SendClientMessage(i,ROT,"Test mz1");
			gfdrin[i] = 1;
			
		}
		else if(X <= -748.8052 && X >= -895.2408 && Y <= 1574.4431 && Y >= 1464.4362)//mz2
		
		{
			SendClientMessage(i,ROT,"Test mz2");
			gfdrin[i] = 1;
			
		}
		else if(X <= 1367.892 && X >= 1224.6752 && Y <= 359.0288 && Y >= 179.5940)//mz3
		
		{
			SendClientMessage(i,ROT,"Test mz3");
			gfdrin[i] = 1;
			
		}
		else if(X <= -318.7735 && X >= -483.2922 && Y <= 2269.7932 && Y >= 2181.7739)//mz4
		
		{
			SendClientMessage(i,ROT,"Test mz4");
			gfdrin[i] = 1;
			
		}
		else if(X <= 603.8702 && X >= 407.7185 && Y <= 1571.1945 && Y >= 1318.4215)//mz5
		
		{
			SendClientMessage(i,ROT,"Test mz5");
			gfdrin[i] = 1;
			
		}
		else
		
		{
			if(gfdrin[i] == 1)
			
			{
				gfdrin[i] = 0;
				
			}
			
		}
		
	}
	
}