SA-MP Forums Archive
Good loop value for clear chat? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Good loop value for clear chat? (/showthread.php?tid=574859)



Good loop value for clear chat? - RaeF - 21.05.2015

How much value is good and very efficient for clear chat console?


Re: Good loop value for clear chat? - Konstantinos - 21.05.2015

20 lines (pagesize) * 5 pages (Page Up/Down) = 100


Re: Good loop value for clear chat? - kyriakos587 - 21.05.2015

70 maybe there is not reason to add 100 its to much


Re: Good loop value for clear chat? - Smileys - 21.05.2015

I wonder though, what would be faster/more efficient, nr 1 or nr 2?

Nr 1:
PHP код:
for( new 0100i++ )
{
    
SendClientMessageToAll( -1" " );

Nr 2:
PHP код:
for( new 050i++ )
{
    
SendClientMessageToAll( -1" " );
    
SendClientMessageToAll( -1" " );

Or what if you'd divide it by 3, or 4, and send 3 or 4 sendclientmessages per loop?


Re: Good loop value for clear chat? - Ahmad45123 - 21.05.2015

Quote:
Originally Posted by Smileys
Посмотреть сообщение
I wonder though, what would be faster/more efficient, nr 1 or nr 2?

Nr 1:
PHP код:
for( new 0100i++ )
{
    
SendClientMessageToAll( -1" " );

Nr 2:
PHP код:
for( new 050i++ )
{
    
SendClientMessageToAll( -1" " );
    
SendClientMessageToAll( -1" " );

Or what if you'd divide it by 3, or 4, and send 3 or 4 sendclientmessages per loop?
Number 2 because natives are alot faster then PAWN coding.


Re: Good loop value for clear chat? - Smileys - 21.05.2015

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
Number 2 because natives are alot faster then PAWN coding.
So, if I add 10 SCM in 1 loop, and loop it 10 times, is it still faster or does it slow down at some point?


Re: Good loop value for clear chat? - Ahmad45123 - 21.05.2015

Quote:
Originally Posted by Smileys
Посмотреть сообщение
So, if I add 10 SCM in 1 loop, and loop it 10 times, is it still faster or does it slow down at some point?
Yes.

I am not sure though, I am just talking depending on something that ****** said somewhere on the forums.. If someone can confirm it... It'd be better.


Re: Good loop value for clear chat? - Konstantinos - 21.05.2015

For other cases, Ahmad45123 is correct but here the code won't even take 1 ms to be executed.

Quote:
Originally Posted by kyriakos587
Посмотреть сообщение
70 maybe there is not reason to add 100 its to much
I use 20 lines on chat (/pagesize 20) so I will still be able to read the previous text.