Graal Forums  

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

View Poll Results: Was this useful to you?
Yeah 4 57.14%
No 3 42.86%
Voters: 7. You may not vote on this poll

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-01-2006, 04:29 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Reset on Login (Text-Saved)

Text saved for reset. Also allows you to just change a variable to reset everyone easily =). Basically, on login it checks if your reset version is less then the players current version.. if it is lower it will reset you first (for security issues) and then add it. Works great, and well. =). Have fun, don't forget to rep!

In Control-NPC:
PHP Code:
function onCreated()
{
  
this.resetver 1;
}

function 
onActionPlayerOnline()
{
  
temp.rplayers.loadvars("resetlog.txt");

  if (
makevar("temp.rplayers.acct_" player.account) < this.resetver)
  {
    
sendtorc(format("/reset %s"player.account));

    
makevar("temp.rplayers.acct_" player.account) = this.resetver;
    
temp.rplayers.savevars("resetlog.txt"0);
    return 
false;
  }

  
// Whatever else you possibly have in the control-npc under actionplayeronline you can place here =).

The text file should be stored in scriptfiles/resetlog.txt.

Example File
acct_KuJi=1
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:00 PM.


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