Hello need help about IsPlayerInArea please help.
#1

So I cant get it how the code works I tried to get the script working but no effect. SO I'm here.

I need help about if player is in zone, he gets message--> "You are now in Grove zone you are not safe...."

Please some one help me.

Sincerely Your Trapped. Thanks for help.. (I know for thanks you cant buy nothing)

Код:
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!");
			}
 		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!");
			}
	}
}
Reply
#2

show the code!!
Reply
#3

So I edited the post so you can see
Reply
#4

bump
Reply
#5

Do the other messages get sent? Are you sure the coordinates are correct?

Also, the following line will not work:
pawn Код:
SetPlayerHealth(i, GetPlayerHealth(i, h) -1.0);
GetPlayerHealth stores the player's health within the given variable, the function doesn't return the value itself. You will need to adjust the code, like so, to get it to work correctly
pawn Код:
GetPlayerHealth( i, h );
SetPlayerHealth( i, h - 1.0 );
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)