new fFallObject[100];
fFallObject[1] = CreateObject(...); //... 1 - 100 fFallObject[100] = CreateObject(...);
SetTimer("FalloutFall", 5000, true);
forward FalloutFall();
public FalloutFall()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(FalloutJoined[i] == true)
{
//some code
}
}
new Fall = random(100);
new Float:oX, Float:oY, Float:oZ;
GetObjectPos(fFallObject[Fall], oX, oY, oZ);
MoveObject(fFallObject[Fall],oX,oY,oZ-5,5);
}
forward FalloutRespawn();
public FalloutRespawn()
{
//??? :'( xD
}
new bool:ObjectFallen[100] = false;
forward FalloutFall();
public FalloutFall()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(FalloutJoined[i] == true)
{
//some code
}
}
new Fall = -1;
while(Fall == -1)
{
Fall = random(100);
if(ObjectFallen[Fall]) Fall = -1;
}
ObjectFallen[Fall] = true;
new Float:oX, Float:oY, Float:oZ;
GetObjectPos(fFallObject[Fall], oX, oY, oZ);
MoveObject(fFallObject[Fall],oX,oY,oZ-5,5);
if(AllObjectsFallen) ResetFallenObjects();
}
AllObjectsFallen()
{
for(new i = 0; i < 100; i++)
{
if(!ObjectFallen[i]) return false;
}
return true;
}
ResetFallenObjects()
{
for(new i = 0; i < 100; i++)
{
ObjectFallen[i] = false;
}
}

ResetFallenObjects()
{
for(new i = 0; i < 100; i++)
{
ObjectFallen[i] = false;
}
}
ResetFallenObjects()
{
for(new i = 0; i < 100; i++)
{
ObjectFallen[i] = false;
}
}
stock ResetFallenObjects()
{
for(new i = 0; i < 100; i++)
{
new Float:x, Float:y, Float:z;
GetObjectPos(i, x, y, z);
ObjectFallen[i] = false;
MoveObject(ObjectFallen[i],x ,y ,z+5 ,20 ,0,0,0);
}
}
0 ERROR
|
Код:
new bool:ObjectFallen[100] = false;
forward FalloutFall();
public FalloutFall()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(FalloutJoined[i] == true)
{
//some code
}
}
new Fall = -1;
while(Fall == -1)
{
Fall = random(100);
if(ObjectFallen[Fall]) Fall = -1;
}
ObjectFallen[Fall] = true;
new Float:oX, Float:oY, Float:oZ;
GetObjectPos(fFallObject[Fall], oX, oY, oZ);
MoveObject(fFallObject[Fall],oX,oY,oZ-5,5);
if(AllObjectsFallen) ResetFallenObjects();
}
AllObjectsFallen()
{
for(new i = 0; i < 100; i++)
{
if(!ObjectFallen[i]) return false;
}
return true;
}
ResetFallenObjects()
{
for(new i = 0; i < 100; i++)
{
ObjectFallen[i] = false;
}
}
|