Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.