View Single Post
  #16  
Old 07-24-2011, 11:58 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by Crow View Post
onSwitchPlayerToObserver() and onSwitchObserverToPlayer() are built-in and should do the trick just fine.
I was referring to something simple/easy from within the onActionPlayerOnline function.

I suppose I could try something such as:

PHP Code:
function onInitialized(){
  
this.observers = new TStaticVar();
}

function 
onSwitchPlayerToObserver(temp.pl){
  
this.observers.(@ temp.pl.account) = true;
}

function 
onSwitchObserverToPlayer(temp.pl){
  
this.observers.(@ temp.pl.account) = false;
  
this.doSQLStuff(temp.pl);
}

function 
onActionPlayerOnline(){
  if(!
this.observers.(@ player.account)){
    
this.doSQLStuff(player);
  }
} 
Under the assumption that onSwitchPlayerToObserver() is occurring before onActionPlayerOnline.
Edit: Tested and it doesn't so scratch that.

Last edited by ffcmike; 07-24-2011 at 12:13 PM..
Reply With Quote