$gServerTimeVar2 counts production cycles on zoric which run every hour.
$gPlayerTimeVar2 records the last production cycle a player was active on the world.
$gPlayerVar50 just specifies whether a player is frozen or not, to eliminate this script from wiping them
I can't really test this script on zoric, so does anybody see any issues with it that would cause it to mess up and not work as intended?
Code: Select all
Event( "Custom", "wiper" )
{
$playerid=sysGetPlayerID("%player%")
$online=sysIsPlayerIDOnline("$playerid")
$wipetimer=$gPlayerTimeVar2+480
$kicktimer=$gPlayerTimeVar2+240
if ($online=0)
{
if ($gServerTimeVar2>$wipetimer)
{
if ($gPlayerVar50=0)
{
$var=$gServerTimeVar2-$gPlayerTimeVar2
*log %player% wiped - $var cycles since last login
*wipe %player%
$wiped=$wiped+1
}
if ($gPlayerVar50=1)
{
$var=$gServerTimeVar2-$gPlayerTimeVar2
*log %player% on vacation - not wiped. $var cycles since last login
}
}
}
if ($online=1)
{
if ($gServerTimeVar2>$kicktimer)
{
$var=$gServerTimeVar2-$gPlayerTimeVar2
*log %player% autokicked - $var cycles since last login
$gServerTimeVar2=$gPlayerTimeVar2
*kick %player%
}
}
}
Anytime a player logs in or accesses a building $gPlayerTimeVar2 is set to equal $gServerTimeVar2 to show their last active production cycle. If a player is online for 10 real days without accessing any building (because they are in their house that whole time) the script will kick them and update their timevar. If a player goes 20 real days without logging in, they get automatically wiped, unless they are in vacation mode.
This will keep the overall player record size down.