Quote:
Originally Posted by Improvement™
This is how I would do it.
pawn Code:
//Somewhere on top of your script new bool:IsPlayerInLosAztTer[MAX_PLAYERS];
//Somewhere in the middle between the Callbacks (public's) forward isPlayerInArea(); public isPlayerInArea() { for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i" { new Float:Pos_X, Float:Pos_Y, Float:Pos_Z); GetPlayerPos(i , Pos_X, Pos_Y, Pos_Z); if(Pos_X <= 2725 && Pos_X >= -1662 && Pos_Y <= 2858 && Pos_Y >= -1500) { if(IsPlayerInLosAztTer[i]) return 1; if(!IsPlayerInLosAztTer[i]) { SendClientMessage(i,orange,"You have entered the Varrios Los Aztecas Territory"); IsPlayerInLosAztTer[i] = true; return 1; } } else { if(!IsPlayerInLosAztTer[i]) return 1; if(IsPlayerInLosAztTer[i]) { SendClientMessage(i, orange, "You have left the Varrios Los Aztecas Territory"); IsPlayerInLosAztTer[i] = false; return 1; } } } return 1; }
FIRST EDIT: Just editted everything into foreach, sorry didn't saw it earlier.
If you would like me to //comment everything and explain it all for you, just reply to this topic  .
I hope this helps.
Kind Regards,
Improvement™
|
Also, if you have multiple areas instead of making a who bunch of boolean values you could have a variable store the id of the area they are in.