View Single Post
  #1  
Old 09-17-2011, 06:34 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
Monitoring levels

Just read a few guides on file input/output and came up with this that I thought is pretty cool. Basically you put this in a class and if a player enters that level that isn't allowed, it will send an rc chat alert and also save to logs. (players account, in which level, and at what time)

Comments and criticism welcomed.

PHP Code:
function onCreated()
{
  
this.access = {"pig132"};
}
function 
onPlayerEnters()
{
  if (! (
player.account in this.access))
  {
    
temp.filename "levels/users/pig132/other/levels.txt";
    
    
temp.time convertTimeToString(timevar2);
    
    
temp.lines = {player.account " has illegally entered " player.level.name " on " temp.time};
    
temp.lines.savelines(temp.filename1);
    
    echo(
"Level checking: " player.account " was caught in " player.level.name " (saved to logs)");
  }


Last edited by pig132; 09-17-2011 at 06:56 AM..
Reply With Quote