20.06.2014, 10:40
I got this code:
This code is not only used by [TEST] , but it repeats 36 times with different zones so either I make this code for each zone every time, or I simply use a loop for all zones, but Im afraid it will use more memory because there is already a loop , this one :
pawn Код:
if(checkpointid == CP[TEST])
{
if(Balblabl[TEST] == false)
{
if(tCP[TEST] != PlayerInfo[playerid][Team])
{
Blabal(playerid, TEST);
} else return SendClientMessage(playerid, COLOR_RED,"*Blabla taken!");
}
if(UnderAttack[TEST] == true)
{
if(BlabalTeam[TEST] == PlayerInfo[playerid][Team] && IsPlayerBlabla[playerid][TEST] == false)
{
ShowPlayerProgressBar(playerid, ZBar);
IsPlayerBlabla[playerid][TEST] = true;
}
if(BlabalTeam[TEST] != PlayerInfo[playerid][Team])
{
foreach (new i : Player)
{
if(BlabalTeam[TEST] == PlayerInfo[i][Team])
{
if(Demanded[i] == playerid)
{
ShowPlayerProgressBar(playerid, ZBar);
IsPlayerBlabla[playerid][TEST] = true;
}
}
}
}
}
}
This code is not only used by [TEST] , but it repeats 36 times with different zones so either I make this code for each zone every time, or I simply use a loop for all zones, but Im afraid it will use more memory because there is already a loop , this one :
pawn Код:
foreach (new i : Player)
{
if(BlabalTeam[TEST] == PlayerInfo[i][Team])
{
if(Demanded[i] == playerid)
{
ShowPlayerProgressBar(playerid, ZBar);
IsPlayerBlabla[playerid][TEST] = true;
}
}
}