![]() |
allplayers global var
Having a bit of a problem...
I'm choosing a random player that isn't the player on another client, but its not optimizing as it should, any ideas? HTML Code:
function onActionGrab() {HTML Code:
allplayers |
if (temp.pl.computerfirstlogin = player.computerfirstlogin) {
== |
You can't remove from the allplayers array (which I wonder if it is trying to do instead of copying the array) so instead use it read-only, it's also more efficient this way:
PHP Code:
|
I was trying to replicate an array to save memory, skyld pointed it out that the loop will only ever run more than once if it matches someone using two accounts. Maximum loop size depending on how many clients are open and if they're even hit by the random number.
Thanks guys ^^ |
Note that this is incorrect code:
PHP Code:
PHP Code:
|
| All times are GMT +2. The time now is 07:46 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.