Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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.filename, 1);
    
    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
 


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 10:58 PM.


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