public boobsgatetimer() { for(new i=0; i<MAX_PLAYERS; i++) { if(boobsmember[i] == 1 || IsPlayerAdmin(i)) { //---------------------------------------------------------------------------- if(IsPlayerInRangeOfPoint(i,20,-545.30004882813, 1251.1568603516, 1.5)) { MoveObject(boobsgate,-545.30004882813, 1249.1568603516, 9.5, 2); } else { MoveObject(boobsgate,-545.30004882813, 1251.1568603516, 1.5, 2); } //----------------------------------------------------------------------------BOOBSDOOR1 if(IsPlayerInRangeOfPoint(i,5,-540.58142089844, 1329.7946777344, 3.2876319885254)) { MoveObject(boobsdoor1,-540.58142089844, 1329.7946777344, 6.2876319885254, 2); } else { MoveObject(boobsdoor1,-540.58142089844, 1329.7946777344, 3.2876319885254, 2); } //----------------------------------------------------------------------------BOOBSDOOR2 if(IsPlayerInRangeOfPoint(i,5,-543.65942382813, 1355.6201171875, 11.836064338684)) { MoveObject(boobsdoor2,-543.65942382813, 1355.6201171875, 14.836064338684, 2); } else { MoveObject(boobsdoor2,-543.65942382813, 1355.6201171875, 11.836064338684, 2); } //----------------------------------------------------------------------------BOOBSDOOR3 if(IsPlayerInRangeOfPoint(i,5,-542.75897216797, 1376.6665039063, 11.807936668396)) { MoveObject(boobsdoor3,-542.75897216797, 1376.6665039063, 14.807936668396, 2); } else { MoveObject(boobsdoor3,-542.75897216797, 1376.6665039063, 11.807936668396, 2); } //----------------------------------------------------------------------------BOOBSDOOR4 if(IsPlayerInRangeOfPoint(i,5,-543.65338134766, 1366.5200195313, 11.790085792542)) { MoveObject(boobsdoor4,-543.65338134766, 1366.5200195313, 14.790085792542, 2); } else { MoveObject(boobsdoor4,-543.65338134766, 1366.5200195313, 11.790085792542, 2); } //----------------------------------------------------------------------------BOOBSDOOR5 if(IsPlayerInRangeOfPoint(i,5,-535.11450195313, 1419.3912353516, 12.049313545227)) { MoveObject(boobsdoor5,-535.11450195313, 1419.3912353516, 15.049313545227, 2); } else { MoveObject(boobsdoor5,-535.11450195313, 1419.3912353516, 12.049313545227, 2); } //----------------------------------------------------------------------------BOOBSDOOR6 if(IsPlayerInRangeOfPoint(i,5,-543.28619384766, 1370, 19.033756256104)) { MoveObject(boobsdoor6,-543.28619384766, 1370, 22.033756256104, 2); } else { MoveObject(boobsdoor6,-543.28619384766, 1370, 19.033756256104, 2); } } } }
Originally Posted by Mo3
Okay Iґve got it. Could you give me a example on how to do that?
|
new boobsgateOpened; public boobsgatetimer() { new boobsgateNearCount; // No need to make it = 0, it is by default. new boobsdoor1NearCount; for(new i=0; i<MAX_PLAYERS; i++) { if(boobsmember[i] == 1 || IsPlayerAdmin(i)) { //---------------------------------------------------------------------------- if(IsPlayerInRangeOfPoint(i,20,-545.30004882813, 1251.1568603516, 1.5)) { boobsgateNearCount ++; } //---------------------------------------------------------------------------- if(IsPlayerInRangeOfPoint(i,20,-545.30004882813, 1251.1568603516, 1.5)) { boobsdoor1NearCount ++; } //---------------------------------------------------------------------------- } } //---------------------------------------------------------------------------- // Make the doors move: //---------------------------------------------------------------------------- if(boobsgateNearCount > 0) { MoveObject(boobsgate,-545.30004882813, 1249.1568603516, 9.5, 2); } else { MoveObject(boobsgate,-545.30004882813, 1251.1568603516, 1.5, 2); } //------------------------------ if(boobsdoor1NearCount > 0) { MoveObject(boobsdoor1,-540.58142089844, 1329.7946777344, 6.2876319885254, 2); } else { MoveObject(boobsdoor1,-540.58142089844, 1329.7946777344, 3.2876319885254, 2); } }
public boobsgatetimer()
{
new i = -1, bool:open[7];
while(++i < MAX_PLAYERS)
{
if(boobsmember[i] == 1 || IsPlayerAdmin(i))
{
if( !open[0] && IsPlayerInRangeOfPoint(i, 20, -545.30004882, 1251.15686035, 1.5))
open[0] = true;
else if(!open[1] && IsPlayerInRangeOfPoint(i, 5, -540.58142089, 1329.79467773, 3.28763198))
open[1] = true;
}
}
if(open[0]) MoveObject(boobsgate, -545.30004882, 1249.15686035, 9.5, 2);
else MoveObject(boobsgate, -545.30004882, 1251.15686035, 1.5, 2);
if(open[1]) MoveObject(boobsdoor1, -540.58142089, 1329.79467773, 6.28763198, 2);
else MoveObject(boobsdoor1, -540.58142089, 1329.79467773, 3.28763198, 2);
}
Originally Posted by ♣ ⓐⓢⓢ
I would suggest this way, its quite similar but a bit better cuz it uses bools and has an extra check in it
pawn Код:
|