If player in zone.
#1

How to detect if player in this zone:
new US;

US = GangZoneCreate(93.423, 1763.359, 350.3363, 2066.984);

And increase his health SetPlayerHealth(playeris, GetPlayerHealth(playerid) -5.0) by - 5 for 1 second?
Reply
#2

Use a timer. and the wiki please.
Reply
#3

IsPlayerInArea(minX,minY,maxX,maxY);
Reply
#4

IsPlayerInArea(minX,minY,maxX,maxY);
Thanks found stock.

And where I must use this exactly?IsPLayerInArea?

In what forward? :/
Reply
#5

make a new function attached to a timer.
Reply
#6

Код:
forward AreaCheck(playerid)

SetTimer("AreaCheck", 3000, 1);

public AreaCheck(playerid)
{
	new Float:h;
	for(new i=0; i<MAX_PLAYERS; i++ )
	{
	  if(!IsPlayerConnected(i)) continue;
		if(IsPlayerInArea(i,2989.536, -2989.536, 502.1487,-2942.825) && IsPlayerAlive[i])
		{
			SetPlayerHealth(i, 0.0);
			SendClientMessage(i, COLOR_RED, "Danger Zone!");
			//Add timer for god here
		}
 		if(IsPlayerInArea(i, -1331.278, -3001.214, 1634.903, 443.7593) && IsPlayerAlive[i])
		{
			SetPlayerHealth(i, GetPlayerHealth(i, h) -1.0);
			SendClientMessage(i, COLOR_RED, "Danger Zone!");
			//Add timer for god here
		}
	}
}
Something like this?

Why when I spawn I'm dying!!!!!!!!!!?
And I'm not in death zone ((
Zone is good created,all coordinates good, but why when I spawn I die? After choosen class I'm die And one time when connected.
Reply
#7

u using correct coords at isplayerinarea?
Reply
#8

Problem solved by MYSELF...
SetTimer must be in OnPlayerSpawn....
Reply
#9

why using (playerid) and a loop?
Reply
#10

About player id,i've deleted it and LOOP? What is this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)