View Single Post
  #2  
Old 02-05-2011, 03:43 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Typically you aren't/shouldn't be going over more than 10 effects.

PHP Code:
//#CLIENTSIDE

public function clearEffects() {
  for (
temp.10temp.30temp.i++) player.attr[i] = "";
}

public function 
addAttrEffect(ganilength) {
  
temp.findOpenAttr();
  
player.attr[i] = gani;
  
this.scheduleevent(length"HideAttrEffect"temp.i);
  return 
temp.i;
}

public function 
hideAttrEffect(gani) {
  for (
temp.10temp.30temp.i++) {
    if (
player.attr[i] == ganiplayer.attr[i] = "";
  }
}

function 
onHideAttrEffect(i) {
  
player.attr[i] = "";
}

function 
findOpenAttr() {
  for (
temp.10temp.30temp.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.
__________________
Quote:
Reply With Quote