Quote:
Originally Posted by Crow
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.