View Single Post
  #15  
Old 11-25-2007, 05:05 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
PHP Code:
//In Control-NPC
function onInitialized() {
  
// Loading reset accounts list into a global variable when the NPC-Server starts.
  
resetaccounts 0;
  
resetaccounts.loadlines("levels/resetaccounts.txt");
}
function 
onActionPlayerOnline() {
  
// Check if the player's account is in the list.
  
if (resetaccounts.index(player.account) < 0) {
    
// Reset him if its not.
    
sendtorc("/reset " player.account);
    
// Add his account to the list so hes not reset again.
    
resetaccounts.add(player.account);
    
// Save the list of reset accounts to file again without unloading it from memory.
    
resetaccounts.savelines("levels/resetaccounts.txt"0);
  }

There, I don't think I missed anything.

You can use that method, or only use resetaccounts.txt for players that are currently in the process of resetting then just give them a clientr flag after the reset.
__________________
Reply With Quote