22.01.2011, 03:57
(
Последний раз редактировалось bruno_orlandi; 22.01.2011 в 13:46.
Причина: Postei o codigo completo
)
No topo ta assim
No OnGmaeModeInit
Dentro de um timer q repete a cada segundo:
No final:
O q eu quero й q quando tem um jogador na Area o contador de pontos vai subindo a cada segundo(o contador aparece lб como SendClientMessageToAll mas й q eu ainda nгo o fiz, й sу teste), sу q na hora de ver os players na Area, a parte de IsPlayerConnected e gTeam ocorre tudo ok, quando chega no IsPlayerInArea ele nao funciona.
A ordem eu coloquei pra ficar igual o gang zone Float:minx, Float:miny, Float:maxx, Float:maxy e ainda nao funciona.
Mesmo num simples comando q eu fiz ele nao funciona:
Код:
new Area; new NumeroPlayers; new Pontos; new Piscando;
Код:
Area = GangZoneCreate(-2417.1812,-408.2285,-2578.8052,-492.4147);
NumeroPlayers= 0;
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i] == TEAM_1)
{
if(IsPlayerInArea(i,-2417.1812,-408.2285,-2578.8052,-492.4147))
{
NumeroPlayers++;
if(Piscando == 0)
{
SendClientMessageToAll(COLOR_ADD, "Estгo atacando a Area!");
GangZoneFlashForAll(Area,PISCA);
Piscando = 1;
}
}
}
}
}
if(NumeroPlayers <= 0 && Piscando == 1)
{
SendClientMessageToAll(COLOR_ADD, "Area se defendeu do Ataque");
GangZoneStopFlashForAll(Favela);
Piscando = 0;
}
if(Piscando == 1)
{
Pontos++;
format(string, sizeof(string), "Pontos na Area: %d",Pontos);
SendClientMessageToAll(COLOR_ADD, string);
}
Код:
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 && x < maxx && y > miny && y < maxy) return true;
return false;
}
A ordem eu coloquei pra ficar igual o gang zone Float:minx, Float:miny, Float:maxx, Float:maxy e ainda nao funciona.
Mesmo num simples comando q eu fiz ele nao funciona:
Код:
if(strcmp(cmd, "/area", true) == 0)
{
if(IsPlayerInArea(playerid,-2417.1812,-408.2285,-2578.8052,-492.4147))
{
SendClientMessage(playerid, COLOR_GREY, "TБ NA AREA");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "NГO TA NA AREA");
}
return 1;
}

