06.01.2010, 18:41
pawn Code:
if(strcmp(cmd, "/Tomar", true) == 0 || strcmp(cmd, "/TO", true) == 0)
{
if(IsPlayerInArea(playerid,1235.075, -1287.088, 1356.766, -1152.865))
{
if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Voce deve ficar na area por 30 segundos, os policiais e outras gangs ja foram avisados! Se cuide!");
SetTimerEx("funcaogz", 1000, 0,"e",playerid);
return 1;
}
}
return SendClientMessage(playerid, COLOR_LIGHTBLUE,"Voce nгo estб em uma GZ");
}
EDIT: cria um timer e uma variavel pra verificar se ele ainda estб dentro da area....
pawn Code:
new TimerParaDominar[MAX_PLAYERS];
new TimerEstaEmArea[MAX_PLAYERS];
new bool:EstaEmArea[MAX_PLAYERS];
//quando digitar pra dominar coloque
EstaEmArea[playerid] = true;
//Timer junto do timer funcaogz
TimerEstaEmArea[playerid] = SetTimerEx("EstaNaArea", 30000, false,"d",playerid);
//mude aquele timer funcaogz para:
TimerParaDominar[playerid] = SetTimerEx("funcaogz", 1000, false,"d",playerid);
forward EstaNaArea(playerid);
public EstaNaArea(plyerid)
{
if(EstaEmArea[playerid]) return 0;
else NaoDominou(playerid);
return 1;
}
stock NaoDominou(playerid)
{
KillTimer(TimerParaDominar[playerid]);
SendClientMessage(playerid, COR, "Vocк saiu da area portanto nгo a dominou");
GangZoneStopFlashForAll(constgz);
return 1;
}

