Help me optimize the code
#8

Please read about arrays and loops.

https://sampforum.blast.hk/showthread.php?tid=318212
https://sampwiki.blast.hk/wiki/Loops

PHP код:
for(new 0sizeof DeerIDi++)
{
     if(
hitid == DeerID[i])
     {
          
// code...
     
}

There's no need to DeerID[0] || DeerID[1] and et cetera in this scenario when you've created the objects with an array.

What's this for?
Код:
SetTimer("SpawnDeers", 850*60*5, 0);
(jlalt was 3mins quicker.)
Reply


Messages In This Thread
Help me optimize the code - by skiplovebra - 14.09.2017, 07:23
Re: Help me optimize the code - by Puff - 14.09.2017, 07:30
Re: Help me optimize the code - by skiplovebra - 14.09.2017, 07:32
Re: Help me optimize the code - by Eoussama - 14.09.2017, 07:35
Re: Help me optimize the code - by skiplovebra - 14.09.2017, 07:37
Re: Help me optimize the code - by jlalt - 14.09.2017, 07:43
Re: Help me optimize the code - by skiplovebra - 14.09.2017, 07:43
Re: Help me optimize the code - by Kane - 14.09.2017, 07:45
Re: Help me optimize the code - by skiplovebra - 14.09.2017, 07:54
Re: Help me optimize the code - by skiplovebra - 14.09.2017, 08:19

Forum Jump:


Users browsing this thread: 1 Guest(s)