08.10.2011, 17:00
pawn Код:
new variavel[MAX_PLAYERS];
for(new ii, jj = GetMaxPlayers(); ii != jj; ii++)
{
variavel[ii] = 1;
}
Em seguida irб realizar o loop, e nгo irб chamar a parte em vermelho do loop, somente a verde:
for(new ii; jj = GetMaxPlayers(); ii != jj; ii++)
Assim irб comparar o valor entre as duas variбveis oque й mais rбpido do que ficar usar assim:
pawn Код:
new var[MAX_PLAYERS];
for(new x; x<GetMaxPlayers();x++)
{
var[x] = 1;
}
for(new x; x<GetMaxPlayers();x++)
entгo irб ficar pegando o valor de maxplayers sempre que iniciar um novo ciclo no loop.
Agora й sу parar para pensar oque й mais rбpido, comparar duas variaveis com os valores estabelecidos, ou comparar uma variavel e executar uma funзгo para pegar um valor

-----------------------------------------
EDIT:
aqui estб pimentgabriel:
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
RemovePlayerAttachedObject(playerid, 0);
for(new ii, jj = GetMaxPlayers(); ii != jj; ii++) alimento[ii] = 4;
SendClientMessageToAll(0x99FFFFAA, "[ZRP] Os Humanos receberam um suprimento de alimentos e nгo passam mais fome.");
}
Atenciosamente,
Falcon.

