Thread: Glow effect
View Single Post
  #2  
Old 07-09-2011, 05:34 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
Quote:
Originally Posted by pez307 View Post
Okay so, i took this script from chris posted on forums, and i've added it, yet when players log off the light remains on the ground, how would i prevent that?
1. Count the number of players. I.e: this.player_count = players.size();
2. Check if the number has changed from the last time you checked. I.e: if (players.size() != this.player_count)
3. If the number changed hide the images. I.e: hideimgs(200,1000);

It looks something like this:

PHP Code:
function checkPlayerCount() {
  
// Get current playercount
  
temp.current_count players.size();
  
// Compare to the last playercount
  
if (this.player_count != temp.current_count) {
    
// Playercount has changed.
    
doSomething();
    
// Update last playercount
    
this.player_count temp.current_count;
  }

Hint: You'll have to do this in your timeout loop.
__________________
Quote:
Reply With Quote