pawn Код:
//Topo do GameMode
new bool:GZone[MAX_PLAYERS][10];
//Final do GameMode
forward UpdateGangZone();
public UpdateGangZone()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerInArea(i, minx, miny, maxx, maxy))
{
if(Gzone[i][1])
{
GangZoneStopFlashForAll(zoneid);
}
}
if(IsPlayerInArea(i, minx, miny, maxx, maxy))
{
if(!GZone[i][1])
{
GZone[i][1] = true;
}
}
}
return 1;
}
Aonde estб:
minx, miny, maxx, maxy - Coloque as cordenadas da GangZone.
zoneid - Coloque a variavel da GangZone.
Seguinte esse if:
pawn Код:
if(!IsPlayerInArea(i, minx, miny, maxx, maxy))
{
if(GZone[i][1])
{
GangZoneStopFlashForAll(zoneid);
}
}
Verifica se o player nгo estб mais dentro da GangZone, nisso verifica se a variavel GZone[i][1] й = hб "true" se for a GangZone que vocк por ali irб parar de piscar, se nгo for irб continuar lendo os 'ifs'
que vem abaixo.
Jб esse if:
pawn Код:
if(IsPlayerInArea(i, minx, miny, maxx, maxy))
{
if(!Gzone[i][1])
{
GZone[i][1] = true;
}
}
Verifica se o player tб dentro da GangZone, se ele estiver vai ser a variavel dele "GZone[i][1]" para true. se ele nгo estiver irб continuar lendo oque estб abaixo.
Explicaзгo sobre "[1]" isso й um armazenamento, pois vocк irб salvar cada GangZone com um numero ex: Vagos vai ser [1], Ballas vai ser [2] e dai por diante eu coloquei lб encima o Limite de 10 "new bool:GZone[MAX_PLAYERS][10];" se quizer alterar altere, e o "bool" й porque somente irei usar dois valores "true" ou "false"(Verdadeiro ou Falso).
Dъvidas ? poste
@EDIT
Esqueci da stock
pawn Код:
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 && y >= miny && x <= maxx && y <= maxy) return true;
else return false;
}