Random method without repeating
#2

Код:
new Float:EasterEggs[][]= 
{ 
    {X, Y, Z}, 
    {X, Y, Z}, 
    {X, Y, Z}, 
    //etc.. 
}; 
new lastcoords=-1;
stock SpawnEasterEgg()
{
new randomCoord;
randomCoord = random(sizeof(EasterEggs));
while(randomCoord==lastcoords)
{
      randomCoord = random(sizeof(EasterEggs));
}
lastcoords = randomCoord;
// spawn it.
}
Edit : Are you going to spawn all of the easter eggs at one time or you will spawn them after a timer or you want just one easter egg to spawn ?
Reply


Messages In This Thread
Random method without repeating - by Detoria - 06.03.2015, 23:14
Re : Random method without repeating - by Golimad - 06.03.2015, 23:25
Re: Re : Random method without repeating - by Detoria - 06.03.2015, 23:27
Re : Random method without repeating - by Golimad - 06.03.2015, 23:30
Re: Re : Random method without repeating - by Detoria - 06.03.2015, 23:32
Re : Random method without repeating - by Golimad - 06.03.2015, 23:38
Re: Random method without repeating - by Detoria - 06.03.2015, 23:45
Re : Random method without repeating - by Golimad - 06.03.2015, 23:52
Re: Random method without repeating - by Detoria - 07.03.2015, 00:18
AW: Re : Random method without repeating - by Nero_3D - 07.03.2015, 00:21

Forum Jump:


Users browsing this thread: 1 Guest(s)