Typically you aren't/shouldn't be going over more than 10 effects.
PHP Code:
//#CLIENTSIDE
public function clearEffects() {
for (temp.i = 10; temp.i < 30; temp.i++) player.attr[i] = "";
}
public function addAttrEffect(gani, length) {
temp.i = findOpenAttr();
player.attr[i] = gani;
this.scheduleevent(length, "HideAttrEffect", temp.i);
return temp.i;
}
public function hideAttrEffect(gani) {
for (temp.i = 10; temp.i < 30; temp.i++) {
if (player.attr[i] == gani) player.attr[i] = "";
}
}
function onHideAttrEffect(i) {
player.attr[i] = "";
}
function findOpenAttr() {
for (temp.i = 10; temp.i < 30; temp.i++) {
if (player.attr[temp.i] == "") return temp.i;
}
return 10;
}
Your effects should be applied to other systems using their data (gani, params, and how long it needs to be there) and not by a continuous 20 FPS loop using a client array, which allows me to simplify your system to above.