Whats better and why
#1

Hey!

I'm just wondering if there is any difference between

PHP Code:
for(new GetPlayerPoolSize(), 0<= j;  i++) 
and

PHP Code:
for(new 0GetPlayerPoolSize(); <= ji++) 
And if there is, whats the difference and whats better to use?

EDIT: And do you need to use "if(IsPlayerConnected(i))" after using GetPlayerPoolSize, since getplayerpoolsize only gets online players ?

Thanks for help!
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=581727
Reply
#3

Use foreach, i think it is the best choice.
Reply
#4

Okay thanks
Reply
#5

There's no difference. And yes you need to use IsPlayerConnected inside the loop because https://sampwiki.blast.hk/wiki/GetPlayerPoolSize

So you still need to check the ids are connected to the server.

And on another note, foreach is faster and better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)