22.07.2018, 15:19
(
Последний раз редактировалось grymtn; 22.07.2018 в 19:46.
)
or if you dontwant to use iterators you can just create a global variable like below.
Then under OnPlayerConnect:
Then ofcourse OnPlayerDisconnect:
After that you just need a command that will tell you the number that your variable holds.
If you really want to use a loop you can create an array* variable for max players and when they disconnect you can turn it to 0 and ofcourse on login you can do switching it to 1. so your loop would be like:
Then you can print that mycount variable to your screen if you want or do whatever you need with it. But it would be the same thing as using iterators because thats basically an iterator.
Edit: fixed wrong spelled word.
Код:
new myonlineplayers=0;
Код:
myonlineplayers++;
Код:
myonlineplayers--;
If you really want to use a loop you can create an array* variable for max players and when they disconnect you can turn it to 0 and ofcourse on login you can do switching it to 1. so your loop would be like:
Код:
new mycount=0; for(new i=0; i<MAX_PLAYERS; i++) { if(myonlineplayers[i]==1) { mycount++; } }
Edit: fixed wrong spelled word.