Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Reset on Login (Text-Saved) (https://forums.graalonline.com/forums/showthread.php?t=69096)

KuJi 10-01-2006 04:29 AM

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

WanDaMan 10-01-2006 03:54 PM

If I had a server it'd be a good asset. Nice job =)

Skyld 10-01-2006 04:03 PM

Bleh. makevar() :mad:!

Simple but effective, none the less.

xXziroXx 10-01-2006 04:07 PM

Quote:

Originally Posted by Skyld (Post 1224456)
Bleh. makevar() :mad:!

Simple but effective, none the less.

Whats wrong with makevar()? :o

Skyld 10-01-2006 04:21 PM

Quote:

Originally Posted by xXziroXx (Post 1224458)
Whats wrong with makevar()? :o

I just prefer using temp.foo.(@ bar). I find it clearer.

xAndrewx 10-01-2006 05:08 PM

Very cool =]

KuJi 10-01-2006 05:14 PM

Quote:

Originally Posted by Skyld (Post 1224461)
I just prefer using temp.foo.(@ bar). I find it clearer.

I find it ugly =(.

xXziroXx 10-01-2006 07:05 PM

Quote:

Originally Posted by Skyld (Post 1224461)
I just prefer using temp.foo.(@ bar). I find it clearer.

Haha same here, maybe because you taught me the basics of gs2? :p

xAndrewx 10-01-2006 07:54 PM

Quote:

Originally Posted by xXziroXx (Post 1224575)
Haha same here, maybe because you taught me the basics of gs2? :p

Here too, I thought I was the only one... :cry:

Twinny 10-02-2006 06:41 AM

I always used clientr flags for this. Doesn't really matter in the end i guess.


All times are GMT +2. The time now is 12:04 AM.

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