Thread: players in room
View Single Post
  #42  
Old 08-24-2003, 08:37 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
I didnt read all the way to the third page but.....

In order for more people to be in the room playerenters will have to be triggered.... *DUH* you dont need a timeout loop to lag the server any or little just a simple
NPC Code:


if(created) {
this.minplayers=5;
}
if(playerenters) {
if(playerscount>=this.minplayers){
blah();
}
}



THat would be sufficient right or did i miss something?


[edit]
NPC Code:


if(created) {
this.minplayers=5;
this.mode=0;
this.check=0;
}
if(playerenters||playerleaves) {
this.mode=(playerscount>=this.minplayers? 1 : playerscount<this.minplayers? 0 );
if(this.mode!==this.check) {
door();
}

}

function door() {
this.check=this.mode
if(this.mode=1) {//Opening
blah;
}
if(this.mode=0) {//Closing
blah;
}
}



THeres a more complex edit it should work *goez to zleep im tired*
__________________

To the sun of your age, I arise

Last edited by TB3; 08-24-2003 at 08:52 AM..
Reply With Quote