[HELP] Random, MoveObject
#10

Quote:
Originally Posted by jop9888
Посмотреть сообщение
Код:
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;
       }
}
If you get the code above, i can you help you with the rest as well
WHY ONE OF 100 OBJECTS NEVER FALL? HOW TO FIX IT?
Reply


Messages In This Thread
[HELP] Random, MoveObject - by ThomasEvil - 07.01.2018, 00:46
Re: [HELP] Random, MoveObject - by JesterlJoker - 07.01.2018, 09:01
Re: [HELP] Random, MoveObject - by jop9888 - 07.01.2018, 09:33
Re: [HELP] Random, MoveObject - by ThomasEvil - 07.01.2018, 17:29
Re: [HELP] Random, MoveObject - by Lucases - 07.01.2018, 19:03
Re: [HELP] Random, MoveObject - by ThomasEvil - 08.01.2018, 18:34
Re: [HELP] Random, MoveObject - by ThomasEvil - 10.01.2018, 18:47
Re: [HELP] Random, MoveObject - by AlexMSK - 10.01.2018, 18:55
Re: [HELP] Random, MoveObject - by ThomasEvil - 10.01.2018, 19:41
Re: [HELP] Random, MoveObject - by ThomasEvil - 29.01.2018, 14:22

Forum Jump:


Users browsing this thread: 2 Guest(s)